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 estimate for alpha in the estimation procedure (multinomial logistic regression model). This should be NULL (default) or a numeric matrix. 'NULL' represents the initial estimate for alpha resulted from the automated initializer.

beta

initial estimate for beta in the estimation procedure (recurrent event model). This should be NULL (default) or a numeric matrix. 'NULL' represents the initial estimate for beta resulted from the automated initializer.

data

a long-format Dataframe, with the format similar to Simdata (a package build-in dataset).

id_col

parameter that indicates the column name of the subject identifier in data.

start_col

parameter that indicates the column name of the start time of the recurrent event interval in data.

stop_col

parameter that indicates the column name of the ending time of the recurrent event interval in data.

event_col

parameter that indicates the column name of the recurrent event indicator in data. 1 if a recurrent event is observed.

K

pre-determined number of latent classes.

gamma

parameter that indicates the distribution of frailty W. The default is 0 which indicates the model holds without the subject-specific frailty (i.e., W = 1), gamma = k indicates that W follows the Gamma(k, k) distribution.

max_epochs

maximum number of iterations for the estimation algorithm.

conv_threshold

convergence threshold for the estimation algorithm.

boot

number of bootstrap replicates used to obtain the standard error estimation. The default is NULL which indicates bootstrap is not conducted.

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(formula = "x1 + x2", data = SimData, K = 2)

# 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")

[Package SLCARE version 1.2.0 Index]