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

Dear all.

I have a data set as follows:

data test;
input Person Day Drug$ Response;
cards;
1 1 A .
1 2 A .
1 3 A .
2 1 A .
2 2 A .
2 3 A .
3 1 B .
3 2 B .
3 3 B .
4 1 B .
4 2 B .
4 3 B .
5 1 C .
5 2 C .
5 3 C .
6 1 C .
6 2 C .
6 3 C .
;

My goal is to test the difference between drugs. To increase the amount of data, assessment was made over three days (Day) on each Person. Initially, I thought of the following command to analyse the data:

proc mixed data=test;
class Droug Day;
model Response=Droug/htype=3;
random Day/type=covariance_structure;
lsmeans Droug;
run;

"random Day" because Day is a random effect factor as block, and "type = covariance_structure" because days are correlated, because they are measured in the same person.

However, I read the following paper: https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/198-29.pdf . And maybe the correct command is as follows:

proc mixed data=test;
class Droug Day Person;
model Response=Droug/htype=3;
random Droug/type=covariance_structure subject=Person;
repeated Droug/type=covariance_structure subject=Day(Person);
lsmeans Droug;
run;

I'm in doubt!!!

For my goal. Can I use the first command? Or do I have to use the second command?

I appreciate all the help. Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

If you assume that PERSON is a random effect and that DAY is a random effect, then PERSON and DAY are crossed random effects: each PERSON is observed for each DAY (each PERSON is a block for DAYs), and each DAY is observed for each PERSON (each DAY is a block for PERSONs). More commonly, random effects are nested, but crossed is possible. Generally, you would consider PERSONs to be independent, but DAYs might possibly be correlated.

 

In that scenario, I would consider this code

 

proc mixed data=test;
    class person drug day;
    model response = drug;
    random person(drug);
    random day / subject=intercept type=<some covariance structure> g;
    lsmeans drug;
    run;

The paper that you link to does not address this type of model structure, so I do not think it provides an appropriate template for analysis.

 

I hope this helps.

View solution in original post

2 REPLIES 2
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

If you assume that PERSON is a random effect and that DAY is a random effect, then PERSON and DAY are crossed random effects: each PERSON is observed for each DAY (each PERSON is a block for DAYs), and each DAY is observed for each PERSON (each DAY is a block for PERSONs). More commonly, random effects are nested, but crossed is possible. Generally, you would consider PERSONs to be independent, but DAYs might possibly be correlated.

 

In that scenario, I would consider this code

 

proc mixed data=test;
    class person drug day;
    model response = drug;
    random person(drug);
    random day / subject=intercept type=<some covariance structure> g;
    lsmeans drug;
    run;

The paper that you link to does not address this type of model structure, so I do not think it provides an appropriate template for analysis.

 

I hope this helps.

vitormacedo
Calcite | Level 5

Thank you @sld for your help. 

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!

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
  • 2 replies
  • 280 views
  • 0 likes
  • 2 in conversation