Description Usage Arguments Value Examples
modelFit
outputs the FPCA (functional principal component analysis) decomposition and the parameter estimates
of the functional generalized linear model at each time grid.
1 | modelFit(Y, X, Z, startT, link, 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. |
link |
The link function used in functional generalized linear models, e.g. "logit", "probit". |
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_paraEst |
Parameter estimates 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 18 | library(reinforcedPred)
# take the example training data (univariate Z) from the reinforcedPred package
# see documentation for details about the data set train_data_uniZ
Y <- as.numeric(train_data_uniZ$Y)
tildeX.missing <- as.matrix(train_data_uniZ[,2:62])
Z <- as.numeric(train_data_uniZ$Z)
# analysis starts
startT <- 55
link <- "probit"
weight <- rep(1, length(Y))
result <- modelFit(Y, tildeX.missing, Z, startT, link, pve = 0.99, nbasis = 10, weight)
# obtained parameter estimates and FPCA decompositions
list_paraEst <- result$list_paraEst
list_fpcaFit <- result$list_fpcaFit
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.