The text that appears in green is not part of the code; these are comments added to clarify the meaning of the code.
We used a treatment contrast strategy to make planned comparisons among the six treatment arms (5 active pharmacotherapies and placebo) in a randomized clinical trial. We coded 5 contrast variables prior to running RMLCA and named these new variables x18-x22, using the coding below.
Contrast | Placebo | Patch+ Lozenge |
Bupropion+ Lozenge |
Patch | Bupropion | Lozenge |
x18 | -1 | .2 | .2 | .2 | .2 | .2 |
x19 | 0 | 1 | -.25 | -.25 | -.25 | -.25 |
x20 | 0 | 0 | .5 | .5 | -.5 | -.5 |
x21 | 0 | 0 | 1 | -1 | 0 | 0 |
x22 | 0 | 0 | 0 | 0 | 1 | -1 |
The syntax below generates odds ratios and 95% confidence intervals for these odds ratios of membership in a target latent class, relative to a specified reference class, for each treatment contrast variable and other covariate retained in the model. These ORs help us to discuss the significant contribution of each covariate in class membership determination. For example, if the OR > 1 and the 95% CI does not include 1, we can say increasing the level of the covariate by one category (like from 0 to 1, or by 1 standard deviation for continuous variables standardized for this analysis) will increase the odds of membership in a particular class (vs. a reference class) by (OR – 1)*100%. If the OR < 1 and 95%CI does not include 1, the increase is by (1/OR -1)*100% in the opposite direction of the Classes in comparison. A 95%CI that includes 1 indicates the absence of a significant effect of the covariates on class membership for the two classes being compared.
%MACRO Num_class (num =, retained_covar_list= );
%DO i = 1 %TO #
PROC LCA DATA=libname.filename
START =libname.start;
/* Specify a list of 200 random seed starting values to use in a file named “start.” This replaces the SEED and NSTARTS commands of earlier models. It is useful to point to a file of start values like this because using a new set of random seeds can lead to models in which the order/labeling of the classes changes from start to start, which makes interpretation of covariate effects very difficult. This sytanx keeps the ordering of classes constant.*/
TITLE “Conditional 5-class RMLCA to evaluate treatment effects class membership, using START file”;
NCLASS 5;
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 &retained_covar_list;
/* Points to a list of covariates, including treatment contrasts, identified in the earlier conditional model. */
REFERENCE &i;
/* Allows us to specify that we want to see results in which each of the five classes i (1-5) serves as the reference group. */
CORES 6;
BETA PRIOR = 1;
RHO PRIOR = 1;
RUN;
%END;
%MEND Num_class;
%Num_class (num = 5, retained_covar_list = x18 x19 x20 x21 x22 x1 x2 x8 x13);