getPoly | R Documentation |
Refine the polynomial order for each class of a LGM by iteratively removing non-significant growth factors, and running the updated models.
getPoly(lgm_object, wd = "Results")
lgm_object |
A LGM |
wd |
A character string specifying the directory where the results folder will be created for saving Mplus input, output, and data files. Default is the current working directory. |
The getPoly
function refines the polynomial order of a LGM mplusObject
through an iterative process.
In addition to ensuring the statistical significance of growth factors in each latent class,
the function ensure that the best loglikelihood value of the updated model is replicated.
The function works as follows:
1. Extract model information from the provided LGM mplusObject
.
2. Evaluate the statistical significance of the highest-order growth factor in each class.
3. Remove non-significant growth factors (p-value > 0.05) from the model.
4. Update the LGM mplusObject
to reflect changes in the growth factor structure.
5. Re-run the updated mplusObject
until log-likelihood values are successfully replicated using the runLGM
function.
6. Repeat the process until the highest-order growth factor of all classes are statistically significant or reduce to intercept-only.
The function automates the procedure outlined for model selection in: Van Der Nest et al,. (2020). "An overview of mixture modelling for latent evolutions in longitudinal data: Modelling approaches, fit statistics and software." Advances in Life Course Research 43: 100323.
A LGM mplusObject
including the results of the updated model with the refined polynomial order.
LGMobject
for creating the mplusObject of a latent growth model.
runLGM
for conducting latent growth modelling with a mplusObject.
# Example usage:
final_model <- getPoly(
lgm_object = LCGA_best,
wd = "Results"
)
final_fit <- getFit(final_model)
print(final_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.