Hi,
I'm trying to figure out how to analyse a percentage on a the following design: treatment (2 levels), celltype (2 levels), area (2 levels). The measure is repeated on celltype and area.
In an exploratory purpose, I would like to evaluate the treatment effect per intersection celltype*area.
I am note sure of the code below (2 codes).
code 1
proc glimmix data=yourdata;
class subject treatment celltype area ;
model r/Ntot=treatment|celltype|area / ddfm=kr solution oddsRATIO;
random area/subject=animal(treatment) type=cs;
random celltype /subject=animal(treatment) type=cs;
lsmeans treatment *celltype*area/ODDS
oddsratio
slicediff=celltype*are
slice=celltype*are
adjust=dunnett cl;
ods output sliceDiffs=GlimMixsliceDiffs;
ods output lsmeans=estimate;
run;
code 2
proc glimmix data=yourdata;
class subject treatment celltype area ;
model r/Ntot=treatment|celltype|area / ddfm=kr solution oddsRATIO;
random animal(treatment) celltype*animal(treatment) area *animal(treatment);
lsmeans treatment *celltype*area/ODDS
oddsratio
slicediff=celltype*are
slice=celltype*are
adjust=dunnett cl;
ods output sliceDiffs=GlimMixsliceDiffs;
ods output lsmeans=estimate;
run;
I kindly ask users for useful suggestions.
Audrey
Code 2 does not recognize that the measures within area or celltype might be correlated--it calculates a variance component over all levels. I am inclined toward code 1, but maybe with some minor changes.
First, if you are going to model the repeated effects as G side, you may wish to change to the following, and get estimates conditional on the random effects. Under this approach, ddfm=kr will not work:
proc glimmix data=yourdata method=laplace;
class subject treatment celltype area ;
model r/Ntot=treatment|celltype|area / solution oddsRATIO;
random area/subject=animal(treatment) type=cs;
random celltype /subject=animal(treatment) type=cs;
lsmeans treatment *celltype*area/ODDS
oddsratio
slicediff=celltype*area
slice=celltype*area
adjust=dunnett cl;
ods output sliceDiffs=GlimMixsliceDiffs;
ods output lsmeans=estimate;
run;
Alternatively, you could model as true repeated measures (R side) and get marginal estimates by doing the following:
proc glimmix data=yourdata;
class subject treatment celltype area ;
model r/Ntot=treatment|celltype|area / ddfm=kr solution oddsRATIO;
random area/subject=animal(treatment) type=cs residual;
random celltype /subject=animal(treatment) type=cs residual;
lsmeans treatment *celltype*area/ODDS
oddsratio
slicediff=celltype*area
slice=celltype*area
adjust=dunnett cl;
ods output sliceDiffs=GlimMixsliceDiffs;
ods output lsmeans=estimate;
run;
Of these, the marginal approach will be biased somewhat (see Stroup's book), but that is not necessarily a bad thing as the error will likely be reduced.
Steve Denham
Thanks a lot for the time spent. It is really helpful. I am going to look the Stroup's book.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.