Solved – Binomial glmer with data between 0-1, not count data, not normal proportion

binomial distributionglmmlme4-nlmeproportion;

I have a special case of a binomial glmer and I can't figure out how to properly model it. I have a random factor (1|Species) to account for differences in species. My response variable consists of "establishment limitation values," which in the literature is calculated as 1 – (# of sites in which seedlings establish / # of sites in which seeds were found). Values range from 0 – 1. There are 20 sites in total, so I tried using weights set to 20. But (I assume) since values are not divided by 20, this is not working. I tried setting weights to the # of sites in which seeds were found, but this doesn't work either. I tried having a column of successes (the number of sites where seedling establishment occurred) and failures (the number of sites where seeds were found but no establishment occurred). This worked, but I am afraid I am no longer modeling establishment limitations values, but something else, and I don't know how I would explain in my paper that I couldn't model the actual limitation values, which is an important part of my work. I am trying to model the effect of my treatment, seed size and seed dispersal mechanism (Animal vs Wind) on limitation values. For now, excluding dispersal, my formula is:

model1<-glmer(Est.Limit~Treatment+log(Size)+(1|Species), data=Limitdr.Est, family=binomial, weights=Weight)

I am trying to use the Gauss-Hermite quadrature algorithm (if it's not overdispersed), but I am leaving that out for now until I get this figured out.

How can I model these proportion values?

When I try the above formula, I get this weird outcome:

enter image description here

Here is a link to my data as an excel file: Limitdr.est excel file

I tried to post as a CSV but I don't have a sufficient reputation for two links.

Let me know if you need any information. I am really looking forward to any suggestions!

Best Answer

In my opinion, you are modeling the establishment limitation, you just made a mistake with the weights argument. From R help:

For the binomial and quasibinomial families the response can be specified in one of three ways:

As a factor: ‘success’ is interpreted as the factor not having the first level (and hence usually of having the second level).

As a numerical vector with values between 0 and 1, interpreted as the proportion of successful cases (with the total number of cases given by the weights).

As a two-column integer matrix: the first column gives the number of successes and the second the number of failures.

Your data clearly fits in the second case, but you have to supply the total number of cases to weights.

The following code works for me:

model1 <- glmer(Est.Limit ~ Treatment + log(Size) + (1|Species),
                data    = Limitdr.Est,
                family  = "binomial",
                weights = Seed.sites)

the result:

> summary(model1)
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
 Family: binomial  ( logit )
Formula: Est.Limit ~ Treatment + log(Size) + (1 | Species)
   Data: x
Weights: Seed.sites

     AIC      BIC   logLik deviance df.resid 
   110.3    117.8    -50.2    100.3       28 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.7705 -0.4858 -0.1659  0.6247  2.0272 

Random effects:
 Groups  Name        Variance Std.Dev.
 Species (Intercept) 4.519    2.126   
Number of obs: 33, groups:  Species, 11

Fixed effects:
                    Estimate Std. Error z value Pr(>|z|)    
(Intercept)           0.9418     0.8370   1.125 0.260523    
TreatmentIsland       0.5172     0.3926   1.317 0.187700    
TreatmentPlantation   1.6060     0.4670   3.439 0.000583 ***
log(Size)            -1.0333     0.3793  -2.724 0.006442 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) TrtmnI TrtmnP
TrtmntIslnd -0.230              
TrtmntPlntt -0.189  0.466       
log(Size)   -0.479 -0.041 -0.100

Hope this helps, Cheers!

Related Question