BookmarkSubscribeRSS Feed
stanmarciano
Fluorite | Level 6

Hi I have an experiment with one between subjects factor (Lets say FactorA) with two levels: Big and Small and one within subjects factor (FactorB - Quality) with three levels: 1, 2 and 3 - corresponding to High, Medium and Low.

 

I want to examine the effect of both the factors on the Dependent Variable measured after each of the participant was put into one of the two conditions (Big or small) and evaluate some things (High, medium and low) : Dep_Var1, Dep_Var2 and Dep_Var3.

 

I am using the following code: 

 

proc glm data = Dataset.data;
class FactorA FactorB SubjectID;
model  Dep_Var1, Dep_Var2 Dep_Var3= FactorA|FactorB /ss3;
repeated SubjectID, FactorB;

lsmeans Condition/pdiff stderr;
run;

 

However I keep on getting the following statement in the Log:

 

NOTE: The CLASS variable FactorB has only one level: '1'.
ERROR: Ambiguous level information in REPEATED statement

 

Here's a snippet of the data for easy reference:

 

SubjectID FactorA Dep_Var1 Factor_B Dep_Var2 Factor_B Dep_Var3 Factor_B
1 Big 9 1 2 2 29 3
2 Small 9 1 5 2 28 3
3 Small 12 1 2 2 27 3
4 Small 9 1 2 2 28 3
5 Big 11 1 5 2 29 3
6 Big 9 1 5 2 21 3
7 Small 9 1 2 2 26 3
8 Big 10 1 2 2 26 3
9 Big 13 1 5 2 25 3
10 Small 10 1 4 2 25 3

 

I realize that I am making a mistake in how I have input FactorB, but cannot figure out what to do here. Any help is appreciated.

 

Thanks.

 

1 REPLY 1
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Your data are in "wide" format and need to be in "long" format. See

 

Data Structure for Repeated Measures Analysis... A Teaser

 

and

 

Reshaping data from wide to long format

 

Also, I recommend that you switch from GLM to either MIXED or GLIMMIX. This paper compares and contrasts the two procedures for repeated measures. GLM does not report correct standard errors for some comparisons in mixed models, and that is usually undesirable.

 

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
  • 1 reply
  • 1512 views
  • 0 likes
  • 2 in conversation