SLCARE {SLCARE} | R Documentation |
Semiparametric Latent Class Analysis for Recurrent Event
Description
Fit semiparametric latent class model for recurrent event.
Usage
SLCARE(
formula = "x1 + x2",
alpha = NULL,
beta = NULL,
data = data,
id_col = "id",
start_col = "start",
stop_col = "stop",
event_col = "event",
K = NULL,
gamma = 0,
max_epochs = 500,
conv_threshold = 0.01,
boot = NULL
)
Arguments
formula |
A string specifying the variables of interest to be involved in the regression, with the format of "x1 + x2". |
alpha |
initial values for alpha for estimation procedure (multinomial logistic regression model). This should be NULL or a numeric matrix. 'NULL' refers to obtain initial value with the proposed method. |
beta |
initial value for beta for estimation procedure (recurrent event model). This should be NULL or a numeric matrix. 'NULL' refers to obtain initial value with the proposed method. |
data |
a long-format Data-frame. |
id_col |
the unique identifier per subject. |
start_col |
start time of the interval for the recurrent event. |
stop_col |
ending time of the interval for the recurrent event. |
event_col |
The status indicator; 1 if a recurrent event is observed. |
K |
number of latent classes. |
gamma |
individual frailty. 0 represents the frailty equals 1 and k represents the frailty follows gamma(k,k). |
max_epochs |
maximum iteration epochs for the estimation procedure. |
conv_threshold |
converge threshold for the estimation procedure. |
boot |
a numeric value specifies the number of bootstraps for variance estimation.
When |
Details
Model:
Suppose the recurrent events process is observed with the intensity function proposed in Zhao et al. (2022):
\lambda _{i} (t) = \sum _{k = 1} ^{K} I (\xi _{i} = k) \times \lambda _{0} (t) \times W_{i} \times \eta _{0,k} \times \exp(\tilde{Z} _{i} ^{\top} \tilde{\beta} _{0,k})
where K
is the number of latent classes in the whole population,
\xi_i
denotes the unobserved latent class membership,
\lambda _{0} (t)
is an unspecified, continuous,
nonnegative baseline intensity function shared by all latent classes,
C_i
is the subject specific censoring time,
\tilde{Z}_i
is the time-independent covariates,
W_{i}
is a positive subject-specific latent variable independent of (\xi_i, \tilde{Z}_i, C_i)
.
The distribution of the latent class membership \xi _{i}
is modeled by a logistic regression model:
P(\xi _{i} = k | \tilde{Z} _{i}) = p_{k} (\alpha _{0} , \tilde{Z} _{i}) \doteq \frac{\exp(\tilde{Z} _{i} ^{\top} \alpha _{0,k})}{\sum_{k = 1}^{K}\exp(\tilde{Z} _{i} ^{\top} \alpha _{0,k}) } , \quad k = 1, \cdots, K
SLCARE
is build for introducing a robust and flexible algorithm to carry out Zhao et al. (2022)'s latent class analysis method for recurrent event data described above.
The detailed discussion of the proposed estimation algorithms can be found in the paper "SLCARE: An R package for Semiparametric Latent Class Analysis of Recurrent Events" (in preparation).
Initial Values:
The proposed estimating algorithm needs an input of initial values for \hat{\beta}
and \hat{\alpha}
.
SLCARE
allows users to specify the initial values for the estimation algorithm by their own choice.
SLCARE
also provide an automated initializer which obtains the initial values using
a combination of K-means clustering, multinomial regression and Wang et al. (2001)'s multiplicative intensity model.
The detailed discussion of the proposed estimation algorithms can be found in the paper "SLCARE: An R package for Semiparametric Latent Class Analysis of Recurrent Events" (in preparation).
Specify the number of latent classes and individual frailty:
SLCARE
allows the frailty distribution to be W = 1 or W follows a distribution that is parameterized as Gamma(k,k). These choices of frailty distributions cover a variety of density forms.
Suggested by Zhao et al. (2022), users can choose the distribution of individual frailty and the number of latent classes based on the model entropy provided by SLCARE
.
An example of model selection can be found in the paper "SLCARE: An R package for Semiparametric Latent Class Analysis of Recurrent Events" (in preparation).
Examples
data(SimData)
# fit SLCARE with K = 2, formula = "x1 + x2" and default settings for other arguments
model1 <- SLCARE(data = SimData, K = 2, formula = "x1 + x2")
# summary results
summary(model1, digits = 3)
# generate model checking plot
plot(model1, type = "ModelChecking")
# plot estimated cumulative baseline intensity function
plot(model1, type = "mu0")
# generate estimated mean function plot
plot(model1, type = "EstMeans")
# check class membership probabilities of the 6th - 10th subjects in SimData
print(model1, type = "ClassProb")[6:10,]
# check the predicted number of recurrent events of the 6th - 10th subjects in SimData
print(model1, type = "PostPredict")[6:10,]
# check the change in parameter estimates in the last iteration
print(model1, type = "ConvergeLoss")