New Contributor
Posts: 2

# percentage response + doubly repeated measures

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
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
ods output sliceDiffs=GlimMixsliceDiffs;
ods output lsmeans=estimate;

run;

I kindly ask users for useful suggestions.

Audrey

Posts: 2,655

## Re: percentage response + doubly repeated measures

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
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
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

New Contributor
Posts: 2

## Re: percentage response + doubly repeated measures

Thanks a lot for the time spent. It is really helpful. I am going to look the Stroup's book.

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