Package gsscopu. R topics documented: July 2, Version Date

Similar documents
Package survivalmpl. December 11, 2017

The gss Package. September 25, Description A comprehensive package for structural multivariate function estimation using smoothing splines.

Package SAMUR. March 27, 2015

Package DSBayes. February 19, 2015

Package rvinecopulib

Package intccr. September 12, 2017

Package PTE. October 10, 2017

Package sparsereg. R topics documented: March 10, Type Package

Package gss. R topics documented: April 19, 2018

Package RankAggreg. May 15, 2018

Package pendvine. R topics documented: July 9, Type Package

Package SmoothHazard

Package bayesdp. July 10, 2018

Package spatialtaildep

Package gibbs.met. February 19, 2015

Package simsurv. May 18, 2018

Package freeknotsplines

Package vinereg. August 10, 2018

Package DTRreg. August 30, 2017

Package RaschSampler

Package mixphm. July 23, 2015

Package logspline. February 3, 2016

NONPARAMETRIC REGRESSION SPLINES FOR GENERALIZED LINEAR MODELS IN THE PRESENCE OF MEASUREMENT ERROR

Package SPREDA. November 25, 2018

Package Numero. November 24, 2018

Package kdevine. May 19, 2017

Package penrvine. R topics documented: May 21, Type Package

Package permuco. February 14, Type Package

Package frailtysurv. August 28, 2018

Package pnmtrem. February 20, Index 9

Package ICEbox. July 13, 2017

Package InformativeCensoring

Package rgcvpack. February 20, Index 6. Fitting Thin Plate Smoothing Spline. Fit thin plate splines of any order with user specified knots

Package ssa. July 24, 2016

Package mrm. December 27, 2016

Package snm. July 20, 2018

Package addhaz. September 26, 2018

Package gee. June 29, 2015

Package benchden. February 19, 2015

Package GWRM. R topics documented: July 31, Type Package

Package fcopulae. November 16, 2017

Package r2d2. February 20, 2015

Package MatchIt. April 18, 2017

Package ccapp. March 7, 2016

Package intcensroc. May 2, 2018

Package cgh. R topics documented: February 19, 2015

Package libstabler. June 1, 2017

Package nlnet. April 8, 2018

Package lmesplines. R topics documented: February 20, Version

Package risksetroc. February 20, 2015

The biglm Package. August 25, bigglm... 1 biglm Index 5. Bounded memory linear regression

Package robustreg. R topics documented: April 27, Version Date Title Robust Regression Functions

The exactloglintest Package

Package SSRA. August 22, 2016

Package SmoothHazard

Package gamm4. July 25, Index 10

Package Density.T.HoldOut

Package rpst. June 6, 2017

Package extweibquant

Package RWiener. February 22, 2017

Package ETC. February 19, 2015

Package RaPKod. February 5, 2018

Package pencopula. R topics documented: August 31, Type Package

Assessing the Quality of the Natural Cubic Spline Approximation

Package MIICD. May 27, 2017

Using the DATAMINE Program

Package marqlevalg. February 20, 2015

Package dkdna. June 1, Description Compute diffusion kernels on DNA polymorphisms, including SNP and bi-allelic genotypes.

Package naivebayes. R topics documented: January 3, Type Package. Title High Performance Implementation of the Naive Bayes Algorithm

Package epitab. July 4, 2018

Package mhde. October 23, 2015

Package texteffect. November 27, 2017

Package GLDreg. February 28, 2017

Splines. Patrick Breheny. November 20. Introduction Regression splines (parametric) Smoothing splines (nonparametric)

The exactloglintest Package

Package lclgwas. February 21, Type Package

Package cwm. R topics documented: February 19, 2015

Package OptimaRegion

Package ICsurv. February 19, 2015

Package rankdist. April 8, 2018

Package FHtest. November 8, 2017

Package MTLR. March 9, 2019

Package ssmn. R topics documented: August 9, Type Package. Title Skew Scale Mixtures of Normal Distributions. Version 1.1.

Package quickreg. R topics documented:

Package Rtsne. April 14, 2017

Package ANOVAreplication

Package tpr. R topics documented: February 20, Type Package. Title Temporal Process Regression. Version

Package CGP. June 12, 2018

Package ms.sev. R topics documented: December 21, Type Package

book 2014/5/6 15:21 page v #3 List of figures List of tables Preface to the second edition Preface to the first edition

Statistical Modeling with Spline Functions Methodology and Theory

Package deming. June 19, 2018

Package glmmml. R topics documented: March 25, Encoding UTF-8 Version Date Title Generalized Linear Models with Clustering

Package tseriesentropy

Splines and penalized regression

Package sp23design. R topics documented: February 20, Type Package

Package CoImp. August 8, 2016

Technical Support Minitab Version Student Free technical support for eligible products

Multivariate probability distributions

Package rmi. R topics documented: August 2, Title Mutual Information Estimators Version Author Isaac Michaud [cre, aut]

Transcription:

Package gsscopu July 2, 2015 Version 0.9-3 Date 2014-08-24 Title Copula Density and 2-D Hazard Estimation using Smoothing Splines Author Chong Gu <chong@purdue.edu> Maintainer Chong Gu <chong@purdue.edu> Depends R (>= 2.14.0), stats, gss (>= 2.1-0) A collection of routines for the estimation of copula density and 2-D hazard function using smoothing splines. License GPL (>= 2) NeedsCompilation yes Repository CRAN Date/Publication 2015-07-02 18:31:34 R topics documented: cdsscopu........................................... 2 DiaRet............................................ 2 dsscopu........................................... 3 hzdrate.sshzd2d....................................... 4 sscopu............................................ 5 sshzd2d........................................... 7 summary.sscopu....................................... 9 Index 10 1

2 DiaRet cdsscopu Evaluating 1-D Conditional PDF, CDF, and Quantiles of Copula Density Estimates Evaluate conditional pdf, cdf, and quantiles of copula density estimates. cdsscopu(object, x, cond, pos=1, int=null) cpsscopu(object, q, cond, pos=1) cqsscopu(object, p, cond, pos=1) object x cond pos int q p Object of class "sscopu". Vector of points on which conditional pdf is to be evaluated. of conditioning variables. Position of variable of interest. Normalizing constant. Vector of points on which conditional cdf is to be evaluated. Vector of probabilities for which conditional quantiles are to be calculated. A vector of conditional pdf, cdf, or quantiles. See Also Fitting functions sscopu and sscopu2, and dsscopu. DiaRet Diabetic Retinopathy Time to blindness of 197 diabetic retinopathy patients who received a laser treatment in one eye. data(diaret) Format A data frame containing 197 observations on the following variables.

dsscopu 3 id time1 time2 status1 status2 trt1 trt2 type age time.t time.u status.t status.u Patient ID. Follow-up time of left eye. Follow-up time of right eye. Censoring indicator of left eye. Censoring indicator of right eye. Treatment indicator of left eye. Treatment indicator of right eye. Type of diabetes. Age of patient at diagnosis. Follow-up time of treated eye. Follow-up time of untreated eye. Censoring indicator of treated eye. Censoring indicator of untreated eye. Source This is reformatted from the data frame diabetes in the R package timereg by Thomas H. Scheike. References Huster, W.J., Brookmeyer, R., and Self, S.G. (1989), Modelling paired survival data with covariates. Biometrics, 45, 145 56. dsscopu Evaluating Copula Density Estimates Evaluate copula density estimates. dsscopu(object, x, copu=true) object x copu Object of class "sscopu". Vector or matrix of point(s) on which copula density is to be evaluated. Flag indicating whether to apply copularization. A vector of copula density values. See Also Fitting functions sscopu and sscopu2.

4 hzdrate.sshzd2d hzdrate.sshzd2d Evaluating 2-D Smoothing Spline Hazard Estimates Evaluate 2-D smoothing spline hazard estimates by sshzd2d. hzdrate.sshzd2d(object, time, covariates=null) survexp.sshzd2d(object, time, covariates=null, job=3) object time covariates job Object of class "sshzd2d". Matrix or vector of time points on which hazard or survival function is to be evaluated. Data frame of covariate values. Flag indicating which survival function to evaluate. A vector of hazard or survival values. Note For job=1,2, survexp.sshzd2d returns marginal survival S1(t) or S2(t). For job=3, survexp.sshzd2d returns the 2-D survival S(t1, t2). For hzdrate.sshzd2d and survexp.sshzd2d with job=3, time should be a matrix of two columns. For survexp.sshzd2d with job=1,2, time should be a vector. When covariates is present, its length should be either 1 or that of time. See Also Fitting function sshzd2d.

sscopu 5 sscopu Estimating Copula Density Using Smoothing Splines Estimate copula densities using tensor-product cubic splines. sscopu(x, symmetry=false, alpha=1.4, order=null, exclude=null, weights=null, id.basis=null, nbasis=null, seed=null, qdsz.depth=null, prec=1e-7, maxiter=30, skip.iter=dim(x)[2]!=2) sscopu2(x, censoring=null, truncation=null, symmetry=false, alpha=1.4, weights=null, id.basis=null, nbasis=null, seed=null, prec=1e-7, maxiter=30) x symmetry order exclude alpha weights id.basis nbasis seed qdsz.depth prec maxiter skip.iter censoring truncation Matrix of observations on unit cubes. Flag indicating whether to enforce symmetry, or invariance under coordinate permutation. Highest order of interaction terms in log density. When NULL, it is set to dim(x)[2] internally. Pair(s) of marginals whose interactions to be excluded in log density. Parameter defining cross-validation score for smoothing parameter selection. Optional vector of bin-counts for histogram data. Index of observations to be used as "knots." Number of "knots" to be used. Ignored when id.basis is specified. Seed to be used for the random generation of "knots." Ignored when id.basis is specified. Depth to be used in smolyak.quad for the generation of quadrature. Precision requirement for internal iterations. Maximum number of iterations allowed for internal iterations. Flag indicating whether to use initial values of theta and skip theta iteration. See ssanova for notes on skipping theta iteration. Optional censoring indicator. Optional truncation points.

6 sscopu Details Note sscopu is essentially ssden applied to observations on unit cubes. Instead of variables in data frames, the data are entered as a numerical matrix, and model complexity is globally controlled by the highest order of interactions allowed in log density. sscopu2 further restricts the domain to the unit square, but allows for possible censoring and truncation. With censoring==0,1,2,3, a data point (x1, x2) represents exact observation, [0, x1]xx2, x1x[0, x2], or [0, x1]x[0, x2]. With truncation point (t1, t2), the sample is taken from [0, t1]x[0, t2] instead of the unit square. With symmetriy=true, one may enforce the interchangeability of coordinates so that f(x1, x2) = f(x2, x1), say. When (1,2) is a row in exclude, interaction terms involving coordinates 1 and 2 are excluded. sscopu and sscopu2 return a list object of class "sscopu". dsscopu can be used to evaluate the estimated copula density. A "copularization" process is applied to the estimated density by default so the resulting marginal densities are guaranteed to be uniform. cdsscopu, cpsscopu, and cqsscopu can be used to evaluate 1-D conditional pdf, cdf, and quantiles. For reasonable execution time in higher dimensions, set skip.iter=true in calls to sscopu. When "Newton iteration diverges" in sscopu, try to use a larger qdsz.depth; the default values for dimensions 2, 3, 4, 5, 6+ are 24, 14, 12, 11, 10. To be sure a larger qdsz.depth indeed makes difference, verify the cubature size using smolyak.size. The results may vary from run to run. For consistency, specify id.basis or set seed. Author(s) Chong Gu, <chong@stat.purdue.edu> References Gu, C. (2013), Smoothing Spline ANOVA Models. New York: Springer-Verlag. Gu, C. (2013), Hazard estimation with bivariate survival data and copula density estimation. Examples ## simulate 2-D data x <- matrix(runif(200),100,2) ## fit copula density fit <- sscopu(x) ## "same fit" fit2 <- sscopu2(x,id=fit$id) ## symmetric fit fit.s <- sscopu(x,sym=true,id=fit$id) ## Kendall s tau and Spearman s rho summary(fit); summary(fit2); summary(fit.s)

sshzd2d 7 ## clean up ## Not run: rm(x,fit,fit2,fit.s) sshzd2d Estimating 2-D Hazard Function Using Smoothing Splines Estimate 2-D hazard function using smoothing spline ANOVA models. sshzd2d(formula1, formula2, symmetry=false, data, alpha=1.4, weights=null, subset=null, id.basis=null, nbasis=null, seed=null, prec=1e-7, maxiter=30, skip.iter=false) sshzd2d1(formula1, formula2, symmetry=false, data, alpha=1.4, weights=null, subset=null, rho="marginal", id.basis=null, nbasis=null, seed=null, prec=1e-7, maxiter=30, skip.iter=false) formula1 formula2 symmetry data alpha weights subset id.basis nbasis seed prec maxiter skip.iter rho of the hazard model to be fit on the first axis. of the hazard model to be fit on the second axis. Flag indicating whether to enforce symmetry of the two axes. Data frame containing the variables in the model. Parameter defining cross-validation scores for smoothing parameter selection. Optional vector of counts for duplicated data. Optional vector specifying a subset of observations to be used in the fitting process. Index of observations to be used as "knots." Number of "knots" to be used. Ignored when id.basis is specified. Seed to be used for the random generation of "knots." Ignored when id.basis is specified. Precision requirement for internal iterations. Maximum number of iterations allowed for internal iterations. Flag indicating whether to use initial values of theta and skip theta iteration in marginal hazard estimation. Choice of rho function for sshzd2d1: "marginal" or "weibull".

8 sshzd2d Details The 2-D survival function is expressed as S(t1, t2) = C(S1(t1), S2(t2)), where S1(t1), S2(t2) are marginal survival functions and C(u1, u2) is a 2-D copula. The marginal survival functions are estimated via the marginal hazards as in sshzd, and the copula is estimated nonparametrically by calling sscopu2. When symmetry=true, a common marginal survial function S1(t)=S2(t) is estimated, and a symmetric copula is estimated such that C(u1, u2) = C(u2, u1). Covariates can be incorporated in the marginal hazard models as in sshzd, including parametric terms via partial and frailty terms via random. formula1 and formula2 are typically model formulas of the same form as the argument formula in sshzd, but when partial or random are needed, formula1 and formula2 should be lists with model formulas as the first elements and partial/random as named elements; when necessary, variable configurations (that are done via argument type in sshzd) should also be entered as named elements of lists formula1/formula2. When symmetry=true, parallel model formulas must be consistent of each other, such as formula1=list(surv(t1,d1)~t1*u1,partial=~z1,random=~1 id1) formula2=list(surv(t2,d2)~t2*u2,partial=~z2,random=~1 id2) Note where pairs t1-t2, d2-d2 respectively are different elements in data, pairs u1-u2, z1-z2 respectively may or may not be different elements in data, and factors id1 and id2 are typically the same but at least should have the same levels. sshzd2d and sshzd2d1 return a list object of class "sshzd2d". hzdrate.sshzd2d can be used to evaluate the estimated 2-D hazard function. survexp.sshzd2d can be used to calculate estimated survival functions. sshzd2d1 executes faster than sshzd2d, but often at the cost of performance degradation. The results may vary from run to run. For consistency, specify id.basis or set seed. Author(s) Chong Gu, <chong@stat.purdue.edu> References Gu, C. (2013), Hazard estimation with bivariate survival data and copula density estimation. Examples ## THE FOLLOWING EXAMPLE IS TIME-CONSUMING ## Not run: data(diaret) ## Common proportional hazard model on the margins fit <- sshzd2d(surv(time1,status1)~time1+trt1*type,

summary.sscopu 9 Surv(time2,status2)~time2+trt2*type, data=diaret,symmetry=true) ## Evaluate fitted survival and hazard functions time <- cbind(c(50,70),c(70,70)) cova <- data.frame(trt1=as.factor(c(1,1)),trt2=as.factor(c(1,0)), type=as.factor(c("juvenile","adult"))) survexp.sshzd2d(fit,time,cov=cova) hzdrate.sshzd2d(fit,time,cov=cova) ## Association between margins: Kendall s tau and Spearman s rho summary(fit$copu) ## Clean up rm(diaret,fit,time,cova) dev.off() ## End(Not run) summary.sscopu Calculating Kendall s Tau and Spearman s Rho for 2-D Copula Density Estimates Calculate Kendall s tau and Spearman s rho for 2-D copula density estimates. ## S3 method for class sscopu summary(object,...) object See Also... Ignored. Object of class "sscopu". A list containing Kendall s tau and Spearman s rho. Fitting functions sscopu and sscopu2.

Index Topic datasets DiaRet, 2 Topic distribution cdsscopu, 2 dsscopu, 3 sscopu, 5 summary.sscopu, 9 Topic models cdsscopu, 2 dsscopu, 3 hzdrate.sshzd2d, 4 sscopu, 5 sshzd2d, 7 summary.sscopu, 9 Topic smooth cdsscopu, 2 dsscopu, 3 hzdrate.sshzd2d, 4 sscopu, 5 sshzd2d, 7 summary.sscopu, 9 Topic survival hzdrate.sshzd2d, 4 sshzd2d, 7 sscopu2, 2, 3, 8, 9 sscopu2 (sscopu), 5 ssden, 6 sshzd, 8 sshzd2d, 4, 7 sshzd2d1 (sshzd2d), 7 summary.sscopu, 9 survexp.sshzd2d, 8 survexp.sshzd2d (hzdrate.sshzd2d), 4 cdsscopu, 2, 6 cpsscopu, 6 cpsscopu (cdsscopu), 2 cqsscopu, 6 cqsscopu (cdsscopu), 2 DiaRet, 2 dsscopu, 2, 3, 6 hzdrate.sshzd2d, 4, 8 smolyak.quad, 5 smolyak.size, 6 ssanova, 5 sscopu, 2, 3, 5, 9 10