Description Usage Arguments Value Author(s) References Examples
Conduct longitudinal principal component regression with model selection
1 2 3 4 |
Y |
Outcome in PCR |
Xmat |
Longitudinal Predictor Matrix |
lfpca |
(default=NULL) LFPC results. If it is not specified, the following parameters have to be specified to run LPCA |
cov |
Covariate |
T |
Time of theimage collection |
J |
Total number of observations |
I |
Total number of subjects |
visit |
Vector of number of visits per subjects |
varthresh |
(default=0.99) Threshold for variance explained for both subject-specific and subject-visit specific compoents for dimension selection |
timeadjust |
(default=TRUE) Scale time per subject |
method |
(default=AUC) backward selection criteria. c('AUC','bic','aic') |
verbose |
(default=FALSE) |
Nx |
Dimension of the subject-specific components |
Nw |
Dimension of the subject-visit specific components |
projectthresh |
Threshold for variance explain in the first step of SVD |
xi
phix0
phix1
zeta
phiw
Seonjoo Lee, sl3670@cumc.columbia.edu
TBA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | I=200
visit=rpois(I,1)+3
time = unlist(lapply(visit, function(x) scale(c(0,cumsum(rpois(x-1,1)+1)))))
J = sum(visit)
V=1000
phix0 = matrix(0,V,3);phix0[1:50,1]<-.1;phix0[1:50 + 50,2]<-.1;phix0[1:50 + 100,3]<-.1
phix1 = matrix(0,V,3);phix1[1:50+150,1]<-.1;phix1[1:50 + 200,2]<-.1;phix1[1:50 + 250,3]<-.1
phiw = matrix(0,V,3);phiw[1:50+300,1]<-.1;phiw[1:50 + 350,2]<-.1;phiw[1:50 + 400,3]<-.1
xi = t(matrix(rnorm(I*3),ncol=I)*c(8,4,2))*3
zeta = t(matrix(rnorm(J*3),ncol=J)*c(8,4,2))*2
Xmat = phix0%*% t(xi[rep(1:I, visit),]) + phix1%*% t(time * xi[rep(1:I, visit),]) + phiw %*% t(zeta) + matrix(rnorm(V*J,0,.1),V,J)
beta=c(1,-1,1)/10
p=exp( - xi %*% beta)/(1 + exp( - xi %*% beta))
Y = unlist(lapply(p,function(x)rbinom(1,1,prob=x)))
re<-hd_lfpca(Ydat,Xmat,T,J,I,visit, varthresh=0.85, timeadjust=FALSE)
lpcr.backward(Y,lfpca=re)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.