Skip to main content
11 events
when toggle format what by license comment
Oct 20 at 15:26 vote accept Nate
Oct 20 at 15:16 answer added Robert Long timeline score: 5
Oct 20 at 15:15 history edited Robert Long
edited tags
Jul 11 at 1:27 history edited Nate CC BY-SA 4.0
I added "ziformula = ~1" for a zero-inflated model fit
Jul 11 at 0:58 comment added Nate @BenBolker, thank you for your last comment (+1)! I thought I had to estimate alpha and beta via some regression or something. Apologies for the disjointed question. To clarify, would calculating the power to detect a change in the mean response between two levels of time as a factor (5 years prior vs. 5 years before) be considered a retrospective power analysis (is that "allowed")? If that's ok to do, I'd like to know how to set that up, please. Site should be a random effect. I'd like to calc. the power using several effect sizes, as well (if not too much trouble). (1/2)
Jul 11 at 0:23 comment added Ben Bolker The answers to your questions about "how do I decide what parameters to use?" are that you have to (1) understand what the parameters mean and (2) play around with options until you get results that look like they would be realistic for your context.
Jul 11 at 0:22 comment added Ben Bolker I started to write an answer but realized I was making it very complicated. I think you should figure out first what kind of test you want to run (year 1 vs year 10? average of year 1-5 vs year 6-10? slope of trend from year 1 to year 10?) and what kind of random effects you think are reasonable/would put in the model. Then it will be relatively easy to show you how to generate simulations/fit models/test effects/summarize effects to compute the power for a specified set of assumptions. But I think "how should I test this?" is a separate question from "how do I calc power of this test?"
Jul 10 at 22:36 comment added Nate @BenBolker, sorry, I wasn't keen on using ChatGPT, but had to start somewhere. I wasn't sure what might be easier (detecting a change in slope between year 1 and 10, or comparing means of two groups/factors of 5 years worth of data; i.e. a sort of "before" and "after" comparison). Either works more me. Thank you for looking it over.
Jul 10 at 21:45 comment added Ben Bolker The general idea of simulating data with a specific effect size and seeing how often you can reject the null hypothesis is a good idea, though. The combination of simulate_new() + glmmTMB() + a for-loop (or replicate or map or whatever) should do it ... the t-test and 'power of a proportion test' stuff seem to be red herrings.
Jul 10 at 21:43 comment added Ben Bolker If you have 10 years (as in your example), are you interested in treating year as a continuous covariate (i.e. testing for linear [on the log-odds scale] trends over time), or in estimating whether there is an overall significant difference among years (treating years as either a categorical fixed effect or as a random-effects grouping variable, i.e. year-as-cluster)? (I can't say I'm super-enthusiastic about cleaning up after ChatGPT, although I appreciate that you made the effort ...)
Jul 10 at 19:08 history asked Nate CC BY-SA 4.0