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”;
NCLASS 5;
/* 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;
COVARIATE x&i;
/* Introduces 1 covariate (x1-x22) at a time.*/
CORES 6;
BETA PRIOR = 1;
/* To stabilize priors for beta parameters (covariate coefficients).*/
SEED 314728;
NSTARTS 200;
RHO PRIOR = 1;
RUN;
%END;
%MEND Num_class;
%Num_class (22);
/* Maximum number of covariates to be tested. */