Dear SAS programmers,
I have a question about MIXED procedure. I apply the MIXED to a longitudinal study, where mental health scores were measured for each patinent 7 times, with an interval of about 1 year. So, patient is my random intercept and time is my random slope in this model. I also include covaraites, such as if patient earlier (before inclusion in the study) had diabetes ("tdiabetes" variables) or if they earlier had storke ("tslag" variable). I have many more covariates, but for asking the quesiton I simplified the model to just 2.
Here is the procedure:
proc mixed data=ecs_models4 empirical;
class id timeclass
tdiabetes tslag / ref=first;
model ecs=
tdiabetes tslag / noint solution corrb e3;
random intercept time_num/ type=un subject=id g v;
repeated timeclass/ type=simple subject=id r;
run;
In the output, I get a Solution for Fixed effects table and Type3 effects table (both are attached below). What I don't understand is why in the Solution table, the first class variables (here it is TDIABETES) has estimated for each level, 1 and 0, rather than an estimate for level 1 in reference to estimate at level 0, as for TSLAG variable?
This is confusing for me also because for TDIABETES Solution and Type3 results are not the same.
Can somebody provide a little hint to understanding this output of MIXED? Is there anything wrong in my model setup?
Thank you in advance!
Marina
Hello @marina_unn,
I think it's just the NOINT option which causes this effect. For subjects with both CLASS effects at their reference levels, i.e., TDIABETES=TSLAG=0, the response variable (ECS) will usually not happen to be zero. Without the NOINT option the estimated non-zero amount would go into the intercept, while the contributions of both model variables are zero. With the NOINT option, however, PROC MIXED pushes it into the coefficient of the reference category of the first CLASS variable in the MODEL statement.
See this toy example:
data have;
input c y;
cards;
0 1
1 2
1 3
;
proc mixed data=have;
class c;
model y=c / /* noint */ solution;
run;
The (2+3)/2=2.5 moves from the intercept to the coefficient of reference level c=1 (default is REF=LAST) when the NOINT option is activated.
These two test different hypotheses, so they do not have to agree!
The Solution for Fixed effects tests to see if the Estimate is equal to zero. In both cases the p-value is <0.0001 which indicates these estimates are statistically different from zero.
The Type 3 test is a test to see if the two levels of TDIABETES are equal to one another (or that the values 77.835 and 83.1827 are equal to one another). They are not equal with alpha = 0.05 (or p-value 0.0036)
Hello @marina_unn,
I think it's just the NOINT option which causes this effect. For subjects with both CLASS effects at their reference levels, i.e., TDIABETES=TSLAG=0, the response variable (ECS) will usually not happen to be zero. Without the NOINT option the estimated non-zero amount would go into the intercept, while the contributions of both model variables are zero. With the NOINT option, however, PROC MIXED pushes it into the coefficient of the reference category of the first CLASS variable in the MODEL statement.
See this toy example:
data have;
input c y;
cards;
0 1
1 2
1 3
;
proc mixed data=have;
class c;
model y=c / /* noint */ solution;
run;
The (2+3)/2=2.5 moves from the intercept to the coefficient of reference level c=1 (default is REF=LAST) when the NOINT option is activated.
Many thanks, @FreelanceReinh for the explanation about NOINT option.
I will consider if I need this option at all in my model.
If you know any literature or SAS guides that explain when NOINT option makes most sense, please let me know. The MIXED procedure help pages do not explain much, unfortunately.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.