There is a package in R called pwr
. This is useful to make power analysis when designing the sampling of a project. here are few examples:
library(pwr)
pwr.anova.test(k = 4, f = 0.5, sig.level = 0.05, power = .9)
pwr.2p.test(h = 0.5, sig.level =0.05, power = .9)
pwr.f2.test(u = 4, f2 = .5, sig.level = 0.05, power = .8)
However, is it possible to run a power analysis for a spline regression (or a generalized additive model (GAM))? I want to know how many organisms I would have to sample to detect an effect of selection, that is a shift in morphology of the beak of birds of only 0.5 mm, given that my sig.level = 0.05 and that I have 4 species.
Also, I’m recapturing birds in a population each year since 2003. Is there a power calculation to estimate how many birds should I sample to get a probability of recapture of 25%? I’m running a recapture model in Bayesian statistics, so there is not a function in the package pwr
that can do this.