Hi,
So I am having problems with estimate statement in proc glimmix.
I have the following proc glimmix:
proc glimmix data=newadr noclprint method=laplace;
class nMD procyear(ref=first);
model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution;
random procyear/ sub=nMD type=ar(1) s CL;
estimate "Year 2012" int 1 procyear 1 0 0 0 0 0 0/ ilink;
estimate "Year 2013" int 1 procyear 0 1 0 0 0 0 0/ ilink;
estimate "Year 2014" int 1 procyear 0 0 1 0 0 0 0/ ilink;
estimate "Year 2015" int 1 procyear 0 0 0 1 0 0 0/ ilink;
estimate "Year 2016" int 1 procyear 0 0 0 0 1 0 0/ ilink;
estimate "Year 2017" int 1 procyear 0 0 0 0 0 1 0/ ilink;
estimate "Year 2018" int 1 procyear 0 0 0 0 0 0 1/ ilink;
run;
My procyear variable has the following values: 2012, 2013, 2014, 2015, 2016, 2017, 2018
The output is parameter estimates are:
Solutions for Fixed Effects | |||||||||
---|---|---|---|---|---|---|---|---|---|
Effect | procyear | Estimate | Standard Error |
DF | t Value | Pr > |t| | Alpha | Lower | Upper |
intercept | -1.2370 | 0.1397 | 231 | -8.85 | <.0001 | 0.05 | -1.5123 | -0.9616 | |
procyear | 2013 | -0.1178 | 0.1549 | 231 | -0.76 | 0.4476 | 0.05 | -0.4230 | 0.1873 |
procyear | 2014 | -0.02350 | 0.1440 | 231 | -0.16 | 0.8705 | 0.05 | -0.3072 | 0.2602 |
procyear | 2015 | 0.1533 | 0.1328 | 231 | 1.15 | 0.2494 | 0.05 | -0.1083 | 0.4149 |
procyear | 2016 | 0.5146 | 0.1218 | 231 | 4.23 | <.0001 | 0.05 | 0.2746 | 0.7545 |
procyear | 2017 | 0.8057 | 0.1076 | 231 | 7.48 | <.0001 | 0.05 | 0.5936 | 1.0178 |
procyear | 2018 | 0.8671 | 0.09087 | 231 | 9.54 | <.0001 | 0.05 | 0.6880 | 1.0461 |
procyear | 2012 | 0 | . | . | . | . | . | . | . |
Estimates | |||||||
---|---|---|---|---|---|---|---|
Label | Estimate | Standard Error |
DF | t Value | Pr > |t| | Mean | Standard Error Mean |
Year 2012 | -1.3548 | 0.1439 | 231 | -9.41 | <.0001 | 0.2051 | 0.02347 |
Year 2013 | -1.2605 | 0.1390 | 231 | -9.07 | <.0001 | 0.2209 | 0.02392 |
Year 2014 | -1.0837 | 0.1354 | 231 | -8.01 | <.0001 | 0.2528 | 0.02557 |
Year 2015 | -0.7224 | 0.1337 | 231 | -5.40 | <.0001 | 0.3269 | 0.02941 |
Year 2016 | -0.4313 | 0.1313 | 231 | -3.28 | 0.0012 | 0.3938 | 0.03135 |
Year 2017 | -0.3699 | 0.1313 | 231 | -2.82 | 0.0053 | 0.4086 | 0.03172 |
Year 2018 | -1.2370 | 0.1397 | 231 | -8.85 | <.0001 | 0.2250 | 0.02437 |
I'm not sure this makes sense. Based on my estimate statement, I am expecting estimates to be:
year 2012 -1.2370
year 2013 -1.3548
year 2014 -1.2605
year 2015 -1.0837
year 2016 -0.7224
year 2017 -0.4313
year 2018 -0.3699
It seems like it is off by a year. What am I doing wrong here?
Thanks for your help.
Hi Dave,
Your idea makes sense. I have the appropriate changes to the estimate to the following statement and it works.
Thanks.
proc glimmix data=newadr_ge200_avg_2012_v2 noclprint method=laplace;
class nMD procyear(ref=first);
model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution;
random procyear/ sub=nMD type=ar(1) s CL;
estimate "Year 2012" int 1 procyear 0 0 0 0 0 0 1/ ilink;
estimate "Year 2013" int 1 procyear 1 0 0 0 0 0 0/ ilink;
estimate "Year 2014" int 1 procyear 0 1 0 0 0 0 0/ ilink;
estimate "Year 2015" int 1 procyear 0 0 1 0 0 0 0/ ilink;
estimate "Year 2016" int 1 procyear 0 0 0 1 0 0 0/ ilink;
estimate "Year 2017" int 1 procyear 0 0 0 0 1 0 0/ ilink;
estimate "Year 2018" int 1 procyear 0 0 0 0 0 1 0/ ilink;
run;
The error is indeed in your estimate statements. I would suggest one of the following:
1. Use an LSMEANS statement with an ILINK option and an E option. The latter will assist you in aligning your ESTIMATE coefficients with the correct parameter values.
2. Shift to LSMESTIMATE statements. These are usually much easier to create and troubleshoot than the ESTIMATE statement.
3. Add the NOINT option to the MODEL statement.
SteveDenham
You may replicate the Solution For Fixed Effects using an ESTIMATE statement. It appears your YEAR variable has 7 levels and using REF=FIRST try the ESTIMATE statements shown below. Also keep in mind the estimates in the Solutions for Fixed Effects table are slopes estimates on the logit scale.
estimate '2013 pe' time 1 0 0 0 0 0 -1;
estimate '2014 pe' time 0 1 0 0 0 0 -1;
estimate '2015 pe' time 0 0 1 0 0 0 -1;
estimate '2016 pe' time 0 0 0 1 0 0 -1;
estimate '2017 pe' time 0 0 0 0 1 0 -1;
estimate '2018 pe' time 0 0 0 0 0 1 -1;
Hi Kathleen,
Thanks for your suggestions. I tried it, but it turned out the estimate cannot be estimated.
I believe that PROC GLIMMIX default is GLM coding for the class statement. What you have suggested is for effect coding for class statement which to my understanding is not available in PROC GLIMMIX.
In your original post, the output shows that the first parameter for PROCYEAR is associated with 2013, not 2012. The values in the ESTIMATE statement are associated with parameters in the order shown in the output. So, the first ESTIMATE statement gives the estimate for 2013. That is because you set the reference level to 2012 which moves that year to the last level as you can see in the output.
Hi Dave,
Your idea makes sense. I have the appropriate changes to the estimate to the following statement and it works.
Thanks.
proc glimmix data=newadr_ge200_avg_2012_v2 noclprint method=laplace;
class nMD procyear(ref=first);
model adeno_yes(event=last)=procyear/cl dist=binary link=logit solution;
random procyear/ sub=nMD type=ar(1) s CL;
estimate "Year 2012" int 1 procyear 0 0 0 0 0 0 1/ ilink;
estimate "Year 2013" int 1 procyear 1 0 0 0 0 0 0/ ilink;
estimate "Year 2014" int 1 procyear 0 1 0 0 0 0 0/ ilink;
estimate "Year 2015" int 1 procyear 0 0 1 0 0 0 0/ ilink;
estimate "Year 2016" int 1 procyear 0 0 0 1 0 0 0/ ilink;
estimate "Year 2017" int 1 procyear 0 0 0 0 1 0 0/ ilink;
estimate "Year 2018" int 1 procyear 0 0 0 0 0 1 0/ ilink;
run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.