The syntax below introduces covariates to the class solution selected based on comparisons of fit indices and theoretical considerations of unconditional models with varying numbers of classes. In this case, the final unconditional model contained 5 classes.
The syntax uses a step-wise approach to identify covariates that are related to latent class membership across models including other candidate covariates. Covariates that are significantly related to latent class when entered as the sole covariate are then entered in multivariate models, starting with the 2-3 most strongly related covariates. This analysis will show the significance of each covariate and the final list of retained covariates that all retain significance in a multivariate model. We standardized all continuous covariates prior to analysis using PROC STANDARD in SAS.
%MACRO Num_class (num);
%DO i = 1 %TO #
PROC LCA DATA=libname.filename
TITLE “Conditional 5-class RMLCA to screen 10 covariates that may be associated with class membership, with 200 starts and seed 314728”;
/* Specify 5-class model.*/
ITEMS Smoke1 – Smoke27;
CATEGORIES 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2;
/* Introduces 1 covariate (x1-x22) at a time.*/
BETA PRIOR = 1;
/* To stabilize priors for beta parameters (covariate coefficients).*/
RHO PRIOR = 1;
/* Maximum number of covariates to be tested. */