I am trying to conduct a power analysis on the following model:

NativeAntModel <- glmmTMB(NativeAnts~ Treatment + Month + (1|Site), data = NativeAntData, family = t_family)

Background on the data: I am trying to see how the native ant community changes in response to an ant poison application. We had 4 sites. Two sites were treated with poison and two sites were not (control). At each of these sites, we measured how the ant community changed by putting out 25 pitfall traps and counting how many native ants were in each pitfall trap. I thus made site a random effect because each of the 25 pitfall traps are not truly independent. These pitfall traps were set out for 4 days, once a month, for a total of 4 months.

This model looks like a good fit for the data when I look at the Q-Q plot and the residual vs predicted values (looked at these using the DHARMA package).

I am trying to see if there is a way to assess power in this model. I am planning on continuing this study in future years and want to determine how many traps and how many sites are going to be needed to obtain a power of 0.8. I've found packages that assess power for the lme4 package, but so far am at a loss for one that is compatible with the glmmTMB package. I would appreciate any help I can get!

  • $\begingroup$ I'm not sure this is what the question asks but calculating power for the data you've already collected doesn't make sense; see this thread for example. If you plan to run another experiment, then you could consider the one you've already done a pilot study & use what you've learned (as well as your domain knowledge) to estimate power by running simulations; see this discussion. $\endgroup$
    – dipetkov
    Mar 8 at 21:56
  • $\begingroup$ Such simulations won't be trivial to run: in addition to the treatment effect, you can vary the number of traps, the number of sites and the number of months & you'll have to hypothesize values for all those parameters to plug into your simulation. $\endgroup$
    – dipetkov
    Mar 8 at 21:56


Your Answer

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

Browse other questions tagged or ask your own question.