BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lyson
Obsidian | Level 7

How do I set sum of squares in Type III analysis of variance when dealing with a Repeated Measures design, having set the data in "long format" as required by SAS Proc Mixed procedure.

 

I have am aware that it can be done in Proc GLM but my challenge is when dealing with fixed and random between-subjects factors which require strictly the Proc Mixed procedure. Furthermore, I have come accross and am aware of the fact that (SAS User Guide 2017):

 

"The 'Type 3 Tests of Fixed Effects' table in Figure 56.7 displays significance tests for the three effects listed in the MODEL statement. The Type 3 F statistics and p-values are the same as those produced by the GLM procedure. However, because PROC MIXED uses a likelihood-based estimation scheme, it does not directly compute or display sums of squares for this analysis."

Example SAS Code:

proc mixed data=LDH_univ method=reml covtest;

class CCI4 CHCI3 Time Flask ;

model Leakage=CCI4 CHCI3 CCI4*CHCI3 Time CCI4*Time CHCI3*Time CCI4*CHCI3*Time;
repeated Time / subject=Flask type=cs;
lsmeans CCI4 / pdiff cl adjust=tukey;
lsmeans CHCI3 / pdiff cl adjust=tukey;
run;

 

SAS Proc Mixed output:

Lyson_0-1644501985810.png

Is there a way of populating the sum of squares in Proc Mixed without going the Proc GLM route which is not appropriate for random factors?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I don't think PROC MIXED computes sums of squares, because this is not what PROC MIXED is trying to optimize when fitting the model.

 

Please see this discussion (particularly the comments from @SteveDenham)

Solved: Proc Mixed - R-Squared - SAS Support Communities

--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

I don't think PROC MIXED computes sums of squares, because this is not what PROC MIXED is trying to optimize when fitting the model.

 

Please see this discussion (particularly the comments from @SteveDenham)

Solved: Proc Mixed - R-Squared - SAS Support Communities

--
Paige Miller
Lyson
Obsidian | Level 7

@PaigeMiller 

Thank you so much. I am following the discussion. I have already started to pick some useful facts from the discussion. I do appreciate your assistance and the team's deliberations. Thank you all

Lyson
Obsidian | Level 7
Is there a known procedure or formula that Proc mixed uses to calculate the F values?
SteveDenham
Jade | Level 19

Check the documentation: Details:Mixed Procedure>Mixed Models Theory>Inference and Test Statistics.  How the F statistic is calculated using the matrix formula that doesn't copy well into this box.  It is basically this:  define param as the vector of fixed effects and random effects, L is a matrix that encodes the estimable linear combinations that constitute the F test, Chat is the estimated variance-covariance matrix, and r is the rank of LChatL' . Then:

 

F= param'L'inverse((LChatL'))Lparam/r

 

SteveDenham

Lyson
Obsidian | Level 7

Yes I got it. Thanks Steve.

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 1553 views
  • 0 likes
  • 3 in conversation