Programming the statistical procedures from SAS

ANOVA with repeated measures and correspondence analysis

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

ANOVA with repeated measures and correspondence analysis

[ Edited ]

Dear Everyone,

I need you help. Smiley Sad

This is a study where we have applided 4 treatmente, and we register data every 10 min during 10 hours. Each data is about animals activities (I mean behaviour activitis, there where 4 types of activities 1, 2, 3 or 4). Dependente variable is a categorical variable.

For Example.

Animal Treatment  Time Activity
1 0 1 1
1 0 2 1
1 0 3 1
1 0 4 1
1 0 5 1
1 0 6 1
1 0 7 4
1 0 8 4
1 0 9 1
1 0 10 1
1 0 11 1
1 0 12 4
1 0 13 4
1 0 14 3
2 0 1 1
2 0 2 1
2 0 3 1
2 0 4 1
2 0 5 1
2 0 6 1
2 0 7 4
2 0 8 4
2 0 9 1
2 0 10 4
2 0 11 4
2 0 12 4
2 0 13 1
3 0 1 1
3 0 2 1
3 0 3 1
3 0 4 1
3 0 5 1
3 0 6 1
3 0 7 4
3 0 8 4
3 0 9 4
3 0 10 3
3 0 11 1
3 0 12 4
3 0 13 1
3 0 14 4
3 0 15 4
3 0 16 4
3 0 17 1
3 0 6 4
3 0 19 4
3 0 20 1
3 0 21 4
3 0 22 4
3 0 23 4
3 0 24 4
3 0 25 4
3 0 26 4
3 0 27 4
4 0 1 1
4 0 2 1
4 0 3 1
4 0 4 1
4 0 5 1
4 0 6 1
4 0 7 3
4 0 8 1
4 0 9 1
4 0 10 4
4 0 11 3
4 0 12 4
5 0 1 1
5 0 2 1
5 0 3 1
5 0 4 1
5 0 5 1
5 0 6 1
5 0 7 1
5 0 8 1
5 0 9 1
5 0 10 1
5 0 11 4
5 0 12 1
5 0 13 1

 

I need to do an ANOVA with repeated measured. And also a Correspondence analisys with the treatments and the animals activities.

 

Can you help me please?


Accepted Solutions
Solution
‎07-06-2016 11:06 PM
Respected Advisor
Posts: 2,655

Re: ANOVA with repeated measures and correspondence analysis

Repeated categorical measures are difficult to model, but could be done.  If there is no reason to expect any odd distributions, a general logit multinomial model could be fit. If the OP has access to SAS/STAT14.1, I would strongly recommend looking at Example 43.6 GEE for Nominal Multinomial Data in the PROC GEE documentation.  This example should get you started.  A true correspondence analysis does not consider repeated measures, and so I would hesitate to go that route.

 

You might start with the following untested code:

proc gee data=yourdata;
class animal treatment time activity;
model activity=treatment/dist=multinomial link=glogit;
repeated subject=animal / within=time;
lsmeans treatment/diff means oddsratio cl;
run;

Steve Denham

View solution in original post


All Replies
Super User
Posts: 18,565

Re: ANOVA with repeated measures and correspondence analysis

Occasional Contributor
Posts: 6

Re: ANOVA with repeated measures and correspondence analysis

Dear Reeza, the data is about categorical variables like differents activities, EAT, RUMIA, DRINK, OTHER. The info that I have is de frec of this activities long the time (10 hours).

I do not have a script that use a categorical dependent variable.

 

Did I explain me?

Super User
Posts: 18,565

Re: ANOVA with repeated measures and correspondence analysis

Well then you can't do an ANOVA since that's for continuous variables. What's your question/hypothesis your trying to test?

Occasional Contributor
Posts: 6

Re: ANOVA with repeated measures and correspondence analysis

It is an study with animals, we want to know it the treatment (Control, Treatment of 12, Treatment of 24, Treatment of 36), make changes in animal behaviour. We want to know if animales activities (eat, drink wather, rumia or others) change after the aplication od treatments.

The activities are evaluate counting the observations of the activities.

During a time period , it was measured every 10 minutes what activity takes the animal at that point. Therefore the study is a longitudinal repeated measures over time and the response variable is not continuous,  is qualitative because is a activitie count.

 

Super User
Posts: 18,565

Re: ANOVA with repeated measures and correspondence analysis

Shouldn't treatment vary in your data then?

Super User
Posts: 9,769

Re: ANOVA with repeated measures and correspondence analysis

Check PROC GLM .There is an example about it.

 

Firstly Change your data structure like :

 

Treatment  Activity  Time1 Time2 ... Time14

  1               1           6 (count)       12            21

  1               2          6        12            21 

  1               3           6        12            21

  1               4           6        12            21

 

  2               1           6       12            21

  2               2          6        12            21 

  2               3           6        12            21

  2               4           6        12            21

 

 

 

proc glm;
class Treatment Activity;
model Time1-Time14 =
          Treatment Activity Treatment*Activity / nouni;
repeated Time 14 / summary printe;
run;
Super User
Posts: 9,769

Re: ANOVA with repeated measures and correspondence analysis

I think it agian , maybe you need MIXED model, since your have longititude data.But I have no enough knowledge about it. 

@SteveDenham maybe give you some other code .

 

 

Solution
‎07-06-2016 11:06 PM
Respected Advisor
Posts: 2,655

Re: ANOVA with repeated measures and correspondence analysis

Repeated categorical measures are difficult to model, but could be done.  If there is no reason to expect any odd distributions, a general logit multinomial model could be fit. If the OP has access to SAS/STAT14.1, I would strongly recommend looking at Example 43.6 GEE for Nominal Multinomial Data in the PROC GEE documentation.  This example should get you started.  A true correspondence analysis does not consider repeated measures, and so I would hesitate to go that route.

 

You might start with the following untested code:

proc gee data=yourdata;
class animal treatment time activity;
model activity=treatment/dist=multinomial link=glogit;
repeated subject=animal / within=time;
lsmeans treatment/diff means oddsratio cl;
run;

Steve Denham

☑ This topic is solved.

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

Discussion stats
  • 8 replies
  • 339 views
  • 0 likes
  • 4 in conversation