Programming the statistical procedures from SAS

Code to display Mean square errors when using proc mixed

Accepted Solution Solved
Reply
Contributor
Posts: 72
Accepted Solution

Code to display Mean square errors when using proc mixed

Hi all,

When using GLM I always get a table with the mean square errors for each of my dependent variables, but this is not the case when using proc mixed; is there a code that I can add to my model when using proc mixed in order to get this information??

Thank you!!

Caroline


Accepted Solutions
Solution
‎02-07-2014 08:42 AM
Respected Advisor
Posts: 3,780

Re: Code to display Mean square errors when using proc mixed

Perhaps you need METHOD=TYPE3;

data sp;
   input Block A B Y @@;
   datalines;
1 1 1  56  1 1 2  41
1 2 1  50  1 2 2  36
1 3 1  39  1 3 2  35
2 1 1  30  2 1 2  25
2 2 1  36  2 2 2  28
2 3 1  33  2 3 2  30
3 1 1  32  3 1 2  24
3 2 1  31  3 2 2  27
3 3 1  15  3 3 2  19
4 1 1  30  4 1 2  25
4 2 1  35  4 2 2  30
4 3 1  17  4 3 2  18
;;;;


proc mixed method=type3;
   class A B Block;
   model Y = A B A*B;
   random Block A*Block;
   run;

View solution in original post


All Replies
Solution
‎02-07-2014 08:42 AM
Respected Advisor
Posts: 3,780

Re: Code to display Mean square errors when using proc mixed

Perhaps you need METHOD=TYPE3;

data sp;
   input Block A B Y @@;
   datalines;
1 1 1  56  1 1 2  41
1 2 1  50  1 2 2  36
1 3 1  39  1 3 2  35
2 1 1  30  2 1 2  25
2 2 1  36  2 2 2  28
2 3 1  33  2 3 2  30
3 1 1  32  3 1 2  24
3 2 1  31  3 2 2  27
3 3 1  15  3 3 2  19
4 1 1  30  4 1 2  25
4 2 1  35  4 2 2  30
4 3 1  17  4 3 2  18
;;;;


proc mixed method=type3;
   class A B Block;
   model Y = A B A*B;
   random Block A*Block;
   run;
Contributor
Posts: 72

Re: Code to display Mean square errors when using proc mixed

Thank you very much data null for the trick, it works for my data!  Nevertheless I will keep in mind what lvm said.

Thanks a lot!!

Caroline

Valued Guide
Valued Guide
Posts: 684

Re: Code to display Mean square errors when using proc mixed

It is important to realize that in likelihood-based mixed-model analysis, there is no such thing as a sum of squares or a mean square. F statistics come from contrasts. As data _null_ indicates, you can get a moment-based analysis using method=type3, which includes mean squares, etc. However, this is not the same thing as a likelihood-based analysis, the latter being the preferred method for mixed models (and the default in MIXED). For a certain class of models and balanced data sets, the test results will be the same, but in general the results will differ. Moreover, for a wider class of mixed models, there is no moment-based version.

Contributor
Posts: 72

Re: Code to display Mean square errors when using proc mixed

Thank you very much for the comment!  I´m glad to know this. Eventhough works for my data what data null suggested, I will keep in mind what you said about proc mixed and will be carefull when using the information obtained.

Thanks a lot!!

Caroline

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 273 views
  • 0 likes
  • 3 in conversation