Actually, for model 4 below, the syntax should be (change 1|group to 1|subject):

4. glmer(prop.success~group+(1|subject), weights=no.trials, data=data, 
        family=binomial)

Both (1|group) and (1|subject) will run actually. (1|group) will give a very 
small variance component for group (E-13) while (1|subject) give me an estimate 
for subject variance component 0.05. The reason I initially use (1|group) is 
that subject has only 1 observation per subject, so I thought it can't be used 
as a grouping avriable. Bert reminds me in an off-list message that this is 
false. I agree with Bert that (1|subject) should be used to account for 
subject-to-subject variability and the variance component for subject seems to 
be a reasonable number (0.05) as well. But I still have certain confusion on how 
can a variable with only 1 observation per level (like subject in this case) can 
be a grouping variable? Any education on this would also be appreciated.

Thanks

John



 

________________________________

To: r-sig-mixed-models@r-project.org
Cc: r-help@r-project.org
Sent: Thu, February 10, 2011 9:41:26 AM
Subject: [R-sig-ME] comparing groups of proportions

Hi, I initially posted this to the general R mailing list, but Bert Gunter
thought this may be a mixed model issue, so suggested me to post here.

I have a dataset that has 2 groups of subjects. For each subject in each group, 
the response measured is the number of success (no.success) obatined with the 
number of trials (no.trials). So a probability of success (prop.success) can be 
computed as no.success/no.trials for each subject in each group. The data may 
look like:

for group 1:
subject 1: 5 success, 10 trials
subject 2: 3 success, 8 trials
:
:

for group 2:
subject a: 7 success, 9 trials
subject b: 6 success, 7 trials
:
:

The objective is to test if there is a statistical significant difference in the 

proportion of success between the 2 groups of subjects (say n1=20, n2=30).

Initially, I can think of 3 ways to do the test:

1. regular t test based on the variable prop.success
2. Mann-Whitney test based on the variable prop.success
3. do a binomial regression as:
    fit<-glm(cbind(no.success,no.trials-no.success) ~ group, data=data, 
        family=binomial)
    anova(fit, test='Chisq')

Bert Gunter instead thought this may be modeled by a mixed model because there 
is a random subject to subject variability in their probability of success
within a group. So I specified a mixed model for this data:

4. glmer(prop.success~group+(1|group), weights=no.trials, data=data, 
        family=binomial)

My questions is:
1. Is t test appropriate for comparing 2 groups of proportions?
2. how about Mann-Whitney non-parametric test?
3. Actually, model 3 (binomial regression) and 4 (mixed model) gave me exactly 
the same test for fixed effects, and the variance component for group in model 4 

is very very small (E-133), so is mixed model really necessary here?
4. Among the 4, which technique is more appropriate?
5. any other technique you can suggest?

Thank you,

John


      
    [[alternative HTML version deleted]]

_______________________________________________
R-sig-mixed-models@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



      
	[[alternative HTML version deleted]]


