R/methodMixAK_GLMM.R
lcMethodMixAK_GLMM.RdSpecify a GLMM iwht a normal mixture in the random effects
A formula specifying the fixed effects of the model, including the response. Creates the y and x arguments for the call to mixAK::GLMM_MCMC.
A formula specifying the random effects of the model, including the random intercept. Creates the z and random.intercept arguments for the call to mixAK::GLMM_MCMC.
The name of the time variable.
The name of the trajectory identifier variable. This is used to generate the id vector argument for the call to mixAK::GLMM_MCMC.
The number of clusters.
Arguments passed to mixAK::GLMM_MCMC. The following external arguments are ignored: y, x, z, random.intercept, silent.
This method currently does not appear to work under R 4.2 due to an error triggered by the mixAK package during fitting.
Komárek A (2009). “A New R Package for Bayesian Estimation of Multivariate Normal Mixtures Allowing for Selection of the Number of Components and Interval-Censored Data.” Computational Statistics and Data Analysis, 53(12), 3932–3947. doi:10.1016/j.csda.2009.05.006 .
Other lcMethod implementations:
getArgumentDefaults(),
getArgumentExclusions(),
lcMethod-class,
lcMethodAkmedoids,
lcMethodCrimCV,
lcMethodDtwclust,
lcMethodFeature,
lcMethodFunFEM,
lcMethodFunction,
lcMethodGCKM,
lcMethodKML,
lcMethodLMKM,
lcMethodLcmmGBTM,
lcMethodLcmmGMM,
lcMethodMclustLLPA,
lcMethodMixtoolsGMM,
lcMethodMixtoolsNPRM,
lcMethodRandom,
lcMethodStratify
data(latrendData)
# this example only runs when the mixAK package is installed
try({
method <- lcMethodMixAK_GLMM(fixed = Y ~ 1, random = ~ Time,
id = "Id", time = "Time", nClusters = 3)
model <- latrend(method, latrendData)
summary(model)
})
#> Longitudinal cluster model using generalized linear mixed model with normal random effects mixture
#> lcMethodMixAK_GLMM specifying "generalized linear mixed model with normal random effects mixture"
#> time: "Time"
#> id: "Id"
#> nClusters: 3
#> dist: "gaussian"
#> nMCMC: 10, 10, 1, 10
#> tuneMCMC: list(alpha = 1, b = 1)
#> store: FALSE
#> PED: TRUE
#> keep.chains: TRUE
#> dens.zero: 1e-300
#> parallel: FALSE
#> fixed: Y ~ 1
#> random: ~Time
#>
#> Cluster sizes (K=3):
#> A B C
#> 80 (31.4%) 4 (29.8%) 116 (38.8%)
#>
#> Number of obs: 2000, strata (Id): 200
#>
#> Scaled residuals:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -2.9452 -0.7049 -0.2269 0.0000 0.7518 2.7638
#>