I am doing a power analysis to determine how many sites I need to sample (recording an animal’s presence/absence) to detect a difference between the animal's presence before and after a fire has gone through. We have already surveyed the sites (around 200) before the fire and so I want to know if we can do less post-burn sampling (to save money). The results will be analysed using a binomial glm. I am using the simr packing and powersim function. Here is the model that will be used:

m3 <- glm(animal.present ~ fire, family=binomial, data=data)

I am predicting there to be a reduction in animal presence of 50% post fire. Given it’s a binomial model and the coefficient represents a logit, I think the coefficient should be -0.7 (as the exponentiate of that is -0.5):

[1] 0.4965853

I do this to change the coefficient:

coef(m3)['firepost'] <- -0.7

Running the model I get the below output. I want to know if I have specified the correct effect size and have I put the effect in the correct direction (e.g. less animals in post fire):

glm(formula = koala.present ~ fire, family = binomial, data = koala.fire)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-0.8949  -0.8949  -0.6614   1.4892   1.8040  

            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  -0.7084     0.1515  -4.675 2.94e-06 ***
firepost     -0.7000     0.2143  -3.267  0.00109 ** 
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 499.7  on 393  degrees of freedom
Residual deviance: 499.7  on 392  degrees of freedom
AIC: 503.7

Number of Fisher Scoring iterations: 4

Running the power analysis then shows we should sample the same number of sites as before (197) to have have enough power

Power for predictor 'fire', (95% confidence interval):================================================|
      85.00% (82.63, 87.16)

Test: Likelihood ratio

Based on 1000 simulations, (0 warnings, 0 errors)
alpha = 0.05, nrow = 394

Time elapsed: 0 h 0 m 12 s

1 Answer 1


I saw no one answered this so....

You ask "I want to know if I have specified the correct effect size and have I put the effect in the correct direction ":

The estimate column in the output for summary(m3) gives you the estimated beta values. You can read these as "for each unit of the predictor (fire), the response variable (animal.present) changes by this estimate."

So, in this particular example, for each unit of fire, you have a have adjusted the estimate for the beta value to a reduction of 0.7 animals (-0.7). I do not know if that is a meaningful value, but you choose the correct direction. Next time, it would be helpful if you also included the commands you used to generate the output you share.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.