Description Usage Arguments Value Examples
The discrete heterogeneity model is primarily applicable to the scenario in which each subject is assigned a latent class, and fixed parameters are applied across those subjects in the same class. This particular function allows for more than one response, thus appropriate for constructing a model with multiple stages. Although each response is typically nested within one another, this property is not required, in order to fit the model.
1 | LatentStage(nclass, ...)
|
nclass |
Number of classes for all subjects, determining how many groups of different parameters will be obtained |
... |
|
A list object containing both arguments and results:
lambda
- The estimate of class proportions, which sum up to 1.
beta
- Estimates, SEs and p-values for all linear parameters.
posteriorz
- List of probabilities of each subject belonging to
a specific group, with class ID estimated by determining which one maximizes
said probability.
all.loglik
- List of log-likelihood
estimates in each iteration.
y
- List of responses for all
stages.
id
- List of subject IDs for all stages.
x
- List of covariates for all stages.
AIC
-
Numerical AIC value for the current model.
BIC
- Numerical BIC
value for the current model.
runtime
- Elapsed time in fitting
the model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data(threestage)
attach(threestage)
mod <- LatentStage(5, X1=stage1[, 4:7],
y1=stage1$Y1, id1=stage1$Person,
X2=stage2[, 4:7],
y2=stage2$Y2, id2=stage2$Person,
X3=stage3[, 4:7],
y3=stage3$Y3, id3=stage3$Person)
data(dating)
attach(dating)
nonmiss <- !is.na(wrote)
mod <- LatentStage(3, y1 = browsed, y2 = wrote[nonmiss],
id1 = respid, id2 = respid[nonmiss],
X1 = agedif, X2 = agedif[nonmiss])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.