irtpwr {irtpwr} | R Documentation |
Perform Power Analysis
Description
Perform analytical or sampling-based power analysis for the Wald, LR, score, or gradient statistic.
Usage
irtpwr(
hyp,
stat = c("Wald", "LR", "Score", "Gradient"),
method = "analytical",
sampling.npers = 10^5,
approx.npers = 10^5,
SE.type = "Oakes",
sampling.mat = "ApproxFisher",
power = NULL,
N = NULL,
alpha = NULL
)
Arguments
hyp |
Hypothesis Object created by the setup.hypothesis function |
stat |
character vector containing the statistics to be calculated. Options are 'Wald','LR','Score', and 'Gradient'. By default, all statistics are included |
method |
character, indicating the method used. The options are 'analytical'(default) for the analytical power analysis method or 'sampling' for the sampling-based method. The sampling-based method is generally recommended for higher numbers of items. |
sampling.npers |
integer, sample size for the sampling-based approach. An artificial data set of this size is generated to fit a model and later estimate the noncentrality parameter from. |
approx.npers |
integer, sample size for approximating the Fisher expected information matrix in the sampling-based approach. An artificial data set is calculated of this size to calculate the Fisher expected information matrix from. In contrast to the data created with the sampling.npers sample size, this sample is not used to fit a model. |
SE.type |
Method for calculation of the observed information matrix used for calculating the statistics in the sampling-based approach ('Oakes' by default). Another option is 'Fisher'. |
sampling.mat |
Approach to calculate the information matrix used for calculating the statistics in the sampling-based approach. By default ('ApproxFisher'), an sampling-based approximation of the expected Fisher matrix is calculated using an observed information matrix of the type SE.type |
power |
numeric, statistical power for which the necessary sample size is calculated |
N |
integer, sample size for which the statistical power is calculated. |
alpha |
numeric, alpha level |
Value
function returns an object of class irtpwrresult
Examples
library(mirt)
dat <- expand.table(LSAT7)
mirtfit <- mirt(dat,1,verbose = FALSE)
hyp <- setup.hypothesis(type = '1PLvs2PL', altpars = mirtfit)
res <- irtpwr(hyp=hyp,alpha=.05,power =.8)
summary(res)