BookmarkSubscribeRSS Feed
Ahinoa
Fluorite | Level 6

Hello all,

 

Once more, I come to this community for your help with SAS. I am using Proc Glimmix to fit a mixed-effects logistic regression with random intercept. All the variables I am working with are either binary or categorical. Because I am particularly interested in the effect of one particular variable as a moderator, I am including four interaction terms of level-2 variables in my model.

 

I have been able to successfully fit the empty, level-2 variables only, and level-2 + level-1 variables models. However, when I run the model with the interaction terms, the output that I get for the solutions for fixed effects as well as the LSMEANS output are missing estimates (Non-est) for both cross-level and  level-2 interaction terms. What surprises me is that I do not get any errors on the SAS log, so I do not have anything to guide me about what might be wrong. 

 

I am assuming that this is a simple mistake and that because I am a relatively new SAS user, I am just missing what might be wrong. I will really appreciate any advice you might have about strategies that I can use to solve this issue. 

 

I am attaching the code, and selected output for your reference. 

 

Thank you!!!

TITLE "MODEL 6 - FIXED EFFECTS RANDOM INTERCEPT MODERATION ANALYSIS ";
PROC GLIMMIX DATA = DISS3.LLCP2017_STRATIFIED METHOD = QUAD (Qpoints = 1) EMPIRICAL = CLASSICAL PLOTS = ODDSRATIO; /* EMPIRICAL = CLASSICAL ->SANDWICH VARIANCE ESTIMATOR*/ 
WHERE ((_RACEGR3 = 5) AND (_RFHYPE5 = 2)); 
CLASS 			/*STATE LEVEL VARIABLES*/
			 	_STATE M_EXPANSION (REF = "No Expansion") GINI (REF = "Low ") SPP_SPECTRUM (REF = "Con") 
				LPERCENTAGE2017 (REF = "Low Composition") PLACE_3 (REF = "Old")

				/*INDIVIDUAL LEVEL VARIABLES*/
				Risk_Profile (REF = "Low Risk") HC (REF = "Low Access") FPL (REF = "Below FPL") _EDUCAG (REF = "Did not graduate high school")
		
				/*DEMOGRAPHIC CHARACTERISTICS*/
				SEX (REF = "Male") _AGEG5YR (REF = "Late Middle Age") MARITAL (REF = "Never Married") RENTHOM1 (REF = "Rent") 
				EMPLOY1 (REF = "Employed") GENHLTH (REF = "Good, Fair, and Poor");

MODEL BPMEDS (DESCENDING) = RISK_PROFILE HC FPL*PLACE_3 _EDUCAG*PLACE_3 SEX _AGEG5YR MARITAL RENTHOM1 EMPLOY1 GENHLTH 
							M_EXPANSION GINI SPP_SPECTRUM LPERCENTAGE2017 PLACE_3 M_EXPANSION*PLACE_3 GINI*PLACE_3 SPP_SPECTRUM*PLACE_3 LPERCENTAGE2017*PLACE_3/ 
							LINK = LOGIT DIST = BINARY SOLUTION DDFM = BW OBSWEIGHT =AW CL ODDSRATIO; /*OBSWEIGHT -> WEIGHT FOR LEVEL-ONE VARIABLES "OBSERVATIONAL LEVEL*/
RANDOM INTERCEPT/ SUBJECT = _STATE TYPE = CHOL SOLUTION; 
COVTEST "CLASS VARIANCE" GLM; 
ODS OUTPUT SOLUTIONR = CLASSEFFECTS_6A;
ODS OUTPUT PARAMETERESTIMATES =PAREST_6A;

/*CROSS-LEVEL INTERACTIONS*/
LSMEANS _EDUCAG*PLACE_3 /ILINK ODDSRATIO /*DIFF = ALL*/ CL; 
LSMEANS FPL*PLACE_3 /ILINK ODDSRATIO /*DIFF = ALL*/ CL; 

/*LEVEL-TWO INTERACTIONS*/
LSMEANS M_EXPANSION*PLACE_3 /ILINK ODDSRATIO /*DIFF = ALL*/ CL ;
LSMEANS SPP_SPECTRUM*PLACE_3 /ILINK ODDSRATIO /*DIFF = ALL*/ CL ;
LSMEANS LPERCENTAGE2017*PLACE_3 /ILINK ODDSRATIO /*DIFF = ALL*/ CL ;

FORMAT 			/*STATE LEVEL VARIABLES*/
			 	M_EXPANSION MED. GINI GIN. SPP_SPECTRUM POL. LPERCENTAGE2017 LAT. PLACE_3 PLA. _STATE STA.

				/*INDIVIDUAL LEVEL VARIABLES*/
				Risk_Profile RIS. HC HCA. FPL POV. _EDUCAG EDU.
		
				/*DEMOGRAPHIC CHARACTERISTICS*/
				SEX _SX. _AGEG5YR AGE. MARITAL MAR. RENTHOM1 REN. EMPLOY1 EMP. GENHLTH GHL.;
RUN; 
QUIT; 
1 REPLY 1
SteveDenham
Jade | Level 19

IF all of the higher order lsmeans are estimated in your output, then examine them to see which combinations don't show up.  As a result of incomplete data, lower order lsmeans will be non-estimable.  A simple example:

 

proc glimmix;
class sex treatment;
model response = sex treatment sex*treatment;
lsmeans sex treatment sex*treatment;
run;

Now suppose that one of the treatments was not applied to males.  The sex*treatment output should include all levels of treatment for females, and all but one for males.  Both main effect lsmeans should be non-estimable.  I suspect that with a model as complex as yours that something like this is leading to the Non-est output.  There won't be anything in the log as far as a WARNING or ERROR because this is the expected behavior.

 

So the question then is how can this be addressed.  One way is to fit a one-way analysis, where the MODEL statement looks like (in this example):

 

proc glimmix;
class sex treatment;
model response = sex*treatment;
lsmeans sex*treatment/e;
lsmestimate <insert appropriate label> sex*treatment <insert appropriate coefficients>;
run;

In the agricultural sciences this is often referred to as a "means model".  This ability to calculate appropriate lsmeans is one of the best things about the addition of the LSMESTIMATE statement.  Note also that I added /e to the LSMEANS statement.  This is a great help in identifying which of the many values would go into the LSMESTIMATE statement.

 

SteveDenham

 

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1241 views
  • 0 likes
  • 2 in conversation