Description Usage Arguments Value Examples
modelFit_VS
outputs the FPCA (functional principal component analysis) decomposition and the elastic net logistic regression
at each time grid. This function is used when the baseline covariates Z are high-dimensional.
1 | modelFit_VS(Y, X, Z, startT, pve, nbasis, weight)
|
Y |
The outcome variable, vector of length n, taking values in {1, 0, NA}, where 1 = disease, 0 = not, NA = missing. |
X |
Observed longitudinal biomarker, matrix of n by nTotal, where nTotal denotes the total number of time grids. Missing values are denoted by NA. |
Z |
Other baseline covariates. |
startT |
Time of the first prediction, denoted by t_1 in the manuscript. For instance, if the time grids are {0,1/60,2/60,...,1}, then startT = 25 means that the first prediction is made at t = 24/60. |
pve |
Proportion of variance explained in FPCA. |
nbasis |
Number of B-spline basis functions needed for estimation of the mean function and smoothing of covariance. |
weight |
Weight for each individual. |
list_fpcaFit |
FPCA decomposition at each time grid from startT to the end. |
list_cvfit |
Elastic net logistic regression at each time grid from startT to the end. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(reinforcedPred)
# take the example training data (high dimensional Z) from the reinforcedPred package
# see documentation for details about the data set train_data_mulZ
Y <- as.numeric(train_data_mulZ$Y)
tildeX.missing <- as.matrix(train_data_mulZ[,2:62])
Z <- as.matrix(train_data_mulZ[,63:dim(train_data_mulZ)[2]])
# analysis starts
startT <- 25
weight <- rep(1, length(Y))
result <- modelFit_VS(Y, tildeX.missing, Z, startT, pve = 0.99, nbasis = 10, weight)
# obtained elastic net logistic regression fit and FPCA decompositions
list_cvfit <- result$list_cvfit
list_fpcaFit <- result$list_fpcaFit
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.