BookmarkSubscribeRSS Feed
xshinbrot0
Calcite | Level 5

Hi there,

 

I am interested in figuring out how to transform my data set so I can use a repeated measures ANOVA.

 

Right now I have an excel spreadsheet uploaded into SAS studio. It is now organized as this example, where there is a subject, a group trial, and time (pre, post- 1 week, post 1 month and control), with the dependent variable being the amount of learning. Now to use repeated measures I want to make sure that there is the assumption that time 1,2,3 are correlated (since its the same person). I read here that I will need to transform it so that all the dependent variables are on the same line (e.g. subject 1 would have 15, 19, 25 on one line). I don't understand how to do that in SAS. I can't just make up "ave_learn1" "ave_learn2" "ave_learn3" can I? How do I do this? Please advise. 

 data Old;
      input Subject Group Time ave_learn;
   datalines;
    1 1 1 15
    1 1 2 19
    1 1 3 25
    2 1 1 21
    2 1 2 18
    2 1 3 17
    1 2 1 14
    1 2 2 12
    1 2 3 16
    2 2 1 11
    2 2 2 20

 

2 REPLIES 2
ballardw
Super User

Is subject 1 in group 1 and in group 2 supposed to be the same individual?

 

proc sort data=old;
by subject group;
run;

proc transpose data =old out=new prefix=t;
   by subject group;
   id time;
   var ave_learn;
run;
xshinbrot0
Calcite | Level 5

The way that I have it yes, it has the subject id with three lines of code (subject=1, pre-survey time=1; subject=1 postsurvey time=2; subject=1 postsurvey time=3), Let me try that code though, thank you!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1073 views
  • 0 likes
  • 2 in conversation