<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc Glimmix categorical by categorical interaction (Non-est) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-categorical-by-categorical-interaction-Non-est/m-p/752272#M36586</link>
    <description>&lt;P&gt;IF all of the higher order lsmeans are estimated in your output, then examine them to see which combinations don't show up.&amp;nbsp; As a result of incomplete data, lower order lsmeans will be non-estimable.&amp;nbsp; A simple example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix;
class sex treatment;
model response = sex treatment sex*treatment;
lsmeans sex treatment sex*treatment;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now suppose that one of the treatments was not applied to males.&amp;nbsp; The sex*treatment output should include all levels of treatment for females, and all but one for males.&amp;nbsp; Both main effect lsmeans should be non-estimable.&amp;nbsp; I suspect that with a model as complex as yours that something like this is leading to the Non-est output.&amp;nbsp; There won't be anything in the log as far as a WARNING or ERROR because this is the expected behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the question then is how can this be addressed.&amp;nbsp; One way is to fit a one-way analysis, where the MODEL statement looks like (in this example):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix;
class sex treatment;
model response = sex*treatment;
lsmeans sex*treatment/e;
lsmestimate &amp;lt;insert appropriate label&amp;gt; sex*treatment &amp;lt;insert appropriate coefficients&amp;gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the agricultural sciences this is often referred to as a "means model".&amp;nbsp; This ability to calculate appropriate lsmeans is one of the best things about the addition of the LSMESTIMATE statement.&amp;nbsp; Note also that I added /e to the LSMEANS statement.&amp;nbsp; This is a great help in identifying which of the many values would go into the LSMESTIMATE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jul 2021 12:17:31 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2021-07-06T12:17:31Z</dc:date>
    <item>
      <title>Proc Glimmix categorical by categorical interaction (Non-est)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-categorical-by-categorical-interaction-Non-est/m-p/751842#M36571</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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 &amp;nbsp;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching the code, and selected output for your reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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 -&amp;gt;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 -&amp;gt; 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; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Jul 2021 01:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-categorical-by-categorical-interaction-Non-est/m-p/751842#M36571</guid>
      <dc:creator>Ahinoa</dc:creator>
      <dc:date>2021-07-03T01:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Glimmix categorical by categorical interaction (Non-est)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-categorical-by-categorical-interaction-Non-est/m-p/752272#M36586</link>
      <description>&lt;P&gt;IF all of the higher order lsmeans are estimated in your output, then examine them to see which combinations don't show up.&amp;nbsp; As a result of incomplete data, lower order lsmeans will be non-estimable.&amp;nbsp; A simple example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix;
class sex treatment;
model response = sex treatment sex*treatment;
lsmeans sex treatment sex*treatment;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now suppose that one of the treatments was not applied to males.&amp;nbsp; The sex*treatment output should include all levels of treatment for females, and all but one for males.&amp;nbsp; Both main effect lsmeans should be non-estimable.&amp;nbsp; I suspect that with a model as complex as yours that something like this is leading to the Non-est output.&amp;nbsp; There won't be anything in the log as far as a WARNING or ERROR because this is the expected behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the question then is how can this be addressed.&amp;nbsp; One way is to fit a one-way analysis, where the MODEL statement looks like (in this example):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix;
class sex treatment;
model response = sex*treatment;
lsmeans sex*treatment/e;
lsmestimate &amp;lt;insert appropriate label&amp;gt; sex*treatment &amp;lt;insert appropriate coefficients&amp;gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the agricultural sciences this is often referred to as a "means model".&amp;nbsp; This ability to calculate appropriate lsmeans is one of the best things about the addition of the LSMESTIMATE statement.&amp;nbsp; Note also that I added /e to the LSMEANS statement.&amp;nbsp; This is a great help in identifying which of the many values would go into the LSMESTIMATE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 12:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-categorical-by-categorical-interaction-Non-est/m-p/752272#M36586</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-07-06T12:17:31Z</dc:date>
    </item>
  </channel>
</rss>

