unmarkedPowerList {unmarked} | R Documentation |
Create or summarize a series of unmarked power analyses
Description
A list of power analyses created with powerAnalysis
can be combined
using unmarkedPowerList
, allowing comparison e.g. between different
study designs/sample sizes. Additionally an unmarkedPowerList
can be
created directly from an unmarkedFit
template model by specifying
a series of study designs (number of sites, number of observations)
as a data.frame
. A series of methods for unmarkedPowerList
objects are available including a plot
method.
Usage
## S4 method for signature 'list'
unmarkedPowerList(object, ...)
## S4 method for signature 'unmarkedFit'
unmarkedPowerList(object, coefs, design, alpha=0.05,
nulls=list(), nsim=100, parallel=FALSE, ...)
## S4 method for signature 'unmarkedPowerList'
show(object)
## S4 method for signature 'unmarkedPowerList'
summary(object, ...)
## S4 method for signature 'unmarkedPowerList,ANY'
plot(x, power=NULL, param=NULL, ...)
Arguments
object , x |
A |
coefs |
A named list of effect sizes, see documentation for
|
design |
A |
alpha |
Type I error rate |
nulls |
If provided, a list matching the structure of |
nsim |
The number of simulations to run for each scenario/study design |
parallel |
If |
power |
When plotting, the target power. Draws a horizontal line at a given value of power on the plot |
param |
When plotting, the model parameter to plot power vs. sample size for. By default this is the first parameter (which is usually an intercept, so not very interesting) |
... |
Not used |
Value
A unmarkedPowerList
object, a summary of the object in the console,
or a summary plot, depending on the method
Author(s)
Ken Kellner contact@kenkellner.com
See Also
Examples
## Not run:
# Simulate an occupancy dataset and build template model
forms <- list(state=~elev, det=~1)
coefs <- list(state=c(intercept=0, elev=-0.4), det=c(intercept=0))
design <- list(M=300, J=8) # 300 sites, 8 occasions per site
occu_umf <- simulate("occu", formulas=forms, coefs=coefs, design=design)
template_model <- occu(~1~elev, occu_umf)
# Generate two power analysis
effect_sizes <- list(state=c(intercept=0, elev=-0.4), det=c(intercept=0))
pa <- powerAnalysis(template_model, coefs=effect_sizes, alpha=0.05)
pa2 <- powerAnalysis(template_model, effect_sizes, design=list(M=100,J=2))
# Build unmarkedPowerList and look at summary
(pl <- unmarkedPowerList(list(pa,pa2)))
# Run a bunch of power analyses for different scenarios all at once
scenarios <- expand.grid(M=c(50,200,400),
J=c(3,5,8))
(pl2 <- unmarkedPowerList(template_model, effect_sizes, design=scenarios, nsim=20))
# Look at summary plot for elev effect
plot(pl2, power=0.8, param='elev')
## End(Not run)