turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- help with SAS code: repeated measures ANOVA

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-06-2010 11:22 PM

Hi,

I need your help in defining the right SAS code for my statistical model.

I have repeated measures design with four levels: 12 subjects performed four different tasks ("task" variable with four levels - baseline, task1, task2, task3), Each task was repeated 10 times ("trial"). I measured their performance and want to know if their performance (dv) is significantly different for these four levels. My code is

proc mixed data=....;

class subject task trial;

model dv = task ;

repeated task /Subject=Subject Type=CS R RCorr;

run;

Could you tell me please if my model is right? My concern is about "trial" variable. Should I change my code to take it into account or it is enough to have it in the class statement?

I appreciate any advice!

I need your help in defining the right SAS code for my statistical model.

I have repeated measures design with four levels: 12 subjects performed four different tasks ("task" variable with four levels - baseline, task1, task2, task3), Each task was repeated 10 times ("trial"). I measured their performance and want to know if their performance (dv) is significantly different for these four levels. My code is

proc mixed data=....;

class subject task trial;

model dv = task ;

repeated task /Subject=Subject Type=CS R RCorr;

run;

Could you tell me please if my model is right? My concern is about "trial" variable. Should I change my code to take it into account or it is enough to have it in the class statement?

I appreciate any advice!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-07-2010 10:43 AM

TRIAL is not in the MODEL statement, so TRIAL will not be included in the specification of the fixed effects component of your model.

TRIAL is not in a RANDOM or REPEATED statement, so TRIAL will not be included in the specification of the random effects component of your model.

Thus, TRIAL is not a factor in the model as you have specified it.

By putting TRIAL in the CLASS statement, the only impact on your analysis will be the deletion from the analysis of any observation for which TRIAL is missing.

I don't know what the appropriate model is for your study because it is not clear to me how TRIAL figures into the design. Did each subject do baseline, then task1, then task2, then task3 and subsequently repeated that sequence 10 times? Or did each subject do baseline 10 times, then task1 10 times, etc.?

Is the task sequence the same for each subject, or is this study a crossover (e.g., latin square) design? (If the design is not a crossover, should it have been?)

Hope this helps,

Susan

TRIAL is not in a RANDOM or REPEATED statement, so TRIAL will not be included in the specification of the random effects component of your model.

Thus, TRIAL is not a factor in the model as you have specified it.

By putting TRIAL in the CLASS statement, the only impact on your analysis will be the deletion from the analysis of any observation for which TRIAL is missing.

I don't know what the appropriate model is for your study because it is not clear to me how TRIAL figures into the design. Did each subject do baseline, then task1, then task2, then task3 and subsequently repeated that sequence 10 times? Or did each subject do baseline 10 times, then task1 10 times, etc.?

Is the task sequence the same for each subject, or is this study a crossover (e.g., latin square) design? (If the design is not a crossover, should it have been?)

Hope this helps,

Susan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-07-2010 02:14 PM

Susan, thanks a lot!

It is latin square design for "task". Subjects repeated each task 10 times: e.g., subject #1 did 10 times task1, then 10 times task3, 10 times baseline, and 10 times task2.

Based on what you wrote, I don't have any trouble with my model, do I?

It is latin square design for "task". Subjects repeated each task 10 times: e.g., subject #1 did 10 times task1, then 10 times task3, 10 times baseline, and 10 times task2.

Based on what you wrote, I don't have any trouble with my model, do I?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2010 11:06 AM

If you have no interest in how a subject's response might change over the 10 trials, then you could consider computing a summary statistic (e.g., a mean) that is appropriate for the response and then using the summary statistic as data in the analysis.

Alternatively you could set up a multilevel model to accommodate these "subsamples."

If you *are* interested in how a subject's response might change of the 10 trials (e.g., some sort of learning process) then you need to incorporate TRIAL into your model as a repeated measure. This model would be complex because you'd have the repeated measures for TRIAL nested within the repeated measures for TASK, all within a latin square/crossover design.

Regarding the latin square design: With 4 treatments there are 24 possible sequences. Given that you have 12 subjects, I assume that each subject received a different sequence.

IF each subject received a different sequence and

IF you have no clustering of subjects (e.g., subjects were not blocked into 3 groups of 4 subjects) and

IF it is appropriate to assume that there are no carry-over effects and

IF the multiple TRIAL measures have been summarized into a single statistic for analysis,

then a simple specification of your model could be

model dv = task period;

random subject;

or, equivalently,

model dv = task period;

repeated treat / subject=subject type=cs;

Note the addition of PERIOD (of which you have 4 levels) to the model. If any of the IFs listed above are not met, then the model would need to be modified.

So, I would say that your model needs some work.

Hope this helps,

Susan

Alternatively you could set up a multilevel model to accommodate these "subsamples."

If you *are* interested in how a subject's response might change of the 10 trials (e.g., some sort of learning process) then you need to incorporate TRIAL into your model as a repeated measure. This model would be complex because you'd have the repeated measures for TRIAL nested within the repeated measures for TASK, all within a latin square/crossover design.

Regarding the latin square design: With 4 treatments there are 24 possible sequences. Given that you have 12 subjects, I assume that each subject received a different sequence.

IF each subject received a different sequence and

IF you have no clustering of subjects (e.g., subjects were not blocked into 3 groups of 4 subjects) and

IF it is appropriate to assume that there are no carry-over effects and

IF the multiple TRIAL measures have been summarized into a single statistic for analysis,

then a simple specification of your model could be

model dv = task period;

random subject;

or, equivalently,

model dv = task period;

repeated treat / subject=subject type=cs;

Note the addition of PERIOD (of which you have 4 levels) to the model. If any of the IFs listed above are not met, then the model would need to be modified.

So, I would say that your model needs some work.

Hope this helps,

Susan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2010 12:43 PM

Susan,

Thank you very much! your explanation is very helpful!

My last question would be regarding PERIOD. What does it specify?

Thank you very much! your explanation is very helpful!

My last question would be regarding PERIOD. What does it specify?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2010 01:11 PM

Each subject is measured (in 10 trials) in each of 4 PERIODs. For each subject, each PERIOD is associated with a different TASK. The overall test of PERIOD assesses whether all PERIODs have the same mean DV.

Your question suggests to me that you may not be very familiar with latin square/crossover designs. If that is so, then I in turn suggest that you spend some time learning more about them. Studies applying multiple treatments to the same experimental unit can be much trickier to design and to analyze than one might think initially.

Susan

Your question suggests to me that you may not be very familiar with latin square/crossover designs. If that is so, then I in turn suggest that you spend some time learning more about them. Studies applying multiple treatments to the same experimental unit can be much trickier to design and to analyze than one might think initially.

Susan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-08-2010 02:42 PM

Susan,

Thank you very much! I will follow to your advice.

Thank you very much! I will follow to your advice.