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

Similar documents
Package DSBayes. February 19, 2015

Package gee. June 29, 2015

Package survivalmpl. December 11, 2017

Package MIICD. May 27, 2017

Package clusterpower

Package coxsei. February 24, 2015

Package intccr. September 12, 2017

Package endogenous. October 29, 2016

Package nricens. R topics documented: May 30, Type Package

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

Package PTE. October 10, 2017

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

Package DTRreg. August 30, 2017

Package citools. October 20, 2018

Package ICsurv. February 19, 2015

Package optimus. March 24, 2017

Package simmsm. March 3, 2015

Package binomlogit. February 19, 2015

Package samplingdatacrt

Package rereg. May 30, 2018

Package sbf. R topics documented: February 20, Type Package Title Smooth Backfitting Version Date Author A. Arcagni, L.

Package GLDreg. February 28, 2017

Package gibbs.met. February 19, 2015

Package BGPhazard. R topics documented: February 11, Version Date

Package texteffect. November 27, 2017

Package ssd. February 20, Index 5

Package binmto. February 19, 2015

Package gplm. August 29, 2016

Package swcrtdesign. February 12, 2018

Package misclassglm. September 3, 2016

The glmmml Package. August 20, 2006

Package MetaLasso. R topics documented: March 22, Type Package

Package qvcalc. R topics documented: September 19, 2017

Package JGEE. November 18, 2015

Package FWDselect. December 19, 2015

Package pnmtrem. February 20, Index 9

Package simsurv. May 18, 2018

Package glinternet. June 15, 2018

Package rpst. June 6, 2017

Package lclgwas. February 21, Type Package

Package detect. February 15, 2013

Package SmoothHazard

Package modmarg. R topics documented:

Package ClusterBootstrap

Package TANDEM. R topics documented: June 15, Type Package

Package hiernet. March 18, 2018

Package cgh. R topics documented: February 19, 2015

Package lvm4net. R topics documented: August 29, Title Latent Variable Models for Networks

Package CausalImpact

Package StVAR. February 11, 2017

Package Density.T.HoldOut

Ludwig Fahrmeir Gerhard Tute. Statistical odelling Based on Generalized Linear Model. íecond Edition. . Springer

Package bdots. March 12, 2018

Package SSLASSO. August 28, 2018

Package bayesdp. July 10, 2018

Package GAMBoost. February 19, 2015

Package sure. September 19, 2017

Package treedater. R topics documented: May 4, Type Package

Package merror. November 3, 2015

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package frailtysurv. August 28, 2018

Package munfold. R topics documented: February 8, Type Package. Title Metric Unfolding. Version Date Author Martin Elff

Package gamm4. July 25, Index 10

Package GWAF. March 12, 2015

Package DBfit. October 25, 2018

Package EBglmnet. January 30, 2016

Package ThreeArmedTrials

Package mmeta. R topics documented: March 28, 2017

Package risksetroc. February 20, 2015

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

Minitab 17 commands Prepared by Jeffrey S. Simonoff

Package DTRlearn. April 6, 2018

Package MeanShift. R topics documented: August 29, 2016

Package tatest. July 18, 2018

Package CVR. March 22, 2017

Package MultiMeta. February 19, 2015

Package oaxaca. January 3, Index 11

Package DPBBM. September 29, 2016

The binmto Package. August 25, 2007

The dblcens Package. August 7, Title Compute the NPMLE of distribution from doubly censored data. d d011ch... 4.

Package RegressionFactory

Package rdd. March 14, 2016

Package quickreg. R topics documented:

R topics documented: 2 genbernoullidata

Package robustgam. February 20, 2015

Package flam. April 6, 2018

Package RWiener. February 22, 2017

Package MultiRR. October 21, 2015

Package mreg. February 20, 2015

The segmented Package

Package birtr. October 4, 2017

Package PDN. November 4, 2017

Package mvprobit. November 2, 2015

Package ADMM. May 29, 2018

Package cwm. R topics documented: February 19, 2015

Package simctest. March 23, 2017

Package sciplot. February 15, 2013

Package mvpot. R topics documented: April 9, Type Package

Package plsrbeta. February 20, 2015

Acknowledgments. Acronyms

Transcription:

Package tpr February 20, 2015 Type Package Title Temporal Process Regression Version 0.3-1 Date 2010-04-11 Author Jun Yan <jyan@stat.uconn.edu> Maintainer Jun Yan <jyan@stat.uconn.edu> Regression models for temporal process responses with time-varying coefficient. Depends stats, lgtdl License GPL (>= 3) Repository CRAN Date/Publication 2010-04-12 06:47:51 NeedsCompilation yes R topics documented: tpr-package......................................... 2 ci.plot............................................ 2 dnase............................................ 3 tpr.............................................. 5 tpr.pfit............................................ 7 tpr.test............................................ 8 Index 10 1

2 ci.plot tpr-package Temporal Process Regression Fit regression models for temporal process responses with time-varying and time-independent coefficients. Details An overview of how to use the package, including the most important functions Author(s) Jun Yan <jyan@stat.uconn.edu> References Fine, Yan, and Kosorok (2004): Temporal Process Regression. Biometrika. ci.plot Confidence Interval Plot Plotting time-varying coefficient with pointwise confidence. Usage ci.plot(x, y, se, level = 0.95, ylim = NULL, newplot = TRUE, fun = gaussian()$linkinv, dfun = gaussian( Arguments x the x coordinate y the y coordinate se the standard error of y level confidence level ylim the range of y axis newplot if TRUE, draw a new plot fun a transform function dfun the derivative of the tranform function... arguments to be passed to plot Author(s) Jun Yan <jyan@stat.uconn.edu>

dnase 3 dnase rhdnase Data Randomized trial of rhdnase for treatment of cystic fibrosis Usage data(dnase) Format A data frame with 767 observations on the following 6 variables. id subject id rx treatment arm: 0 = placebo, 1 = rhdnase fev forced expirotary volume, a measure of lung capacity futime follow time iv1 IV start time iv2 IV stop time Details During an exacerbation, patients received intravenous (IV) antibiotics and were considered unsusceptible until seven exacerbation-free days beyond the end of IV therapy. A few subjects were infected at the time of enrollment, for instance a subject has a first infection interval of -21 to 7. We do not count this first infection as an "event", and the subject first enters the risk set at day 7. Source Therneau and Grambsch (2000). Modeling Survival Data: Extending the Cox model. Springer. http://www.mayo.edu/hsr/people/therneau/book/data/dnase.html References Yan and Fine (2008). Analysis of Episodic Data with Application to Recurrent Pulmonary Exacerbations in Cystic Fibrosis Patients. JASA.

4 dnase Examples ## This example steps through how to set up for the tpr function. ## Three objects are needed: ## 1) response process (an object of "lgtdl") ## 2) data availability process (an object of "lgtdl") ## 3) a time-independent covariate matrix data(dnase) ## extracting the unique id and subject level information dat <- unique(dnase[,c("id", "futime", "fev", "rx")]) ## construct temporal process response for recurrent enent rec <- lapply(split(dnase[,c("id", "iv1", "futime")], dnase$id), function(x) { v <- x$iv1 maxfu <- max(x$futime) ## iv1 may be negative!!! if (is.na(v[1])) c(0, maxfu + 1.0) else if (v[1] < 0) c(v[1] - 1, v[!is.na(v)], maxfu + 1.0) else c(0, v[!is.na(v)], maxfu + 1.0) }) yrec <- lapply(rec, function(x) { dat <- data.frame(time=x, cov=1:length(x)-1) len <- length(x) dat$cov[len] <- dat$cov[len - 1] as.lgtdl(dat) }) ## construct temporal process response for accumulative days exacerbation do1.acc <- function(x) { gap <- x$iv2 - x$iv1 + 1 if (all(is.na(gap))) yy <- tt <- NULL else { gap <- na.omit(gap) yy <- cumsum(rep(1, sum(gap))) tt <- unlist(sapply(1:length(gap), function(i) seq(x$iv1[i], x$iv2[i], by=1.0))) } yy <- c(0, yy, rev(yy)[1]) if (!is.null(tt[1]) && tt[1] < 0) tt <- c(tt[1] - 1, tt, max(x$futime) + 1.0) else tt <- c(0, tt, max(x$futime) + 1.0) as.lgtdl(data.frame(time=tt, cov=yy)) } yacc <- lapply(split(dnase[,c("id", "iv1", "iv2", "futime")], dnase$id), do1.acc) ## construct data availability (or at risk) indicator process

tpr 5 tu <- max(dat$futime) + 0.001 rt <- lapply(1:nrow(dat), function(i) { x <- dat[i, "futime"] time <- c(0, x, tu) cov <- c(1, 0, 0) as.lgtdl(data.frame(time=time, cov=cov)) }) ## time-independent covariate matrix xmat <- model.matrix(~ rx + fev, data=dat) ## time-window in days tlim <- c(10, 168) good <- unlist(lapply(yrec, function(x) x$time[1] == 0)) ## fully functional temporal process regression ## for recurrent event m.rec <- tpr(yrec, rt, xmat[,1:3], list(), xmat[,-(1:3),drop=false], list(), tis=10:160, w = rep(1, 151), family = poisson(), evstr = list(link = 5, v = 3)) par(mfrow=c(1,3), mgp=c(2,1,0), mar=c(4,2,1,0), oma=c(0,2,0,0)) for(i in 1:3) ci.plot(m.rec$tis, m.rec$alpha[,i], sqrt(m.rec$valpha[,i])) ## hypothesis test of significance ## integral test, covariate index 2 and 3 sig.test.int.ff(m.rec, idx=2:3, ncut=2) sig.test.boots.ff(m.rec, idx=2:3, nsim=1000) ## constant fit cfit <- cst.fit.ff(m.rec, idx=2:3) ## goodness-of-fit test for constant fit gof.test.int.ff(m.rec, idx=2:3, ncut=2) gof.test.boots.ff(m.rec, idx=2:3, nsim=1000) ## for cumulative days in exacerbation m.acc <- tpr(yacc, rt, xmat[,1:3], list(), xmat[,-(1:3),drop=false], list(), tis=10:160, w = rep(1, 151), family = gaussian(), evstr = list(link = 1, v = 1)) par(mfrow=c(1,3), mgp=c(2,1,0), mar=c(4,2,1,0), oma=c(0,2,0,0)) for(i in 1:3) ci.plot(m.acc$tis, m.acc$alpha[,i], sqrt(m.acc$valpha[,i])) tpr Temporal Process Regression

6 tpr Regression for temporal process responses and time-independent covariate. Some covariates have time-varying coefficients while others have time-independent coefficients. Usage tpr(y, delta, x, xtv=list(), z, ztv=list(), w, tis, family = poisson(), evstr = list(link = 5, v = 3), alpha = NULL, theta = NULL, tidx = 1:length(tis), kernstr = list(kern=1, poly=1, band=range(tis)/50), control = list(maxit=25, tol=0.0001, smooth=0, intsmooth=0)) Arguments y delta x xtv z ztv w tis family Response, a list of "lgtdl" objects. Data availability indicator, a list of "lgtdl" objects. Covariate matrix for time-varying coefficients. A list of list of "lgtdl" for time-varying covariates with time-varying coefficients. NOT READY YET; Covariate matrix for time-independent coefficients. NOT READY YET; A list of list of "lgtdl" for time-varying covariates with time-independent coefficients. Weight vector with the same length of tis. A vector of time points at which the model is to be fitted. Specification of the response distribution; see family for glm; this argument is used in getting initial estimates. evstr A list of two named components, link function and variance function. link: 1 = identity, 2 = logit, 3 = probit, 4 = cloglog, 5 = log; v: 1 = gaussian, 2 = binomial, 3 = poisson alpha theta tidx A matrix supplying initial values of alpha. A numeric vector supplying initial values of theta. indices for time points used to get initial values. kernstr A list of two names components: kern: 1 = Epanechnikov, 2 = triangular, 0 = uniform; band: bandwidth control A list of named components: maxit: maximum number of iterations; tol: tolerance level of iterations. smooth: 1 = smoothing; 0 = no smoothing. Details This rapper function can be made more user-friendly in the future. For example, evstr can be determined from the family argument.

tpr.pfit 7 Value An object of class "tpr": tis alpha beta valpha vbeta niter infalpha infbeta same as the input argument estimate of time-varying coefficients estimate of time-independent coefficients a matrix of variance of alpha at tis a matrix of variance of beta at tis the number of iterations used a list of influence functions for alpha a matrix of influence functions for beta Author(s) Jun Yan <jyan@stat.uconn.edu> References Fine, Yan, and Kosorok (2004). Temporal Process Regression. Biometrika. Yan and Huang (2009). Partly Functional Temporal Process Regression with Semiparametric Profile Estimating Functions. Biometrics. tpr.pfit Constant fit of coefficients in a TPR model Weighted least square estimate of a constant model for time-varying coefficients in a TPR model. Usage cst.fit.ff(fit, idx) Arguments fit idx a fitted object from tpr the index of the Value The estimated constant fit, standard error, z-value and p-value. Author(s) Jun Yan <jyan@stat.uconn.edu>

8 tpr.test References Fine, Yan, and Kosorok (2004). Temporal Process Regression. Biometrika. See Also tpr.test tpr.test Significance and Goodness-of-fit Test of TPR Two kinds of tests are provided for inference on the coefficients in a fully functional TRP model: integral test and bootstrap test. Usage sig.test.int.ff(fit, chypo = 0, idx, weight = TRUE, ncut = 2) sig.test.boots.ff(fit, chypo = 0, idx, nsim = 1000, plot = FALSE) gof.test.int.ff(fit, cfitlist = NULL, idx, weight = TRUE, ncut = 2) gof.test.boots.ff(fit, cfitlist = NULL, idx, nsim = 1000, plot = FALSE) gof.test.boots.pf(fit1, fit2, nsim, p = NULL, q = 1) Arguments fit chypo idx weight ncut cfitlist nsim plot fit1 fit2 p q a fitted object from tpr hypothesized value of coefficients the index of the coefficients to be tested whether or not use inverse variation weight the number of cuts of the interval of interest in integral test a list of fitted object from cst.fit.ff the number of bootstrap samples in bootstrap test whether or not plot fit of H0 model (reduced) fit of H1 model (full) the index of the time-varying estimation in fit2 the index of the time-independent estimation in fit1 Value Test statistics and their p-values.

tpr.test 9 Author(s) Jun Yan <jyan@stat.uconn.edu> References Fine, Yan, and Kosorok (2004). Temporal Process Regression. Biometrika. See Also tpr Examples ## see?tpr

Index Topic aplot ci.plot, 2 Topic datasets dnase, 3 Topic hplot ci.plot, 2 Topic htest tpr.test, 8 Topic models tpr.pfit, 7 Topic multivariate tpr.test, 8 Topic package tpr-package, 2 Topic regression tpr, 5 Topic robust tpr, 5 tpr.pfit, 7 ci.plot, 2 cst.fit.ff (tpr.pfit), 7 dnase, 3 gof.test.boots.ff (tpr.test), 8 gof.test.boots.pf (tpr.test), 8 gof.test.int.ff (tpr.test), 8 sig.test.boots.ff (tpr.test), 8 sig.test.int.ff (tpr.test), 8 tpr, 5, 9 tpr-package, 2 tpr.pfit, 7 tpr.test, 8, 8 10