Suppose I have a data set:

Geography Quarter  Y X1 X2
A           1      3  1  4
A           2      2  4  4
A           3      5  5  2
A           4      1  3  4
B           1      3  1  6
B           2      8  6  7
B           3      2  4  1
B           4      9  7  3

What does this statement do?:

proc mixed data = data;
model Y = X1 X2;

Does it fit one model or multiple models? I am trying to understand what proc mixed actually does with this dataset. Would this statement simply fit one model for all data points? And would adding a class statement create a model for A and a model for B?


My limited understanding - I've only just started using PROC MIXED - is that the code provided will fit a multiple linear regression model with Y as the response and X1 and X2 as fixed effects.

It will create only one model for all data points and the results should be the same as PROC GLM.

Adding a class statement (that is, class X1 or class X2) will only create the one model but will derive estimates for each level in the (now categorical) variable specified in the class statement.

Adding "GEOGRAPHY" in a class statement won't do anything unless "GEOGRAPHY" is then either added as a fixed effect in the model (model y = X1 X2 GEOGRAPHY) or added as a random effect (random GEOGRAPHY; < placed after the model statement).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.