Title: | Optimal Test Design Approach to Fixed and Adaptive Test Construction |
---|---|
Description: | Uses the optimal test design approach by Birnbaum (1968, ISBN:9781593119348) and van der Linden (2018) <doi:10.1201/9781315117430> to construct fixed, adaptive, and parallel tests. Supports the following mixed-integer programming (MIP) solver packages: 'Rsymphony', 'highs', 'gurobi', 'lpSolve', and 'Rglpk'. The 'gurobi' package is not available from CRAN; see <https://www.gurobi.com/downloads/>. |
Authors: | Seung W. Choi [aut, cre] , Sangdon Lim [aut] |
Maintainer: | Seung W. Choi <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.7.0 |
Built: | 2024-11-21 06:54:35 UTC |
Source: | CRAN |
a_to_alpha
is a function for converting an a-parameter vector to an alpha angle vector.
The returned values are in the radian metric.
a_to_alpha(a)
a_to_alpha(a)
a |
the a-parameter vector. |
a_to_alpha(c(1, 1))
a_to_alpha(c(1, 1))
app
and OAT
are aliases of TestDesign
.
app() OAT()
app() OAT()
TestDesign
is a caller function for opening the Shiny interface of TestDesign package.
## Not run: if (interactive()) { TestDesign() } ## End(Not run)
## Not run: if (interactive()) { TestDesign() } ## End(Not run)
buildConstraints
is a data loading function for creating a constraints
object.
buildConstraints
is a shortcut that calls other data loading functions.
The constraints must be in the expected format; see the vignette in vignette("constraints")
.
buildConstraints(object, item_pool, item_attrib, st_attrib = NULL)
buildConstraints(object, item_pool, item_attrib, st_attrib = NULL)
object |
constraint specifications. Can be a data.frame or the file path of a .csv file. See the vignette for the expected format. |
item_pool |
item parameters. Can be a |
item_attrib |
item attributes. Can be an |
st_attrib |
(optional) stimulus attributes. Can be an |
buildConstraints
returns a constraints
object. This object is used in Static
and Shadow
.
## Read from objects: constraints_science <- buildConstraints(constraints_science_data, itempool_science, itemattrib_science) constraints_reading <- buildConstraints(constraints_reading_data, itempool_reading, itemattrib_reading, stimattrib_reading) ## Read from data.frame: constraints_science <- buildConstraints(constraints_science_data, itempool_science_data, itemattrib_science_data) constraints_reading <- buildConstraints(constraints_reading_data, itempool_reading_data, itemattrib_reading_data, stimattrib_reading_data) ## Read from file: write to tempdir() for illustration and clean afterwards f1 <- file.path(tempdir(), "constraints_science.csv") f2 <- file.path(tempdir(), "itempool_science.csv") f3 <- file.path(tempdir(), "itemattrib_science.csv") write.csv(constraints_science_data, f1, row.names = FALSE) write.csv(itempool_science_data , f2, row.names = FALSE) write.csv(itemattrib_science_data , f3, row.names = FALSE) constraints_science <- buildConstraints(f1, f2, f3) file.remove(f1) file.remove(f2) file.remove(f3)
## Read from objects: constraints_science <- buildConstraints(constraints_science_data, itempool_science, itemattrib_science) constraints_reading <- buildConstraints(constraints_reading_data, itempool_reading, itemattrib_reading, stimattrib_reading) ## Read from data.frame: constraints_science <- buildConstraints(constraints_science_data, itempool_science_data, itemattrib_science_data) constraints_reading <- buildConstraints(constraints_reading_data, itempool_reading_data, itemattrib_reading_data, stimattrib_reading_data) ## Read from file: write to tempdir() for illustration and clean afterwards f1 <- file.path(tempdir(), "constraints_science.csv") f2 <- file.path(tempdir(), "itempool_science.csv") f3 <- file.path(tempdir(), "itemattrib_science.csv") write.csv(constraints_science_data, f1, row.names = FALSE) write.csv(itempool_science_data , f2, row.names = FALSE) write.csv(itemattrib_science_data , f3, row.names = FALSE) constraints_science <- buildConstraints(f1, f2, f3) file.remove(f1) file.remove(f2) file.remove(f3)
calc_info()
and calc_info_matrix()
are functions for calculating Fisher information.
These functions are designed for multiple items.
calc_info(x, item_parm, ncat, model) calc_info_matrix(x, item_parm, ncat, model)
calc_info(x, item_parm, ncat, model) calc_info_matrix(x, item_parm, ncat, model)
x |
the theta value. This must be a column vector in matrix form for |
item_parm |
a matrix containing item parameters. Each row should represent an item. |
ncat |
a vector containing the number of response categories of each item. |
model |
a vector indicating item models of each item, using
|
calc_info()
accepts a single theta value, and calc_info_matrix()
accepts multiple theta values.
Currently supports unidimensional models.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) # single theta example x <- 0.5 calc_info(x, item_parm, ncat, model) # multiple thetas example x <- matrix(seq(0.1, 0.5, 0.1)) # column vector in matrix form calc_info_matrix(x, item_parm, ncat, model)
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) # single theta example x <- 0.5 calc_info(x, item_parm, ncat, model) # multiple thetas example x <- matrix(seq(0.1, 0.5, 0.1)) # column vector in matrix form calc_info_matrix(x, item_parm, ncat, model)
Calculate the Fisher information using empirical Bayes.
calc_info_EB(x, item_parm, ncat, model)
calc_info_EB(x, item_parm, ncat, model)
x |
A numeric vector of MCMC sampled theta values. |
item_parm |
A numeric matrix of item parameters. |
ncat |
a numeric vector specifying the number of response categories in each item. |
model |
a numeric vector indicating the IRT models of each item (1: 1PL, 2: 2PL, 3: 3PL, 4: PC, 5: GPC, 6: GR). |
Calculate the Fisher information using full Bayesian.
calc_info_FB(x, items_list, ncat, model, useEAP = FALSE)
calc_info_FB(x, items_list, ncat, model, useEAP = FALSE)
x |
A numeric vector of MCMC sampled theta values. |
items_list |
A list of item parameter matrices. |
ncat |
a numeric vector specifying the number of response categories in each item. |
model |
a numeric vector indicating the IRT models of each item (1: 1PL, 2: 2PL, 3: 3PL, 4: PC, 5: GPC, 6: GR). |
useEAP |
|
calc_likelihood()
and calc_likelihood_function()
are functions for calculating likelihoods.
calc_likelihood(x, item_parm, resp, ncat, model) calc_likelihood_function(theta_grid, item_parm, resp, ncat, model) calc_log_likelihood(x, item_parm, resp, ncat, model, prior, prior_parm) calc_log_likelihood_function( theta_grid, item_parm, resp, ncat, model, prior, prior_parm )
calc_likelihood(x, item_parm, resp, ncat, model) calc_likelihood_function(theta_grid, item_parm, resp, ncat, model) calc_log_likelihood(x, item_parm, resp, ncat, model, prior, prior_parm) calc_log_likelihood_function( theta_grid, item_parm, resp, ncat, model, prior, prior_parm )
x , theta_grid
|
the theta value. This must be a column vector in matrix form for |
item_parm |
a matrix containing item parameters. Each row should represent an item. |
resp |
a vector containing responses on each item. |
ncat |
a vector containing the number of response categories of each item. |
model |
a vector indicating item models of each item, using
|
prior |
an integer indicating the type of prior distribution, using
|
prior_parm |
a vector containing parameters for the prior distribution. |
calc_log_likelihood()
and calc_log_likelihood_function()
are functions for calculating log likelihoods.
These functions are designed for multiple items.
calc_*()
functions accept a single theta value, and calc_*_function()
functions accept multiple theta values.
Currently supports unidimensional models.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) resp <- c(0, 1, 0, 1, 0, 1) x <- 3 l <- calc_likelihood(x, item_parm, resp, ncat, model) ll <- calc_log_likelihood(x, item_parm, resp, ncat, model, 2, NA) log(l) == ll x <- matrix(seq(-3, 3, .1)) l <- calc_likelihood_function(x, item_parm, resp, ncat, model) ll <- calc_log_likelihood_function(x, item_parm, resp, ncat, model, 2, NA) all(log(l) == ll)
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) resp <- c(0, 1, 0, 1, 0, 1) x <- 3 l <- calc_likelihood(x, item_parm, resp, ncat, model) ll <- calc_log_likelihood(x, item_parm, resp, ncat, model, 2, NA) log(l) == ll x <- matrix(seq(-3, 3, .1)) l <- calc_likelihood_function(x, item_parm, resp, ncat, model) ll <- calc_log_likelihood_function(x, item_parm, resp, ncat, model, 2, NA) all(log(l) == ll)
Calculate the mutual information using full Bayesian.
calc_MI_FB(x, items_list, ncat, model)
calc_MI_FB(x, items_list, ncat, model)
x |
A numeric vector of MCMC sampled theta values. |
items_list |
A list of item parameter matrices. |
ncat |
a numeric vector specifying the number of response categories in each item. |
model |
a numeric vector indicating the IRT models of each item (1: 1PL, 2: 2PL, 3: 3PL, 4: PC, 5: GPC, 6: GR). |
Calculate a posterior value of theta.
calc_posterior(x, item_parm, resp, ncat, model, prior, prior_parm)
calc_posterior(x, item_parm, resp, ncat, model, prior, prior_parm)
x |
A length-one numeric vector for a theta value. |
item_parm |
A numeric matrix of item parameters. |
resp |
a numeric vector containing item responses. |
ncat |
A numeric vector of the number of response categories by item. |
model |
A numeric vector indicating the IRT models of each item (1: 1PL, 2: 2PL, 3: 3PL, 4: PC, 5: GPC, 6: GR). |
prior |
The type of prior distribution (1: normal, 2: uniform). |
prior_parm |
A numeric vector of hyperparameters for the prior distribution, c(mu, sigma) or c(ll, ul). |
Calculate a posterior distribution of theta.
calc_posterior_function( theta_grid, item_parm, resp, ncat, model, prior, prior_parm )
calc_posterior_function( theta_grid, item_parm, resp, ncat, model, prior, prior_parm )
theta_grid |
An equi-spaced grid of theta values. |
item_parm |
A numeric matrix of item parameters. |
resp |
a numeric vector containing item responses. |
ncat |
A numeric vector of the number of response categories by item. |
model |
A numeric vector indicating the IRT models of each item (1: 1PL, 2: 2PL, 3: 3PL, 4: PC, 5: GPC, 6: GR). |
prior |
The type of prior distribution (1: normal, 2: uniform). |
prior_parm |
A numeric vector of hyperparameters for the prior distribution, c(mu, sigma) or c(ll, ul). |
Calculate a posterior value of theta for a single item.
calc_posterior_single(x, item_parm, resp, ncat, model, prior, prior_parm)
calc_posterior_single(x, item_parm, resp, ncat, model, prior, prior_parm)
x |
A length-one numeric vector for a theta value. |
item_parm |
A numeric vector of item parameters (for one item). |
resp |
A length-one numeric vector of item responses. |
ncat |
A length-one numeric vector of the number of response categories by item. |
model |
A length-one numeric vector of the IRT model by item (1: 1PL, 2: 2PL, 3: 3PL, 4: PC, 5: GPC, 6: GR). |
prior |
The type of prior distribution (1: normal, 2: uniform). |
prior_parm |
A numeric vector of hyperparameters for the prior distribution, c(mu, sigma) or c(ll, ul). |
calcEscore
is a function for calculating expected scores.
calcEscore(object, theta) ## S4 method for signature 'item_1PL,numeric' calcEscore(object, theta) ## S4 method for signature 'item_2PL,numeric' calcEscore(object, theta) ## S4 method for signature 'item_3PL,numeric' calcEscore(object, theta) ## S4 method for signature 'item_PC,numeric' calcEscore(object, theta) ## S4 method for signature 'item_GPC,numeric' calcEscore(object, theta) ## S4 method for signature 'item_GR,numeric' calcEscore(object, theta) ## S4 method for signature 'item_pool,numeric' calcEscore(object, theta) ## S4 method for signature 'item_1PL,matrix' calcEscore(object, theta) ## S4 method for signature 'item_2PL,matrix' calcEscore(object, theta) ## S4 method for signature 'item_3PL,matrix' calcEscore(object, theta) ## S4 method for signature 'item_PC,matrix' calcEscore(object, theta) ## S4 method for signature 'item_GPC,matrix' calcEscore(object, theta) ## S4 method for signature 'item_GR,matrix' calcEscore(object, theta) ## S4 method for signature 'item_pool,matrix' calcEscore(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' calcEscore(object, theta)
calcEscore(object, theta) ## S4 method for signature 'item_1PL,numeric' calcEscore(object, theta) ## S4 method for signature 'item_2PL,numeric' calcEscore(object, theta) ## S4 method for signature 'item_3PL,numeric' calcEscore(object, theta) ## S4 method for signature 'item_PC,numeric' calcEscore(object, theta) ## S4 method for signature 'item_GPC,numeric' calcEscore(object, theta) ## S4 method for signature 'item_GR,numeric' calcEscore(object, theta) ## S4 method for signature 'item_pool,numeric' calcEscore(object, theta) ## S4 method for signature 'item_1PL,matrix' calcEscore(object, theta) ## S4 method for signature 'item_2PL,matrix' calcEscore(object, theta) ## S4 method for signature 'item_3PL,matrix' calcEscore(object, theta) ## S4 method for signature 'item_PC,matrix' calcEscore(object, theta) ## S4 method for signature 'item_GPC,matrix' calcEscore(object, theta) ## S4 method for signature 'item_GR,matrix' calcEscore(object, theta) ## S4 method for signature 'item_pool,matrix' calcEscore(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' calcEscore(object, theta)
object |
|
theta |
theta values to use. |
item
object:calcEscore
a vector containing expected score of the item at the theta values.
item_pool
object:calcEscore
returns a vector containing the pool-level expected score at the theta values.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) ICC_item_1 <- calcEscore(item_1, seq(-3, 3, 1)) ICC_item_2 <- calcEscore(item_2, seq(-3, 3, 1)) ICC_item_3 <- calcEscore(item_3, seq(-3, 3, 1)) ICC_item_4 <- calcEscore(item_4, seq(-3, 3, 1)) ICC_item_5 <- calcEscore(item_5, seq(-3, 3, 1)) ICC_item_6 <- calcEscore(item_6, seq(-3, 3, 1)) TCC_pool <- calcEscore(itempool_science, seq(-3, 3, 1))
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) ICC_item_1 <- calcEscore(item_1, seq(-3, 3, 1)) ICC_item_2 <- calcEscore(item_2, seq(-3, 3, 1)) ICC_item_3 <- calcEscore(item_3, seq(-3, 3, 1)) ICC_item_4 <- calcEscore(item_4, seq(-3, 3, 1)) ICC_item_5 <- calcEscore(item_5, seq(-3, 3, 1)) ICC_item_6 <- calcEscore(item_6, seq(-3, 3, 1)) TCC_pool <- calcEscore(itempool_science, seq(-3, 3, 1))
calcFisher
is a function for calculating Fisher information.
calcFisher(object, theta) ## S4 method for signature 'item_1PL,numeric' calcFisher(object, theta) ## S4 method for signature 'item_2PL,numeric' calcFisher(object, theta) ## S4 method for signature 'item_3PL,numeric' calcFisher(object, theta) ## S4 method for signature 'item_PC,numeric' calcFisher(object, theta) ## S4 method for signature 'item_GPC,numeric' calcFisher(object, theta) ## S4 method for signature 'item_GR,numeric' calcFisher(object, theta) ## S4 method for signature 'item_pool,numeric' calcFisher(object, theta) ## S4 method for signature 'item_1PL,matrix' calcFisher(object, theta) ## S4 method for signature 'item_2PL,matrix' calcFisher(object, theta) ## S4 method for signature 'item_3PL,matrix' calcFisher(object, theta) ## S4 method for signature 'item_PC,matrix' calcFisher(object, theta) ## S4 method for signature 'item_GPC,matrix' calcFisher(object, theta) ## S4 method for signature 'item_GR,matrix' calcFisher(object, theta) ## S4 method for signature 'item_pool,matrix' calcFisher(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' calcFisher(object, theta)
calcFisher(object, theta) ## S4 method for signature 'item_1PL,numeric' calcFisher(object, theta) ## S4 method for signature 'item_2PL,numeric' calcFisher(object, theta) ## S4 method for signature 'item_3PL,numeric' calcFisher(object, theta) ## S4 method for signature 'item_PC,numeric' calcFisher(object, theta) ## S4 method for signature 'item_GPC,numeric' calcFisher(object, theta) ## S4 method for signature 'item_GR,numeric' calcFisher(object, theta) ## S4 method for signature 'item_pool,numeric' calcFisher(object, theta) ## S4 method for signature 'item_1PL,matrix' calcFisher(object, theta) ## S4 method for signature 'item_2PL,matrix' calcFisher(object, theta) ## S4 method for signature 'item_3PL,matrix' calcFisher(object, theta) ## S4 method for signature 'item_PC,matrix' calcFisher(object, theta) ## S4 method for signature 'item_GPC,matrix' calcFisher(object, theta) ## S4 method for signature 'item_GR,matrix' calcFisher(object, theta) ## S4 method for signature 'item_pool,matrix' calcFisher(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' calcFisher(object, theta)
object |
|
theta |
theta values to use. |
item
object:calcFisher
returns a (nq, 1) matrix of information values.
item_pool
object:calcProb
returns a (nq, ni) matrix of information values.
nq denotes the number of theta values.
ni denotes the number of items in the item_pool
object.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) info_item_1 <- calcFisher(item_1, seq(-3, 3, 1)) info_item_2 <- calcFisher(item_2, seq(-3, 3, 1)) info_item_3 <- calcFisher(item_3, seq(-3, 3, 1)) info_item_4 <- calcFisher(item_4, seq(-3, 3, 1)) info_item_5 <- calcFisher(item_5, seq(-3, 3, 1)) info_item_6 <- calcFisher(item_6, seq(-3, 3, 1)) info_pool <- calcFisher(itempool_science, seq(-3, 3, 1))
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) info_item_1 <- calcFisher(item_1, seq(-3, 3, 1)) info_item_2 <- calcFisher(item_2, seq(-3, 3, 1)) info_item_3 <- calcFisher(item_3, seq(-3, 3, 1)) info_item_4 <- calcFisher(item_4, seq(-3, 3, 1)) info_item_5 <- calcFisher(item_5, seq(-3, 3, 1)) info_item_6 <- calcFisher(item_6, seq(-3, 3, 1)) info_pool <- calcFisher(itempool_science, seq(-3, 3, 1))
calcHessian
is a function for calculating the second derivative of the log-likelihood function.
calcHessian(object, theta, resp) ## S4 method for signature 'item_1PL,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_2PL,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_3PL,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_PC,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GPC,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GR,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_1PL,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_2PL,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_3PL,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_PC,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GPC,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GR,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_pool,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_pool_cluster,numeric,list' calcHessian(object, theta, resp)
calcHessian(object, theta, resp) ## S4 method for signature 'item_1PL,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_2PL,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_3PL,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_PC,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GPC,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GR,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_1PL,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_2PL,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_3PL,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_PC,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GPC,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_GR,matrix,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_pool,numeric,numeric' calcHessian(object, theta, resp) ## S4 method for signature 'item_pool_cluster,numeric,list' calcHessian(object, theta, resp)
object |
|
theta |
theta values to use. |
resp |
the response data to use. This must be a single value for an |
nq denotes the number of theta values.
ni denotes the number of items in the item_pool
object.
item
object:calcHessian
returns a length nq vector containing the second derivative of the log-likelihood function, of observing the response at each theta.
item_pool
object:calcHessian
returns a (nq, ni) matrix containing the second derivative of the log-likelihood function, of observing the response at each theta.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) h_item_1 <- calcHessian(item_1, seq(-3, 3, 1), 0) h_item_2 <- calcHessian(item_2, seq(-3, 3, 1), 0) h_item_3 <- calcHessian(item_3, seq(-3, 3, 1), 0) h_item_4 <- calcHessian(item_4, seq(-3, 3, 1), 0) h_item_5 <- calcHessian(item_5, seq(-3, 3, 1), 0) h_item_6 <- calcHessian(item_6, seq(-3, 3, 1), 0) h_pool <- calcHessian( itempool_science, seq(-3, 3, 1), rep(0, itempool_science@ni) )
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) h_item_1 <- calcHessian(item_1, seq(-3, 3, 1), 0) h_item_2 <- calcHessian(item_2, seq(-3, 3, 1), 0) h_item_3 <- calcHessian(item_3, seq(-3, 3, 1), 0) h_item_4 <- calcHessian(item_4, seq(-3, 3, 1), 0) h_item_5 <- calcHessian(item_5, seq(-3, 3, 1), 0) h_item_6 <- calcHessian(item_6, seq(-3, 3, 1), 0) h_pool <- calcHessian( itempool_science, seq(-3, 3, 1), rep(0, itempool_science@ni) )
calcJacobian
is a function for calculating the first derivative of the log-likelihood function.
calcJacobian(object, theta, resp) ## S4 method for signature 'item_1PL,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_2PL,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_3PL,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_PC,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GPC,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GR,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_1PL,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_2PL,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_3PL,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_PC,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GPC,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GR,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_pool,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_pool_cluster,numeric,list' calcJacobian(object, theta, resp)
calcJacobian(object, theta, resp) ## S4 method for signature 'item_1PL,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_2PL,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_3PL,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_PC,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GPC,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GR,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_1PL,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_2PL,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_3PL,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_PC,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GPC,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_GR,matrix,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_pool,numeric,numeric' calcJacobian(object, theta, resp) ## S4 method for signature 'item_pool_cluster,numeric,list' calcJacobian(object, theta, resp)
object |
|
theta |
theta values to use. |
resp |
the response value to use for each item. |
item
object:calcJacobian
returns a length nq vector containing the first derivative of the log-likelihood function, of observing the response at each theta.
item_pool
object:calcJacobian
returns a (nq, ni) matrix containing the first derivative of the log-likelihood function, of observing the response at each theta.
nq denotes the number of theta values.
ni denotes the number of items in the item_pool
object.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) j_item_1 <- calcJacobian(item_1, seq(-3, 3, 1), 0) j_item_2 <- calcJacobian(item_2, seq(-3, 3, 1), 0) j_item_3 <- calcJacobian(item_3, seq(-3, 3, 1), 0) j_item_4 <- calcJacobian(item_4, seq(-3, 3, 1), 0) j_item_5 <- calcJacobian(item_5, seq(-3, 3, 1), 0) j_item_6 <- calcJacobian(item_6, seq(-3, 3, 1), 0) j_pool <- calcJacobian( itempool_science, seq(-3, 3, 1), rep(0, itempool_science@ni) )
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) j_item_1 <- calcJacobian(item_1, seq(-3, 3, 1), 0) j_item_2 <- calcJacobian(item_2, seq(-3, 3, 1), 0) j_item_3 <- calcJacobian(item_3, seq(-3, 3, 1), 0) j_item_4 <- calcJacobian(item_4, seq(-3, 3, 1), 0) j_item_5 <- calcJacobian(item_5, seq(-3, 3, 1), 0) j_item_6 <- calcJacobian(item_6, seq(-3, 3, 1), 0) j_pool <- calcJacobian( itempool_science, seq(-3, 3, 1), rep(0, itempool_science@ni) )
calcLocation
is a function for calculating the central location (overall difficulty) of items.
calcLocation(object) ## S4 method for signature 'item_1PL' calcLocation(object) ## S4 method for signature 'item_2PL' calcLocation(object) ## S4 method for signature 'item_3PL' calcLocation(object) ## S4 method for signature 'item_PC' calcLocation(object) ## S4 method for signature 'item_GPC' calcLocation(object) ## S4 method for signature 'item_GR' calcLocation(object) ## S4 method for signature 'item_pool' calcLocation(object)
calcLocation(object) ## S4 method for signature 'item_1PL' calcLocation(object) ## S4 method for signature 'item_2PL' calcLocation(object) ## S4 method for signature 'item_3PL' calcLocation(object) ## S4 method for signature 'item_PC' calcLocation(object) ## S4 method for signature 'item_GPC' calcLocation(object) ## S4 method for signature 'item_GR' calcLocation(object) ## S4 method for signature 'item_pool' calcLocation(object)
object |
item
object:calcLocation
returns a theta value representing the central location.
item_pool
object:calcProb
returns a length ni list, each containing the central location of the item.
ni denotes the number of items in the item_pool
object.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) loc_item_1 <- calcLocation(item_1) loc_item_2 <- calcLocation(item_2) loc_item_3 <- calcLocation(item_3) loc_item_4 <- calcLocation(item_4) loc_item_5 <- calcLocation(item_5) loc_item_6 <- calcLocation(item_6) loc_pool <- calcLocation(itempool_science)
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) loc_item_1 <- calcLocation(item_1) loc_item_2 <- calcLocation(item_2) loc_item_3 <- calcLocation(item_3) loc_item_4 <- calcLocation(item_4) loc_item_5 <- calcLocation(item_5) loc_item_6 <- calcLocation(item_6) loc_pool <- calcLocation(itempool_science)
calcLogLikelihood
is a function for calculating log-likelihood values.
calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,numeric,numeric' calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,numeric,matrix' calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,matrix,numeric' calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,matrix,matrix' calcLogLikelihood(object, theta, resp)
calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,numeric,numeric' calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,numeric,matrix' calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,matrix,numeric' calcLogLikelihood(object, theta, resp) ## S4 method for signature 'item_pool,matrix,matrix' calcLogLikelihood(object, theta, resp)
object |
an |
theta |
theta values to use. |
resp |
the response data to use. |
calcLogLikelihood
returns values of log-likelihoods.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
j_pool <- calcLogLikelihood(itempool_science, seq(-3, 3, 1), 0)
j_pool <- calcLogLikelihood(itempool_science, seq(-3, 3, 1), 0)
calcProb
is a function for calculating item response probabilities.
calcProb(object, theta) ## S4 method for signature 'item_1PL,numeric' calcProb(object, theta) ## S4 method for signature 'item_2PL,numeric' calcProb(object, theta) ## S4 method for signature 'item_3PL,numeric' calcProb(object, theta) ## S4 method for signature 'item_PC,numeric' calcProb(object, theta) ## S4 method for signature 'item_GPC,numeric' calcProb(object, theta) ## S4 method for signature 'item_GR,numeric' calcProb(object, theta) ## S4 method for signature 'item_pool,numeric' calcProb(object, theta) ## S4 method for signature 'item_1PL,matrix' calcProb(object, theta) ## S4 method for signature 'item_2PL,matrix' calcProb(object, theta) ## S4 method for signature 'item_3PL,matrix' calcProb(object, theta) ## S4 method for signature 'item_PC,matrix' calcProb(object, theta) ## S4 method for signature 'item_GPC,matrix' calcProb(object, theta) ## S4 method for signature 'item_GR,matrix' calcProb(object, theta) ## S4 method for signature 'item_pool,matrix' calcProb(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' calcProb(object, theta)
calcProb(object, theta) ## S4 method for signature 'item_1PL,numeric' calcProb(object, theta) ## S4 method for signature 'item_2PL,numeric' calcProb(object, theta) ## S4 method for signature 'item_3PL,numeric' calcProb(object, theta) ## S4 method for signature 'item_PC,numeric' calcProb(object, theta) ## S4 method for signature 'item_GPC,numeric' calcProb(object, theta) ## S4 method for signature 'item_GR,numeric' calcProb(object, theta) ## S4 method for signature 'item_pool,numeric' calcProb(object, theta) ## S4 method for signature 'item_1PL,matrix' calcProb(object, theta) ## S4 method for signature 'item_2PL,matrix' calcProb(object, theta) ## S4 method for signature 'item_3PL,matrix' calcProb(object, theta) ## S4 method for signature 'item_PC,matrix' calcProb(object, theta) ## S4 method for signature 'item_GPC,matrix' calcProb(object, theta) ## S4 method for signature 'item_GR,matrix' calcProb(object, theta) ## S4 method for signature 'item_pool,matrix' calcProb(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' calcProb(object, theta)
object |
|
theta |
theta values to use. |
item
object:calcProb
returns a (nq, ncat) matrix of probability values.
item_pool
object:calcProb
returns a length ni list, each containing a matrix of probability values.
nq denotes the number of theta values.
ncat denotes the number of response categories.
ni denotes the number of items in the item_pool
object.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) prob_item_1 <- calcProb(item_1, seq(-3, 3, 1)) prob_item_2 <- calcProb(item_2, seq(-3, 3, 1)) prob_item_3 <- calcProb(item_3, seq(-3, 3, 1)) prob_item_4 <- calcProb(item_4, seq(-3, 3, 1)) prob_item_5 <- calcProb(item_5, seq(-3, 3, 1)) prob_item_6 <- calcProb(item_6, seq(-3, 3, 1)) prob_pool <- calcProb(itempool_science, seq(-3, 3, 1))
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) prob_item_1 <- calcProb(item_1, seq(-3, 3, 1)) prob_item_2 <- calcProb(item_2, seq(-3, 3, 1)) prob_item_3 <- calcProb(item_3, seq(-3, 3, 1)) prob_item_4 <- calcProb(item_4, seq(-3, 3, 1)) prob_item_5 <- calcProb(item_5, seq(-3, 3, 1)) prob_item_6 <- calcProb(item_6, seq(-3, 3, 1)) prob_pool <- calcProb(itempool_science, seq(-3, 3, 1))
calculateAdaptivityMeasures
is a function for
calculating commonly used adaptivity measures.
calculateAdaptivityMeasures(x)
calculateAdaptivityMeasures(x)
x |
an |
calculateAdaptivityMeasures
returns a named list:
corr
the correlation between final theta estimates and average test locations.
ratio
the ratio of (1) standard deviation of average test locations, versus (2) standard deviation of final theta estimates.
PRV
the proportion of variance reduced, from (1) the variance of item locations of all items in the pool, by (2) the average of test location variances.
info
(1) average information of a test at final theta estimate, relative to (2) best average obtainable from item pool using same test length, adjusting for (3) average information from item pool using random selection.
Check the consistency of constraints and item usage.
checkConstraints(constraints, usage_matrix, true_theta = NULL)
checkConstraints(constraints, usage_matrix, true_theta = NULL)
constraints |
A |
usage_matrix |
A matrix of item usage data from |
true_theta |
A vector of true theta values. |
createShadowTestConfig
is a config function for creating a config_Shadow
object for shadowtest assembly.
Default values are used for any unspecified parameters/slots.
createShadowTestConfig( item_selection = NULL, content_balancing = NULL, MIP = NULL, MCMC = NULL, exclude_policy = NULL, refresh_policy = NULL, exposure_control = NULL, overlap_control = NULL, stopping_criterion = NULL, interim_theta = NULL, final_theta = NULL, theta_grid = seq(-4, 4, 0.1) )
createShadowTestConfig( item_selection = NULL, content_balancing = NULL, MIP = NULL, MCMC = NULL, exclude_policy = NULL, refresh_policy = NULL, exposure_control = NULL, overlap_control = NULL, stopping_criterion = NULL, interim_theta = NULL, final_theta = NULL, theta_grid = seq(-4, 4, 0.1) )
item_selection |
a named list containing item selection criteria.
|
content_balancing |
a named list containing content balancing options.
|
MIP |
a named list containing solver options.
|
MCMC |
a named list containing Markov-chain Monte Carlo configurations for obtaining posterior samples.
|
exclude_policy |
a named list containing the exclude policy for use with the
|
refresh_policy |
a named list containing the refresh policy for when to obtain a new shadowtest.
|
exposure_control |
a named list containing exposure control settings.
|
overlap_control |
a named list containing overlap control settings.
|
stopping_criterion |
a named list containing stopping criterion.
|
interim_theta |
a named list containing interim theta estimation options.
|
final_theta |
a named list containing final theta estimation options.
|
theta_grid |
the theta grid to use as quadrature points. |
cfg1 <- createShadowTestConfig(refresh_policy = list( method = "STIMULUS" )) cfg2 <- createShadowTestConfig(refresh_policy = list( method = "POSITION", position = c(1, 5, 9) ))
cfg1 <- createShadowTestConfig(refresh_policy = list( method = "STIMULUS" )) cfg2 <- createShadowTestConfig(refresh_policy = list( method = "POSITION", position = c(1, 5, 9) ))
createStaticTestConfig
is a config function for creating a config_Static
object for Static (fixed-form) test assembly.
Default values are used for any unspecified parameters/slots.
createStaticTestConfig(item_selection = NULL, MIP = NULL)
createStaticTestConfig(item_selection = NULL, MIP = NULL)
item_selection |
a named list containing item selection criteria.
|
MIP |
a named list containing solver options.
|
createStaticTestConfig
returns a config_Static
object. This object is used in Static
.
cfg1 <- createStaticTestConfig( list( method = "MAXINFO", info_type = "FISHER", target_location = c(-1, 0, 1), target_weight = c(1, 1, 1) ) ) cfg2 <- createStaticTestConfig( list( method = "TIF", info_type = "FISHER", target_location = c(-1, 0, 1), target_weight = c(1, 1, 1), target_value = c(8, 10, 12) ) ) cfg3 <- createStaticTestConfig( list( method = "TCC", info_type = "FISHER", target_location = c(-1, 0, 1), target_weight = c(1, 1, 1), target_value = c(10, 15, 20) ) )
cfg1 <- createStaticTestConfig( list( method = "MAXINFO", info_type = "FISHER", target_location = c(-1, 0, 1), target_weight = c(1, 1, 1) ) ) cfg2 <- createStaticTestConfig( list( method = "TIF", info_type = "FISHER", target_location = c(-1, 0, 1), target_weight = c(1, 1, 1), target_value = c(8, 10, 12) ) ) cfg3 <- createStaticTestConfig( list( method = "TCC", info_type = "FISHER", target_location = c(-1, 0, 1), target_weight = c(1, 1, 1), target_value = c(10, 15, 20) ) )
constraint
is an S4 class for representing a single constraint.
constraint
the numeric index of the constraint.
constraint_id
the character ID of the constraint.
nc
the number of MIP-format constraints translated from this constraint.
mat,dir,rhs
these represent MIP-format constraints. A single MIP-format constraint is associated with a row in mat
, a value in rhs
, and a value in dir
.
the i-th row of mat
represents LHS coefficients to use on decision variables in the i-th MIP-format constraint.
the i-th value of rhs
represents RHS values to use in the i-th MIP-format constraint.
the i-th value of dir
represents the imposed constraint between LHS and RHS.
suspend
TRUE
if the constraint is not to be imposed.
constraints
is an S4 class for representing a set of constraints and its associated objects.
See constraints-operators
for object manipulation functions.
constraints
a data.frame
containing the constraint specifications.
list_constraints
a list containing the constraint
object representation of each constraint.
pool
the item_pool
object associated with the constraints.
item_attrib
the item_attrib
object associated with the constraints.
st_attrib
the st_attrib
object associated with the constraints.
test_length
the test length specified in the constraints.
nv
the number of decision variables. Equals ni + ns
.
ni
the number of items to search from.
ns
the number of stimulus to search from.
id
the item/stimulus ID string of each item/stimulus.
index,mat,dir,rhs
these represent MIP-format constraints. A single MIP-format constraint is associated with a value in index
, a row in mat
, a value in rhs
, and a value in dir
.
the i-th value of index
represents which constraint specification in the constraints
argument it was translated from.
the i-th row of mat
represents LHS coefficients to use on decision variables in the i-th MIP-format constraint.
the i-th value of rhs
represents RHS values to use in the i-th MIP-format constraint.
the i-th value of dir
represents the imposed constraint between LHS and RHS.
set_based
TRUE
if the constraint is set-based. FALSE
otherwise.
item_order
the item attribute of each item to use in imposing an item order constraint, if any.
item_order_by
the name of the item attribute to use in imposing an item order constraint, if any.
stim_order
the stimulus attribute of each stimulus to use in imposing a stimulus order constraint, if any.
stim_order_by
the name of the stimulus attribute to use in imposing a stimulus order constraint, if any.
item_index_by_stimulus
a list containing item indices of each stimulus.
stimulus_index_by_item
the stimulus indices of each item.
Create a subset of a constraints
object:
constraints[i]
subsetConstraints(constraints, 1:10)
Combine two constraints
objects:
c(constraints1, constraints2)
combineConstraints(constraints1, constraints2)
subsetConstraints(x, i = NULL) combineConstraints(x1, x2) ## S4 method for signature 'constraints,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'constraints' c(x, ...)
subsetConstraints(x, i = NULL) combineConstraints(x1, x2) ## S4 method for signature 'constraints,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'constraints' c(x, ...)
x , x1 , x2
|
a |
i , j
|
indices to use in subsetting. |
... |
not used, exists for compatibility. |
drop |
not used, exists for compatibility. |
c1 <- constraints_science c2 <- c1[1:10] c3 <- c1[c(1, 11:36)] # keep constraint 1 for test length c4 <- c(c2, c3)
c1 <- constraints_science c2 <- c1[1:10] c3 <- c1[c(1, 11:36)] # keep constraint 1 for test length c4 <- c(c2, c3)
Item-based example item pool with standard errors (320 items).
This pool is associated with the following objects:
itempool_bayes
an item_pool
object containing 320 items.
itemattrib_bayes
a item_attrib
object containing 5 item-level attributes.
constraints_bayes
a constraints
object containing 14 constraints.
Also, the following objects are intended for illustrating expected data structures.
itempool_bayes_data
a data.frame
containing item parameters.
itempool_se_bayes_data
a data.frame
containing item parameter standard errors.
itemattrib_bayes_data
a data.frame
containing item attributes.
constraints_bayes_data
a data.frame
containing constraint specifications.
itempool_bayes <- loadItemPool(itempool_bayes_data, itempool_se_bayes_data) itemattrib_bayes <- loadItemAttrib(itemattrib_bayes_data, itempool_bayes) constraints_bayes <- loadConstraints(constraints_bayes_data, itempool_bayes, itemattrib_bayes)
itempool_bayes <- loadItemPool(itempool_bayes_data, itempool_se_bayes_data) itemattrib_bayes <- loadItemAttrib(itemattrib_bayes_data, itempool_bayes) constraints_bayes <- loadConstraints(constraints_bayes_data, itempool_bayes, itemattrib_bayes)
Item-based example pool with item contents (95 items).
This pool is associated with the following objects:
itempool_fatigue
an item_pool
object containing 95 items.
itemattrib_fatigue
an item_attrib
object containing 7 item-level attributes.
constraints_fatigue
a constraints
object containing 111 constraints.
Also, the following objects are intended for illustrating expected data structures.
itempool_fatigue_data
a data.frame
containing item parameters.
itemattrib_fatigue_data
a data.frame
containing item attributes.
itemtext_fatigue_data
a data.frame
containing item texts.
constraints_fatigue_data
a data.frame
containing constraint specifications.
resp_fatigue_data
a data.frame
containing raw response data.
itempool_fatigue <- loadItemPool(itempool_fatigue_data) itemattrib_fatigue <- loadItemAttrib(itemattrib_fatigue_data, itempool_fatigue) constraints_fatigue <- loadConstraints(constraints_fatigue_data, itempool_fatigue, itemattrib_fatigue)
itempool_fatigue <- loadItemPool(itempool_fatigue_data) itemattrib_fatigue <- loadItemAttrib(itemattrib_fatigue_data, itempool_fatigue) constraints_fatigue <- loadConstraints(constraints_fatigue_data, itempool_fatigue, itemattrib_fatigue)
Stimulus-based example item pool (303 items, 35 stimuli).
This pool is associated with the following objects:
itempool_reading
an item_pool
object containing 303 items.
itemattrib_reading
an item_attrib
object containing 12 item-level attributes.
stimattrib_reading
a st_attrib
object containing 4 stimulus-level attributes.
constraints_reading
a constraints
object containing 18 constraints.
Also, the following objects are intended for illustrating expected data structures.
itempool_reading_data
a data.frame
containing item parameters.
itemattrib_reading_data
a data.frame
containing item attributes.
stimattrib_reading_data
a data.frame
containing stimulus attributes.
constraints_reading_data
a data.frame
containing constraint specifications.
itempool_reading <- loadItemPool(itempool_reading_data) itemattrib_reading <- loadItemAttrib(itemattrib_reading_data, itempool_reading) stimattrib_reading <- loadStAttrib(stimattrib_reading_data, itemattrib_reading) constraints_reading <- loadConstraints(constraints_reading_data, itempool_reading, itemattrib_reading, stimattrib_reading)
itempool_reading <- loadItemPool(itempool_reading_data) itemattrib_reading <- loadItemAttrib(itemattrib_reading_data, itempool_reading) stimattrib_reading <- loadStAttrib(stimattrib_reading_data, itemattrib_reading) constraints_reading <- loadConstraints(constraints_reading_data, itempool_reading, itemattrib_reading, stimattrib_reading)
Item-based example item pool (1000 items).
This pool is associated with the following objects:
itempool_science
an item_pool
object containing 1000 items.
itemattrib_science
an item_attrib
object containing 9 item-level attributes.
constraints_science
a constraints
object containing 36 constraints.
Also, the following objects are intended for illustrating expected data structures.
itempool_science_data
a data.frame
containing item parameters.
itemattrib_science_data
a data.frame
containing item attributes.
constraints_science_data
a data.frame
containing constraint specifications.
itempool_science <- loadItemPool(itempool_science_data) itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science) constraints_science <- loadConstraints(constraints_science_data, itempool_science, itemattrib_science)
itempool_science <- loadItemPool(itempool_science_data) itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science) constraints_science <- loadConstraints(constraints_science_data, itempool_science, itemattrib_science)
Detect best solver
detectBestSolver()
detectBestSolver()
the package name of the best available solver on the system.
solver <- detectBestSolver() cfg <- createStaticTestConfig(MIP = list(solver = solver)) cfg <- createShadowTestConfig(MIP = list(solver = solver))
solver <- detectBestSolver() cfg <- createStaticTestConfig(MIP = list(solver = solver)) cfg <- createShadowTestConfig(MIP = list(solver = solver))
e_*()
and array_e_*()
are C++ functions for calculating expected scores.
e_1pl(x, b) e_2pl(x, a, b) e_m_2pl(x, a, d) e_3pl(x, a, b, c) e_m_3pl(x, a, d, c) e_pc(x, b) e_gpc(x, a, b) e_m_gpc(x, a, d) e_gr(x, a, b) e_m_gr(x, a, d) array_e_1pl(x, b) array_e_2pl(x, a, b) array_e_3pl(x, a, b, c) array_e_pc(x, b) array_e_gpc(x, a, b) array_e_gr(x, a, b)
e_1pl(x, b) e_2pl(x, a, b) e_m_2pl(x, a, d) e_3pl(x, a, b, c) e_m_3pl(x, a, d, c) e_pc(x, b) e_gpc(x, a, b) e_m_gpc(x, a, d) e_gr(x, a, b) e_m_gr(x, a, d) array_e_1pl(x, b) array_e_2pl(x, a, b) array_e_3pl(x, a, b, c) array_e_pc(x, b) array_e_gpc(x, a, b) array_e_gr(x, a, b)
x |
the theta value. The number of columns should correspond to the number of dimensions.
For |
b , d
|
the difficulty parameter. |
a |
the a-parameter. |
c |
the c-parameter. |
e_*()
functions accept a single theta value, and array_p_*()
functions accept multiple theta values.
Supports unidimensional and multidimensional models.
e_1pl()
, array_e_1pl()
: 1PL models
e_2pl()
, array_e_2pl()
: 2PL models
e_3pl()
, array_e_3pl()
: 3PL models
e_pc()
, array_e_pc()
: PC (partial credit) models
e_gpc()
, array_e_gpc()
: GPC (generalized partial credit) models
e_gr()
, array_e_gr()
: GR (graded response) models
e_m_2pl()
, array_e_m_2pl()
: multidimensional 2PL models
e_m_3pl()
, array_e_m_3pl()
: multidimensional 3PL models
e_m_gpc()
, array_e_m_gpc()
: multidimensional GPC models
e_m_gr()
, array_e_m_gr()
: multidimensional GR models
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
x <- 0.5 e_1pl(x, 1) e_2pl(x, 1, 2) e_3pl(x, 1, 2, 0.25) e_pc(x, c(0, 1)) e_gpc(x, 2, c(0, 1)) e_gr(x, 2, c(0, 2)) x <- matrix(seq(-3, 3, 1)) # three theta values, unidimensional array_e_1pl(x, 1) array_e_2pl(x, 1, 2) array_e_3pl(x, 1, 2, 0.25) array_e_pc(x, c(0, 1)) array_e_gpc(x, 2, c(0, 1)) array_e_gr(x, 2, c(0, 2))
x <- 0.5 e_1pl(x, 1) e_2pl(x, 1, 2) e_3pl(x, 1, 2, 0.25) e_pc(x, c(0, 1)) e_gpc(x, 2, c(0, 1)) e_gr(x, 2, c(0, 2)) x <- matrix(seq(-3, 3, 1)) # three theta values, unidimensional array_e_1pl(x, 1) array_e_2pl(x, 1, 2) array_e_3pl(x, 1, 2, 0.25) array_e_pc(x, c(0, 1)) array_e_gpc(x, 2, c(0, 1)) array_e_gr(x, 2, c(0, 2))
eap
is a function for computing expected a posteriori estimates of theta.
eap( object, select = NULL, resp, theta_grid = seq(-4, 4, 0.1), prior = rep(1/81, 81) ) ## S4 method for signature 'item_pool' eap( object, select = NULL, resp, theta_grid = seq(-4, 4, 0.1), prior = rep(1/81, 81) ) EAP(object, select = NULL, prior, reset_prior = FALSE) ## S4 method for signature 'test' EAP(object, select = NULL, prior, reset_prior = FALSE) ## S4 method for signature 'test_cluster' EAP(object, select = NULL, prior, reset_prior = FALSE)
eap( object, select = NULL, resp, theta_grid = seq(-4, 4, 0.1), prior = rep(1/81, 81) ) ## S4 method for signature 'item_pool' eap( object, select = NULL, resp, theta_grid = seq(-4, 4, 0.1), prior = rep(1/81, 81) ) EAP(object, select = NULL, prior, reset_prior = FALSE) ## S4 method for signature 'test' EAP(object, select = NULL, prior, reset_prior = FALSE) ## S4 method for signature 'test_cluster' EAP(object, select = NULL, prior, reset_prior = FALSE)
object |
an |
select |
(optional) if item indices are supplied, only the specified items are used. |
resp |
item response on all (or selected) items in the |
theta_grid |
the theta grid to use as quadrature points. (default = |
prior |
a prior distribution, a numeric vector for a common prior or a matrix for individualized priors. (default = |
reset_prior |
used for |
eap
returns a list containing estimated values.
th
theta value.
se
standard error.
eap(itempool_fatigue, resp = resp_fatigue_data[10, ]) eap(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
eap(itempool_fatigue, resp = resp_fatigue_data[10, ]) eap(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
find_segment()
is a function for classifying theta values into segments based on supplied cutpoints.
find_segment(x, segment)
find_segment(x, segment)
x |
the theta value. This can be a vector. |
segment |
segment cutpoints. Values of |
cuts <- c(-Inf, -2, 0, 2, Inf) find_segment(-3, cuts) find_segment(-1, cuts) find_segment(1, cuts) find_segment(3, cuts) find_segment(seq(-3, 3, 2), cuts)
cuts <- c(-Inf, -2, 0, 2, Inf) find_segment(-3, cuts) find_segment(-1, cuts) find_segment(1, cuts) find_segment(3, cuts) find_segment(seq(-3, 3, 2), cuts)
getScoreAttributes
is a helper function for retrieving constraints-related scores from a solution.
getScoreAttributes(constraints, item_idx, item_resp, item_ncat)
getScoreAttributes(constraints, item_idx, item_resp, item_ncat)
constraints |
a |
item_idx |
item indices from a solution. |
item_resp |
item scores for |
item_ncat |
number of score categories for |
item_idx <- c( 29, 33, 26, 36, 34, 295, 289, 296, 291, 126, 133, 124, 134, 129, 38, 47, 39, 41, 46, 45, 167, 166, 170, 168, 113, 116, 119, 117, 118, 114) item_resp <- c( 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1) item_ncat <- c( 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) getScoreAttributes(constraints_reading, item_idx, item_resp, item_ncat)
item_idx <- c( 29, 33, 26, 36, 34, 295, 289, 296, 291, 126, 133, 124, 134, 129, 38, 47, 39, 41, 46, 45, 167, 166, 170, 168, 113, 116, 119, 117, 118, 114) item_resp <- c( 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1) item_ncat <- c( 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) getScoreAttributes(constraints_reading, item_idx, item_resp, item_ncat)
Print solution items
getSolution(object, examinee = NA, position = NA, index_only = TRUE) ## S4 method for signature 'list' getSolution(object, examinee = NA, position = NA, index_only = TRUE) ## S4 method for signature 'output_Static' getSolution(object, examinee = NA, position = NA, index_only = TRUE)
getSolution(object, examinee = NA, position = NA, index_only = TRUE) ## S4 method for signature 'list' getSolution(object, examinee = NA, position = NA, index_only = TRUE) ## S4 method for signature 'output_Static' getSolution(object, examinee = NA, position = NA, index_only = TRUE)
object |
an |
examinee |
(optional) the examinee index to display the solution. Used when the 'object' argument is an |
position |
(optional) if supplied, display the item attributes of the assembled test at that item position. If not supplied, display the item attributes of the administered items. Used when the 'object' argument is an |
index_only |
if |
Item attributes of solution items.
getSolutionAttributes
is a helper function for retrieving constraints-related attributes from a solution.
getSolutionAttributes(constraints, item_idx, all_values = FALSE)
getSolutionAttributes(constraints, item_idx, all_values = FALSE)
constraints |
a |
item_idx |
item indices from a solution. |
all_values |
if |
If all_values == FALSE
, getSolutionAttributes
returns a data.frame
containing constraints data and their associated attributes.
If all_values == TRUE
, getSolutionAttributes
returns a list
containing attributes associated to each constraint.
item_idx <- c( 29, 33, 26, 36, 34, 295, 289, 296, 291, 126, 133, 124, 134, 129, 38, 47, 39, 41, 46, 45, 167, 166, 170, 168, 113, 116, 119, 117, 118, 114) getSolutionAttributes(constraints_reading, item_idx, FALSE) getSolutionAttributes(constraints_reading, item_idx, TRUE)
item_idx <- c( 29, 33, 26, 36, 34, 295, 289, 296, 291, 126, 133, 124, 134, 129, 38, 47, 39, 41, 46, 45, 167, 166, 170, 168, 113, 116, 119, 117, 118, 114) getSolutionAttributes(constraints_reading, item_idx, FALSE) getSolutionAttributes(constraints_reading, item_idx, TRUE)
h_*()
and array_h_*()
are C++ functions for calculating the second derivative of the log-likelihood function.
h_1pl(x, b, u) h_2pl(x, a, b, u) h_m_2pl(x, a, d, u) h_3pl(x, a, b, c, u) h_m_3pl(x, a, d, c, u) h_pc(x, b, u) h_gpc(x, a, b, u) h_m_gpc(x, a, d, u) h_gr(x, a, b, u) h_m_gr(x, a, d, u) array_h_1pl(x, b, u) array_h_2pl(x, a, b, u) array_h_3pl(x, a, b, c, u) array_h_pc(x, b, u) array_h_gpc(x, a, b, u) array_h_gr(x, a, b, u)
h_1pl(x, b, u) h_2pl(x, a, b, u) h_m_2pl(x, a, d, u) h_3pl(x, a, b, c, u) h_m_3pl(x, a, d, c, u) h_pc(x, b, u) h_gpc(x, a, b, u) h_m_gpc(x, a, d, u) h_gr(x, a, b, u) h_m_gr(x, a, d, u) array_h_1pl(x, b, u) array_h_2pl(x, a, b, u) array_h_3pl(x, a, b, c, u) array_h_pc(x, b, u) array_h_gpc(x, a, b, u) array_h_gr(x, a, b, u)
x |
the theta value. The number of columns should correspond to the number of dimensions.
For |
b , d
|
the difficulty parameter. |
u |
the response value. |
a |
the a-parameter. |
c |
the c-parameter. |
h_*()
functions accept a single theta value, and array_h_*()
functions accept multiple theta values.
Supports unidimensional and multidimensional models.
h_1pl()
, array_h_1pl()
: 1PL models
h_2pl()
, array_h_2pl()
: 2PL models
h_3pl()
, array_h_3pl()
: 3PL models
h_pc()
, array_h_pc()
: PC (partial credit) models
h_gpc()
, array_h_gpc()
: GPC (generalized partial credit) models
h_gr()
, array_h_gr()
: GR (graded response) models
h_m_2pl()
, array_h_m_2pl()
: multidimensional 2PL models
h_m_3pl()
, array_h_m_3pl()
: multidimensional 3PL models
h_m_gpc()
, array_h_m_gpc()
: multidimensional GPC models
h_m_gr()
, array_h_m_gr()
: multidimensional GR models
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
u <- 1 x <- 0.5 h_1pl(x, 1, u) h_2pl(x, 1, 2, u) h_3pl(x, 1, 2, 0.25, u) h_pc(x, c(0, 1), u) h_gpc(x, 2, c(0, 1), u) h_gr(x, 2, c(0, 2), u) x <- matrix(seq(-3, 3, 1)) # three theta values, unidimensional array_h_1pl(x, 1, u) array_h_2pl(x, 1, 2, u) array_h_3pl(x, 1, 2, 0.25, u) array_h_pc(x, c(0, 1), u) array_h_gpc(x, 2, c(0, 1), u) array_h_gr(x, 2, c(0, 2), u)
u <- 1 x <- 0.5 h_1pl(x, 1, u) h_2pl(x, 1, 2, u) h_3pl(x, 1, 2, 0.25, u) h_pc(x, c(0, 1), u) h_gpc(x, 2, c(0, 1), u) h_gr(x, 2, c(0, 2), u) x <- matrix(seq(-3, 3, 1)) # three theta values, unidimensional array_h_1pl(x, 1, u) array_h_2pl(x, 1, 2, u) array_h_3pl(x, 1, 2, 0.25, u) array_h_pc(x, c(0, 1), u) array_h_gpc(x, 2, c(0, 1), u) array_h_gr(x, 2, c(0, 2), u)
info_*()
and array_info_*()
are functions for calculating Fisher information.
info_1pl(x, b) info_2pl(x, a, b) info_m_2pl(x, a, d) dirinfo_m_2pl(x, a, d) thisdirinfo_m_2pl(x, alpha_vec, a, d) info_3pl(x, a, b, c) info_m_3pl(x, a, d, c) dirinfo_m_3pl(x, a, d, c) thisdirinfo_m_3pl(x, alpha_vec, a, d, c) info_pc(x, b) info_gpc(x, a, b) info_m_gpc(x, a, d) dirinfo_m_gpc(x, a, d) thisdirinfo_m_gpc(x, alpha_vec, a, d) info_gr(x, a, b) info_m_gr(x, a, d) dirinfo_m_gr(x, a, d) thisdirinfo_m_gr(x, alpha_vec, a, d) array_info_1pl(x, b) array_info_2pl(x, a, b) array_info_m_2pl(x, a, d) array_dirinfo_m_2pl(x, a, d) array_thisdirinfo_m_2pl(x, alpha_vec, a, d) array_info_3pl(x, a, b, c) array_info_m_3pl(x, a, d, c) array_dirinfo_m_3pl(x, a, d, c) array_thisdirinfo_m_3pl(x, alpha_vec, a, d, c) array_info_pc(x, b) array_info_gpc(x, a, b) array_info_m_gpc(x, a, d) array_dirinfo_m_gpc(x, a, d) array_thisdirinfo_m_gpc(x, alpha_vec, a, d) array_info_gr(x, a, b) array_info_m_gr(x, a, d) array_dirinfo_m_gr(x, a, d) array_thisdirinfo_m_gr(x, alpha_vec, a, d)
info_1pl(x, b) info_2pl(x, a, b) info_m_2pl(x, a, d) dirinfo_m_2pl(x, a, d) thisdirinfo_m_2pl(x, alpha_vec, a, d) info_3pl(x, a, b, c) info_m_3pl(x, a, d, c) dirinfo_m_3pl(x, a, d, c) thisdirinfo_m_3pl(x, alpha_vec, a, d, c) info_pc(x, b) info_gpc(x, a, b) info_m_gpc(x, a, d) dirinfo_m_gpc(x, a, d) thisdirinfo_m_gpc(x, alpha_vec, a, d) info_gr(x, a, b) info_m_gr(x, a, d) dirinfo_m_gr(x, a, d) thisdirinfo_m_gr(x, alpha_vec, a, d) array_info_1pl(x, b) array_info_2pl(x, a, b) array_info_m_2pl(x, a, d) array_dirinfo_m_2pl(x, a, d) array_thisdirinfo_m_2pl(x, alpha_vec, a, d) array_info_3pl(x, a, b, c) array_info_m_3pl(x, a, d, c) array_dirinfo_m_3pl(x, a, d, c) array_thisdirinfo_m_3pl(x, alpha_vec, a, d, c) array_info_pc(x, b) array_info_gpc(x, a, b) array_info_m_gpc(x, a, d) array_dirinfo_m_gpc(x, a, d) array_thisdirinfo_m_gpc(x, alpha_vec, a, d) array_info_gr(x, a, b) array_info_m_gr(x, a, d) array_dirinfo_m_gr(x, a, d) array_thisdirinfo_m_gr(x, alpha_vec, a, d)
x |
the theta value. The number of columns should correspond to the number of dimensions.
For |
b , d
|
the difficulty parameter. |
a |
the a-parameter. |
alpha_vec |
the alpha angle vector. Used for directional information in |
c |
the c-parameter. |
info_*()
functions accept a single theta value, and array_info_*
functions accept multiple theta values.
Supports unidimensional and multidimensional models.
info_1pl()
, array_info_1pl()
: 1PL models
info_2pl()
, array_info_2pl()
: 2PL models
info_3pl()
, array_info_3pl()
: 3PL models
info_pc()
, array_info_pc()
: PC (partial credit) models
info_gpc()
, array_info_gpc()
: GPC (generalized partial credit) models
info_gr()
, array_info_gr()
: GR (graded response) models
info_m_2pl()
, array_info_m_2pl()
: multidimensional 2PL models
info_m_3pl()
, array_info_m_3pl()
: multidimensional 3PL models
info_m_gpc()
, array_info_m_gpc()
: multidimensional GPC models
info_m_gr()
, array_info_m_gr()
: multidimensional GR models
Directional information for a specific angle
thisdirinfo_m_2pl()
, array_thisdirinfo_m_2pl()
: multidimensional 2PL models
thisdirinfo_m_3pl()
, array_thisdirinfo_m_3pl()
: multidimensional 3PL models
thisdirinfo_m_gpc()
, array_thisdirinfo_m_gpc()
: multidimensional GPC models
thisdirinfo_m_gr()
, array_thisdirinfo_m_gr()
: multidimensional GR models
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
x <- 0.5 info_1pl(x, 1) info_2pl(x, 1, 2) info_3pl(x, 1, 2, 0.25) info_pc(x, c(0, 1)) info_gpc(x, 2, c(0, 1)) info_gr(x, 2, c(0, 2)) x <- matrix(seq(0.1, 0.5, 0.1)) # three theta values, unidimensional array_info_1pl(x, 1) array_info_2pl(x, 1, 2) array_info_3pl(x, 1, 2, 0.25) array_info_pc(x, c(0, 1)) array_info_gpc(x, 2, c(0, 1)) array_info_gr(x, 2, c(0, 2))
x <- 0.5 info_1pl(x, 1) info_2pl(x, 1, 2) info_3pl(x, 1, 2, 0.25) info_pc(x, c(0, 1)) info_gpc(x, 2, c(0, 1)) info_gr(x, 2, c(0, 2)) x <- matrix(seq(0.1, 0.5, 0.1)) # three theta values, unidimensional array_info_1pl(x, 1) array_info_2pl(x, 1, 2) array_info_3pl(x, 1, 2, 0.25) array_info_pc(x, c(0, 1)) array_info_gpc(x, 2, c(0, 1)) array_info_gr(x, 2, c(0, 2))
iparPosteriorSample
is a function for generating item parameter samples.
Used for the FB (full-Bayesian) estimation method.
iparPosteriorSample(pool, n_sample = 500)
iparPosteriorSample(pool, n_sample = 500)
pool |
an |
n_sample |
the number of samples to draw. |
iparPosteriorSample
returns a length-ni list of item parameter matrices, with each matrix having n_sample
rows.
ipar <- iparPosteriorSample(itempool_bayes, 5) ipar <- iparPosteriorSample(itempool_science, 5) # no variation
ipar <- iparPosteriorSample(itempool_bayes, 5) ipar <- iparPosteriorSample(itempool_science, 5) # no variation
loadItemAttrib
is a data loading function for creating an item_attrib
object.
loadItemAttrib
can read item attributes from a data.frame
or a .csv file.
loadItemAttrib(object, pool)
loadItemAttrib(object, pool)
object |
item attributes. Can be a |
pool |
an |
loadItemAttrib
returns an item_attrib
object.
data
a data.frame
containing item attributes.
dataset_science
, dataset_reading
, dataset_fatigue
, dataset_bayes
for examples.
## Read from data.frame: itempool_science <- loadItemPool(itempool_science_data) itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "itemattrib_science.csv") write.csv(itemattrib_science_data, f, row.names = FALSE) itemattrib_science <- loadItemAttrib(f, itempool_science) file.remove(f)
## Read from data.frame: itempool_science <- loadItemPool(itempool_science_data) itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "itemattrib_science.csv") write.csv(itemattrib_science_data, f, row.names = FALSE) itemattrib_science <- loadItemAttrib(f, itempool_science) file.remove(f)
Basic functions for item attribute objects
## S4 method for signature 'item_attrib,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'item_attrib' dim(x) ## S4 method for signature 'item_attrib' colnames(x) ## S4 method for signature 'item_attrib' rownames(x) ## S4 method for signature 'item_attrib' names(x) ## S4 method for signature 'item_attrib' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S4 method for signature 'item_attrib,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'item_attrib' dim(x) ## S4 method for signature 'item_attrib' colnames(x) ## S4 method for signature 'item_attrib' rownames(x) ## S4 method for signature 'item_attrib' names(x) ## S4 method for signature 'item_attrib' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
an |
i , j
|
indices to use in subsetting. |
... |
not used, exists for compatibility. |
drop |
not used, exists for compatibility. |
row.names |
not used, exists for compatibility. |
optional |
not used, exists for compatibility. |
x <- itemattrib_science x[1:10] dim(x) ncol(x) nrow(x) colnames(x) rownames(x) names(x) as.data.frame(x)
x <- itemattrib_science x[1:10] dim(x) ncol(x) nrow(x) colnames(x) rownames(x) names(x) as.data.frame(x)
item_pool_cluster
is an S4 class for representing a group of item pools.
np
the number of item pools.
pools
a list of item_pool
objects.
names
a vector containing item pool names.
item_pool
is an S4 class for representing an item pool.
See item_pool-operators
for object manipulation functions.
ni
the number of items in the pool.
max_cat
the maximum number of response categories across the pool.
index
the numeric index of each item.
id
the ID string of each item.
model
the item class name of each item. See item-classes
.
NCAT
the number of response categories of each item.
parms
a list containing item class objects. See item-classes
.
ipar
a matrix containing item parameters.
se
a matrix containing item parameter standard errors.
raw
the raw input data.frame
used in loadItemPool
to create this object.
raw_se
the raw input data.frame
used in loadItemPool
to create this object.
unique
whether item IDs must be unique for this object to be a valid object.
Create a subset of an item_pool
object:
pool[i]
subsetItemPool(pool, i)
Combine two item_pool
objects:
c(pool1, pool2)
combineItemPool(pool1, pool2)
pool1 + pool2
pool1 - pool2
excludes items in pool2
from pool1
.
pool1 == pool2
tests whether two item_pool
objects are identical.
subsetItemPool(x, i = NULL) combineItemPool(x1, x2, unique = TRUE, verbose = TRUE) ## S4 method for signature 'item_pool,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'item_pool' c(x, ...) ## S3 method for class 'item_pool' x1 + x2 ## S3 method for class 'item_pool' x1 - x2 ## S3 method for class 'item_pool' x1 == x2
subsetItemPool(x, i = NULL) combineItemPool(x1, x2, unique = TRUE, verbose = TRUE) ## S4 method for signature 'item_pool,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'item_pool' c(x, ...) ## S3 method for class 'item_pool' x1 + x2 ## S3 method for class 'item_pool' x1 - x2 ## S3 method for class 'item_pool' x1 == x2
x , x1 , x2
|
an |
i |
item indices to use in subsetting. |
unique |
if |
verbose |
if |
j , drop , ...
|
not used, exists for compatibility. |
p1 <- itempool_science[1:100] p2 <- c(itempool_science, itempool_reading) p3 <- p2 - p1 p1 <- itempool_science[1:500] p2 <- itempool_science - p1 p3 <- itempool_science[501:1000] identical(p2, p3) ## TRUE p <- p1 + p3 p == itempool_science ## TRUE
p1 <- itempool_science[1:100] p2 <- c(itempool_science, itempool_reading) p3 <- p2 - p1 p1 <- itempool_science[1:500] p2 <- itempool_science - p1 p3 <- itempool_science[501:1000] identical(p2, p3) ## TRUE p <- p1 + p3 p == itempool_science ## TRUE
item_1PL
class represents a 1PL item.
item_2PL
class represents a 2PL item.
item_3PL
class represents a 3PL item.
item_PC
class represents a partial credit item.
item_GPC
class represents a generalized partial credit item.
item_GR
class represents a graded response item.
slope
a slope parameter value
difficulty
a difficulty parameter value
guessing
a guessing parameter value
threshold
a vector of threshold parameter values
category
a vector of category boundary values
ncat
the number of response categories
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-0.5, 0.5), ncat = 3) item_5 <- new("item_GPC", slope = 1.0, threshold = c(-0.5, 0.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 1.0, category = c(-2.0, -1.0, 0, 1.0, 2.0), ncat = 6)
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-0.5, 0.5), ncat = 3) item_5 <- new("item_GPC", slope = 1.0, threshold = c(-0.5, 0.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 1.0, category = c(-2.0, -1.0, 0, 1.0, 2.0), ncat = 6)
j_*()
and array_j_*()
are C++ functions for calculating the first derivative of the log-likelihood function.
j_1pl(x, b, u) j_2pl(x, a, b, u) j_m_2pl(x, a, d, u) j_3pl(x, a, b, c, u) j_m_3pl(x, a, d, c, u) j_pc(x, b, u) j_gpc(x, a, b, u) j_m_gpc(x, a, d, u) j_gr(x, a, b, u) j_m_gr(x, a, d, u) array_j_1pl(x, b, u) array_j_2pl(x, a, b, u) array_j_3pl(x, a, b, c, u) array_j_pc(x, b, u) array_j_gpc(x, a, b, u) array_j_gr(x, a, b, u)
j_1pl(x, b, u) j_2pl(x, a, b, u) j_m_2pl(x, a, d, u) j_3pl(x, a, b, c, u) j_m_3pl(x, a, d, c, u) j_pc(x, b, u) j_gpc(x, a, b, u) j_m_gpc(x, a, d, u) j_gr(x, a, b, u) j_m_gr(x, a, d, u) array_j_1pl(x, b, u) array_j_2pl(x, a, b, u) array_j_3pl(x, a, b, c, u) array_j_pc(x, b, u) array_j_gpc(x, a, b, u) array_j_gr(x, a, b, u)
x |
the theta value. The number of columns should correspond to the number of dimensions.
For |
b , d
|
the difficulty parameter. |
u |
the response value. |
a |
the a-parameter. |
c |
the c-parameter. |
j_*()
functions accept a single theta value, and array_j_*()
functions accept multiple theta values.
Supports unidimensional and multidimensional models.
j_1pl()
, array_j_1pl()
: 1PL models
j_2pl()
, array_j_2pl()
: 2PL models
j_3pl()
, array_j_3pl()
: 3PL models
j_pc()
, array_j_pc()
: PC (partial credit) models
j_gpc()
, array_j_gpc()
: GPC (generalized partial credit) models
j_gr()
, array_j_gr()
: GR (graded response) models
j_m_2pl()
, array_j_m_2pl()
: multidimensional 2PL models
j_m_3pl()
, array_j_m_3pl()
: multidimensional 3PL models
j_m_gpc()
, array_j_m_gpc()
: multidimensional GPC models
j_m_gr()
, array_j_m_gr()
: multidimensional GR models
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
u <- 1 x <- 0.5 j_1pl(x, 1, u) j_2pl(x, 1, 2, u) j_3pl(x, 1, 2, 0.25, u) j_pc(x, c(0, 1), u) j_gpc(x, 2, c(0, 1), u) j_gr(x, 2, c(0, 2), u) x <- matrix(seq(-3, 3, 1)) # three theta values, unidimensional array_j_1pl(x, 1, u) array_j_2pl(x, 1, 2, u) array_j_3pl(x, 1, 2, 0.25, u) array_j_pc(x, c(0, 1), u) array_j_gpc(x, 2, c(0, 1), u) array_j_gr(x, 2, c(0, 2), u)
u <- 1 x <- 0.5 j_1pl(x, 1, u) j_2pl(x, 1, 2, u) j_3pl(x, 1, 2, 0.25, u) j_pc(x, c(0, 1), u) j_gpc(x, 2, c(0, 1), u) j_gr(x, 2, c(0, 2), u) x <- matrix(seq(-3, 3, 1)) # three theta values, unidimensional array_j_1pl(x, 1, u) array_j_2pl(x, 1, 2, u) array_j_3pl(x, 1, 2, 0.25, u) array_j_pc(x, c(0, 1), u) array_j_gpc(x, 2, c(0, 1), u) array_j_gr(x, 2, c(0, 2), u)
lnHyperPars
is a function for calculating parameters for a log-normal distribution, such that the distribution yields desired mean and standard deviation.
Used for sampling the a-parameter.
lnHyperPars(mean, sd)
lnHyperPars(mean, sd)
mean |
the desired mean. |
sd |
the desired standard deviation. |
lnHyperPars
returns two values. These can be directly supplied to rlnorm
.
pars <- lnHyperPars(2, 4) x <- rlnorm(1000000, pars[1], pars[2]) mean(x) # close to 2 sd(x) # close to 4
pars <- lnHyperPars(2, 4) x <- rlnorm(1000000, pars[1], pars[2]) mean(x) # close to 2 sd(x) # close to 4
loadConstraints
is a data loading function for creating a constraints
object.
loadConstraints
can read constraints from a data.frame or a .csv file.
The contents must be in the expected format; see the vignette in vignette("constraints")
for a documentation.
loadConstraints(object, pool, item_attrib, st_attrib = NULL)
loadConstraints(object, pool, item_attrib, st_attrib = NULL)
object |
constraint specifications. Can be a |
pool |
an |
item_attrib |
an |
st_attrib |
(optional) an |
loadConstraints
returns a constraints
object. This object is used in Static
and Shadow
.
dataset_science
, dataset_reading
, dataset_fatigue
, dataset_bayes
for examples.
## Read from data.frame: itempool_science <- loadItemPool(itempool_science_data) itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science) constraints_science <- loadConstraints(constraints_science_data, itempool_science, itemattrib_science) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "constraints_science.csv") write.csv(constraints_science_data, f, row.names = FALSE) constraints_science <- loadConstraints(f, itempool_science, itemattrib_science) file.remove(f)
## Read from data.frame: itempool_science <- loadItemPool(itempool_science_data) itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science) constraints_science <- loadConstraints(constraints_science_data, itempool_science, itemattrib_science) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "constraints_science.csv") write.csv(constraints_science_data, f, row.names = FALSE) constraints_science <- loadConstraints(f, itempool_science, itemattrib_science) file.remove(f)
loadItemPool
is a data loading function for creating an item_pool
object.
loadItemPool
can read item parameters and standard errors from a data.frame
or a .csv file.
loadItemPool(ipar, ipar_se = NULL, unique = FALSE)
loadItemPool(ipar, ipar_se = NULL, unique = FALSE)
ipar |
item parameters. Can be a |
ipar_se |
(optional) standard errors. Can be a |
unique |
if |
loadItemPool
returns an item_pool
object.
ni
the number of items in the pool.
max_cat
the maximum number of response categories across all items in the pool.
index
the numeric item index of each item.
id
the item ID string of each item.
model
the object class names of each item representing an item model type.
Can be item_1PL
, item_2PL
, item_3PL
,
item_PC
, item_GPC
, or item_GR
.
NCAT
the number of response categories of each item.
parms
a list containing the item object of each item.
ipar
a matrix containing all item parameters.
se
a matrix containing all item parameter standard errors. The values will be 0 if the argument ipar_se
was not supplied.
raw
the original input ipar
argument used to create this object.
raw_se
the original input ipar_se
argument used to create this object.
If the argument was not supplied, this will be in the same structure with the ipar
argument but the item parameter values will be filled with 0s.
unique
the original input unique
argument used to create this object.
dataset_science
, dataset_reading
, dataset_fatigue
, dataset_bayes
for examples.
## Read from data.frame: itempool_science <- loadItemPool(itempool_science_data) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "itempool_science.csv") write.csv(itempool_science_data, f, row.names = FALSE) itempool_science <- loadItemPool(f) file.remove(f)
## Read from data.frame: itempool_science <- loadItemPool(itempool_science_data) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "itempool_science.csv") write.csv(itempool_science_data, f, row.names = FALSE) itempool_science <- loadItemPool(f) file.remove(f)
logitHyperPars
is a function for calculating parameters for a logit-normal distribution, such that the distribution yields desired mean and standard deviation.
Used for sampling the c-parameter.
logitHyperPars(mean, sd)
logitHyperPars(mean, sd)
mean |
the desired mean. |
sd |
the desired standard deviation. |
logitHyperPars
returns two values. These can be directly supplied to rlogitnorm
.
pars <- logitHyperPars(0.2, 0.1) x <- logitnorm::rlogitnorm(1000000, pars[1], pars[2]) mean(x) # close to 0.2 sd(x) # close to 0.1
pars <- logitHyperPars(0.2, 0.1) x <- logitnorm::rlogitnorm(1000000, pars[1], pars[2]) mean(x) # close to 0.2 sd(x) # close to 0.1
makeConstraintsByEachPartition
is a helper function for making
constraints
objects from Split
solution indices.
makeConstraintsByEachPartition(constraints, solution_per_bin)
makeConstraintsByEachPartition(constraints, solution_per_bin)
constraints |
a |
solution_per_bin |
a list containing item/stimulus indices for each partition.
This accepts a list stored in the |
makeConstraintsByEachPartition
returns a list of constraints
objects.
Create a item_pool_cluster
object.
item_pool_cluster1 == item_pool_cluster2
tests equality of two item_pool_cluster objects.
makeItemPoolCluster(x, ..., names = NULL) ## S4 method for signature 'item_pool' makeItemPoolCluster(x, ..., names = NULL) ## S3 method for class 'item_pool_cluster' item_pool_cluster1 == item_pool_cluster2
makeItemPoolCluster(x, ..., names = NULL) ## S4 method for signature 'item_pool' makeItemPoolCluster(x, ..., names = NULL) ## S3 method for class 'item_pool_cluster' item_pool_cluster1 == item_pool_cluster2
x , ...
|
|
names |
(optional) names to use for |
item_pool_cluster1 |
an |
item_pool_cluster2 |
an |
cluster <- makeItemPoolCluster(itempool_science, itempool_reading) cluster1 <- makeItemPoolCluster(itempool_science, itempool_reading) cluster2 <- makeItemPoolCluster(cluster1@pools[[1]], cluster1@pools[[2]]) cluster1 == cluster2 ## TRUE
cluster <- makeItemPoolCluster(itempool_science, itempool_reading) cluster1 <- makeItemPoolCluster(itempool_science, itempool_reading) cluster2 <- makeItemPoolCluster(cluster1@pools[[1]], cluster1@pools[[2]]) cluster1 == cluster2 ## TRUE
makeSimulationDataCache
is a function for creating a simulation_data_cache
object.
This is used in Shadow
to make all necessary data (e.g., item information, response data) prior to the main simulation.
makeSimulationDataCache( item_pool, info_type = "FISHER", theta_grid = seq(-4, 4, 0.1), seed = NULL, true_theta = NULL, response_data = NULL ) ## S4 method for signature 'item_pool' makeSimulationDataCache( item_pool, info_type = "FISHER", theta_grid = seq(-4, 4, 0.1), seed = NULL, true_theta = NULL, response_data = NULL )
makeSimulationDataCache( item_pool, info_type = "FISHER", theta_grid = seq(-4, 4, 0.1), seed = NULL, true_theta = NULL, response_data = NULL ) ## S4 method for signature 'item_pool' makeSimulationDataCache( item_pool, info_type = "FISHER", theta_grid = seq(-4, 4, 0.1), seed = NULL, true_theta = NULL, response_data = NULL )
item_pool |
an |
info_type |
the type of information. |
theta_grid |
a grid of theta values. |
seed |
(optional) seed to use for generating response data if needed. |
true_theta |
(optional) true theta values of all simulees. |
response_data |
(optional) response data on all items for all simulees. |
makeTest
is a function for creating a test
object.
This is used to make all necessary data (e.g., item information, response data) prior to the main simulation.
This function is only kept for backwards compatibility.
The functionality of this function is superseded by makeSimulationDataCache
.
makeTest( object, theta = seq(-4, 4, 0.1), info_type = "FISHER", true_theta = NULL ) ## S4 method for signature 'item_pool' makeTest( object, theta = seq(-4, 4, 0.1), info_type = "FISHER", true_theta = NULL )
makeTest( object, theta = seq(-4, 4, 0.1), info_type = "FISHER", true_theta = NULL ) ## S4 method for signature 'item_pool' makeTest( object, theta = seq(-4, 4, 0.1), info_type = "FISHER", true_theta = NULL )
object |
an |
theta |
a grid of theta values. |
info_type |
the type of information. |
true_theta |
(optional) true theta values to simulate response data. |
test <- makeTest(itempool_science, seq(-3, 3, 1))
test <- makeTest(itempool_science, seq(-3, 3, 1))
makeTestCluster
is a function for creating a test_cluster
object.
This is used to make all necessary data (e.g., item information, response data) prior to the main simulation.
This function is only kept for backwards compatibility.
makeTestCluster(object, theta, true_theta) ## S4 method for signature 'item_pool_cluster,numeric,numeric' makeTestCluster(object, theta, true_theta) ## S4 method for signature 'item_pool_cluster,numeric,list' makeTestCluster(object, theta, true_theta)
makeTestCluster(object, theta, true_theta) ## S4 method for signature 'item_pool_cluster,numeric,numeric' makeTestCluster(object, theta, true_theta) ## S4 method for signature 'item_pool_cluster,numeric,list' makeTestCluster(object, theta, true_theta)
object |
an |
theta |
a grid of theta values. |
true_theta |
an optional vector of true theta values to simulate response data. |
mle
is a function for computing maximum likelihood estimates of theta.
mle( object, select = NULL, resp, start_theta = NULL, max_iter = 100, crit = 0.001, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE ) ## S4 method for signature 'item_pool' mle( object, select = NULL, resp, start_theta = NULL, max_iter = 50, crit = 0.005, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE ) MLE( object, select = NULL, start_theta = NULL, max_iter = 100, crit = 0.001, theta_range = c(-4, 4), truncate = FALSE, max_change = 1, do_Fisher = TRUE ) ## S4 method for signature 'test' MLE( object, select = NULL, start_theta = NULL, max_iter = 100, crit = 0.001, theta_range = c(-4, 4), truncate = FALSE, max_change = 1, do_Fisher = TRUE ) ## S4 method for signature 'test_cluster' MLE(object, select = NULL, start_theta = NULL, max_iter = 100, crit = 0.001)
mle( object, select = NULL, resp, start_theta = NULL, max_iter = 100, crit = 0.001, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE ) ## S4 method for signature 'item_pool' mle( object, select = NULL, resp, start_theta = NULL, max_iter = 50, crit = 0.005, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE ) MLE( object, select = NULL, start_theta = NULL, max_iter = 100, crit = 0.001, theta_range = c(-4, 4), truncate = FALSE, max_change = 1, do_Fisher = TRUE ) ## S4 method for signature 'test' MLE( object, select = NULL, start_theta = NULL, max_iter = 100, crit = 0.001, theta_range = c(-4, 4), truncate = FALSE, max_change = 1, do_Fisher = TRUE ) ## S4 method for signature 'test_cluster' MLE(object, select = NULL, start_theta = NULL, max_iter = 100, crit = 0.001)
object |
an |
select |
(optional) if item indices are supplied, only the specified items are used. |
resp |
item response on all (or selected) items in the |
start_theta |
(optional) initial theta values. If not supplied, EAP estimates using uniform priors are used as initial values. Uniform priors are computed using the |
max_iter |
maximum number of iterations. (default = |
crit |
convergence criterion to use. (default = |
truncate |
set |
theta_range |
a range of theta values to bound the estimate. Only effective when |
max_change |
upper bound to impose on the absolute change in theta between iterations. Absolute changes exceeding this value will be capped to |
use_step_size |
set |
step_size |
upper bound to impose on the absolute change in initial theta and estimated theta. Absolute changes exceeding this value will be capped to |
do_Fisher |
set |
mle
returns a list containing estimated values.
th
theta value.
se
standard error.
conv
TRUE
if estimation converged.
trunc
TRUE
if truncation was applied on th
.
mle(itempool_fatigue, resp = resp_fatigue_data[10, ]) mle(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
mle(itempool_fatigue, resp = resp_fatigue_data[10, ]) mle(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
mlef
is a function for computing maximum likelihood estimates of theta using fence items.
mlef( object, select = NULL, resp, fence_slope = 5, fence_difficulty = c(-5, 5), start_theta = NULL, max_iter = 100, crit = 0.001, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE ) ## S4 method for signature 'item_pool' mlef( object, select = NULL, resp, fence_slope = 5, fence_difficulty = c(-5, 5), start_theta = NULL, max_iter = 50, crit = 0.005, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE )
mlef( object, select = NULL, resp, fence_slope = 5, fence_difficulty = c(-5, 5), start_theta = NULL, max_iter = 100, crit = 0.001, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE ) ## S4 method for signature 'item_pool' mlef( object, select = NULL, resp, fence_slope = 5, fence_difficulty = c(-5, 5), start_theta = NULL, max_iter = 50, crit = 0.005, truncate = FALSE, theta_range = c(-4, 4), max_change = 1, use_step_size = FALSE, step_size = 0.5, do_Fisher = TRUE )
object |
an |
select |
(optional) if item indices are supplied, only the specified items are used. |
resp |
item response on all (or selected) items in the |
fence_slope |
the slope parameter to use on fence items. Can be one value, or two values for the lower and the upper fence respectively. (default = |
fence_difficulty |
the difficulty parameter to use on fence items. Must have two values for the lower and the upper fence respectively. (default = |
start_theta |
(optional) initial theta values. If not supplied, EAP estimates using uniform priors are used as initial values. Uniform priors are computed using the |
max_iter |
maximum number of iterations. (default = |
crit |
convergence criterion to use. (default = |
truncate |
set |
theta_range |
a range of theta values to bound the estimate. Only effective when |
max_change |
upper bound to impose on the absolute change in theta between iterations. Absolute changes exceeding this value will be capped to |
use_step_size |
set |
step_size |
upper bound to impose on the absolute change in initial theta and estimated theta. Absolute changes exceeding this value will be capped to |
do_Fisher |
set |
mlef
returns a list containing estimated values.
th
theta value.
se
standard error.
conv
TRUE
if estimation converged.
trunc
TRUE
if truncation was applied on th
.
Han, K. T. (2016). Maximum likelihood score estimation method with fences for short-length tests and computerized adaptive tests. Applied Psychological Measurement, 40(4), 289-301.
mlef(itempool_fatigue, resp = resp_fatigue_data[10, ]) mlef(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
mlef(itempool_fatigue, resp = resp_fatigue_data[10, ]) mlef(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
output_Shadow_all
is an S4 class for representing a set of adaptive assembly solutions.
ni denotes the number of items in the item_pool
object.
ns denotes the number of stimuli.
nj denotes the number of participants.
call
the function call used for obtaining this object.
output
a length-*nj* list of output_Shadow
objects, containing the assembly results for each participant.
final_theta_est
a length-*nj* vector containing final theta estimates for each participant.
final_se_est
a length-*nj* vector standard errors of the final theta estimates for each participant.
exposure_rate
a matrix containing item-level exposure rates of all items in the pool. Also contains stimulus-level exposure rates if the assembly was set-based.
usage_matrix
a *nj* by (*ni* + *ns*) matrix representing whether the item/stimulus was administered to each participant. Stimuli representations are appended to the right side of the matrix.
cumulative_usage_matrix
a *nj* by (*ni* + *ns*) matrix representing the number of times the item/stimulus was administered to each participant over multiple administrations.
true_segment_count
a length-*nj* vector containing the how many examinees are now in their segment based on the true theta. This will tend to increase. This can be reproduced with true theta values alone.
est_segment_count
a length-*nj* vector containing the how many examinees are now in their segment based on the estimated theta. This will tend to increase. This can be reproduced with estimated theta values alone.
eligibility_stats
exposure record for diagnostics.
check_eligibility_stats
detailed segment-wise exposure record for diagnostics. available when config_Shadow@exposure_control$diagnostic_stats
is TRUE
.
no_fading_eligibility_stats
detailed segment-wise exposure record without fading for diagnostics. available when config_Shadow@exposure_control$diagnostic_stats
is TRUE
.
freq_infeasible
a table representing the number of times the assembly was initially infeasible.
pool
the item_pool
used in the assembly.
config
the config_Shadow
used in the assembly.
constraints
the constraints
used in the assembly.
true_theta
the true_theta
argument used in the assembly.
data
the data
argument used in the assembly.
prior
the prior
argument used in the assembly.
prior_par
the prior_par
argument used in the assembly.
adaptivity
a list of adaptivity indices.
simulation_constants
a list containing simulation constants parsed from input.
output_Shadow
is an S4 class for representing the adaptive assembly solution for one simulee.
simulee_id
the numeric ID of the simulee.
true_theta
the true theta of the simulee, if was specified.
true_theta_segment
the segment number of the true theta.
final_theta_est
final theta estimate.
final_se_est
the standard error of final_theta_est
.
administered_item_index
item IDs administered at each position.
administered_item_resp
item responses from the simulee at each position.
administered_item_ncat
the number of categories of each administered item.
administered_stimulus_index
stimulus IDs administered at each position.
shadow_test_refreshed
TRUE
indicates the shadowtest was refreshed for the position.
shadow_test_feasible
TRUE
indicates the MIP was feasible with all constraints.
solve_time
elapsed time in running the solver at each position.
initial_theta_est
initial theta estimate.
interim_theta_est
interim theta estimates at each position.
interim_se_est
the standard error of the interim estimate at each position.
theta_segment_index
segment numbers of interim theta estimates.
prior
prior distribution, if was specified.
prior_par
prior parameters, if were specified.
posterior
the posterior distribution after completing test.
posterior_sample
posterior samples of interim theta before the estimation of final theta. mean(posterior_sample) == interim_theta_est[test_length]
holds.
likelihood
the likelihood distribution after completing test.
shadow_test
the list containing the item IDs within the shadowtest used in each position.
max_cat_pool
the maximum number of response categories the item pool had.
ni_pool
the total number of items the item pool had.
ns_pool
the total number of stimuli the item pool had.
test_length_constraints
the test length constraint used in assembly.
set_based
whether the item pool was set-based.
item_index_by_stimulus
the list of items by each stimulus the item pool had.
output_Split
is an S4 class for representing the partitioning solution of an item pool.
call
the function call used for obtaining this object.
output
a list containing item/set indices of each partition.
feasible
for partitioning into sub-pools, TRUE
indicates the complete assignment problem was feasible.
solve_time
elapsed time in running the solver.
set_based
whether the item pool is set-based.
config
the config_Static
used in the assembly.
constraints
the constraints
used in the assembly.
partition_size_range
the partition size range for splitting into sub-pools.
partition_type
the partition type. Can be a test
or a pool
.
constraints_by_each_partition
a list of constraints
objects that represent each partition.
output_Static
is an S4 class for representing a fixed-form assembly solution.
call
the function call used for obtaining this object.
MIP
a list containing the result from MIP solver.
selected
a data.frame
containing the selected items and their attributes.
obj_value
the objective value of the solution.
solve_time
the elapsed time in running the solver.
achieved
a data.frame
containing attributes of the assembled test, by each constraint.
pool
the item_pool
used in the assembly.
config
the config_Static
used in the assembly.
constraints
the constraints
used in the assembly.
p_*()
and array_p_*()
are C++ functions for calculating item response probability.
p_1pl(x, b) p_2pl(x, a, b) p_m_2pl(x, a, d) p_3pl(x, a, b, c) p_m_3pl(x, a, d, c) p_pc(x, b) p_gpc(x, a, b) p_m_gpc(x, a, d) p_gr(x, a, b) p_m_gr(x, a, d) array_p_1pl(x, b) array_p_2pl(x, a, b) array_p_m_2pl(x, a, d) array_p_3pl(x, a, b, c) array_p_m_3pl(x, a, d, c) array_p_pc(x, b) array_p_gpc(x, a, b) array_p_m_gpc(x, a, d) array_p_gr(x, a, b) array_p_m_gr(x, a, d)
p_1pl(x, b) p_2pl(x, a, b) p_m_2pl(x, a, d) p_3pl(x, a, b, c) p_m_3pl(x, a, d, c) p_pc(x, b) p_gpc(x, a, b) p_m_gpc(x, a, d) p_gr(x, a, b) p_m_gr(x, a, d) array_p_1pl(x, b) array_p_2pl(x, a, b) array_p_m_2pl(x, a, d) array_p_3pl(x, a, b, c) array_p_m_3pl(x, a, d, c) array_p_pc(x, b) array_p_gpc(x, a, b) array_p_m_gpc(x, a, d) array_p_gr(x, a, b) array_p_m_gr(x, a, d)
x |
the theta value. The number of columns should correspond to the number of dimensions.
For |
b , d
|
the difficulty parameter. |
a |
the a-parameter. |
c |
the c-parameter. |
p_*()
functions accept a single theta value, and array_p_*()
functions accept multiple theta values.
Supports unidimensional and multidimensional models.
p_1pl()
, array_p_1pl()
: 1PL models
p_2pl()
, array_p_2pl()
: 2PL models
p_3pl()
, array_p_3pl()
: 3PL models
p_pc()
, array_p_pc()
: PC (partial credit) models
p_gpc()
, array_p_gpc()
: GPC (generalized partial credit) models
p_gr()
, array_p_gr()
: GR (graded response) models
p_m_2pl()
, array_p_m_2pl()
: multidimensional 2PL models
p_m_3pl()
, array_p_m_3pl()
: multidimensional 3PL models
p_m_gpc()
, array_p_m_gpc()
: multidimensional GPC models
p_m_gr()
, array_p_m_gr()
: multidimensional GR models
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
x <- 0.5 p_1pl(x, 1) p_2pl(x, 1, 2) p_3pl(x, 1, 2, 0.25) p_pc(x, c(0, 1)) p_gpc(x, 2, c(0, 1)) p_gr(x, 2, c(0, 2)) x <- matrix(seq(0.1, 0.5, 0.1)) # three theta values, unidimensional array_p_1pl(x, 1) array_p_2pl(x, 1, 2) array_p_3pl(x, 1, 2, 0.25) array_p_pc(x, c(0, 1)) array_p_gpc(x, 2, c(0, 1)) array_p_gr(x, 2, c(0, 2))
x <- 0.5 p_1pl(x, 1) p_2pl(x, 1, 2) p_3pl(x, 1, 2, 0.25) p_pc(x, c(0, 1)) p_gpc(x, 2, c(0, 1)) p_gr(x, 2, c(0, 2)) x <- matrix(seq(0.1, 0.5, 0.1)) # three theta values, unidimensional array_p_1pl(x, 1) array_p_2pl(x, 1, 2) array_p_3pl(x, 1, 2, 0.25) array_p_pc(x, c(0, 1)) array_p_gpc(x, 2, c(0, 1)) array_p_gr(x, 2, c(0, 2))
Extension of plot() for objects in TestDesign package
## S4 method for signature 'item_pool' plot( x, y, type = "info", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, theta_type = "Estimated", color_final = "blue", color_stim = "red", segment = NULL, rmse = FALSE, use_segment_label = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'output_Static' plot( x, y, type = NULL, theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'constraints' plot( x, y, type = "info", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'output_Shadow' plot( x, y, type = "audit", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = FALSE, theta_type = "Estimated", use_par = TRUE, ... ) ## S4 method for signature 'output_Shadow_all' plot( x, y, type = "audit", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = FALSE, theta_type = "Estimated", color_final = "blue", color_stim = "red", segment = NULL, rmse = FALSE, use_segment_label = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'output_Split' plot( x, y, type = NULL, theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, use_par = TRUE, ... )
## S4 method for signature 'item_pool' plot( x, y, type = "info", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, theta_type = "Estimated", color_final = "blue", color_stim = "red", segment = NULL, rmse = FALSE, use_segment_label = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'output_Static' plot( x, y, type = NULL, theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'constraints' plot( x, y, type = "info", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'output_Shadow' plot( x, y, type = "audit", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = FALSE, theta_type = "Estimated", use_par = TRUE, ... ) ## S4 method for signature 'output_Shadow_all' plot( x, y, type = "audit", theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = FALSE, theta_type = "Estimated", color_final = "blue", color_stim = "red", segment = NULL, rmse = FALSE, use_segment_label = TRUE, use_par = TRUE, ... ) ## S4 method for signature 'output_Split' plot( x, y, type = NULL, theta = seq(-3, 3, 0.1), info_type = "FISHER", plot_sum = TRUE, select = NULL, examinee_id = 1, position = NULL, theta_range = c(-5, 5), ylim = NULL, color = "blue", z_ci = 1.96, simple = TRUE, use_par = TRUE, ... )
x |
accepts the following signatures:
|
y |
not used, exists for compatibility with |
type |
the type of plot.
|
theta |
the theta grid to use in plotting. (default = |
info_type |
the type of information. Currently accepts |
plot_sum |
used in
|
select |
used in |
examinee_id |
used in |
position |
used in |
theta_range |
used in |
ylim |
(optional) the y-axis plot range. Used in most plot types. |
color |
the color of the curve. |
z_ci |
used in |
simple |
used in |
theta_type |
used in |
color_final |
used in |
color_stim |
used in |
segment |
used in |
rmse |
used in |
use_segment_label |
used in |
use_par |
if |
... |
arguments to pass onto |
subitempool <- itempool_science[1:8] ## Plot item information of a pool plot(subitempool) plot(itempool_science, select = 1:8) ## Plot expected score of a pool plot(subitempool, type = "score") plot(itempool_science, type = "score", select = 1:8) ## Plot assembly results from Static() cfg <- createStaticTestConfig() solution <- Static(cfg, constraints_science) plot(solution) # defaults to the objective type plot(solution, type = "score") # plot expected scores ## Plot attainable information range from constraints plot(constraints_science) ## Plot assembly results from Shadow() cfg <- createShadowTestConfig() set.seed(1) solution <- Shadow(cfg, constraints_science, true_theta = rnorm(1)) plot(solution, type = 'audit' , examinee_id = 1) plot(solution, type = 'shadow', examinee_id = 1, simple = TRUE) ## plot(solution, type = 'exposure') ## plot(solution, type = 'overlap')
subitempool <- itempool_science[1:8] ## Plot item information of a pool plot(subitempool) plot(itempool_science, select = 1:8) ## Plot expected score of a pool plot(subitempool, type = "score") plot(itempool_science, type = "score", select = 1:8) ## Plot assembly results from Static() cfg <- createStaticTestConfig() solution <- Static(cfg, constraints_science) plot(solution) # defaults to the objective type plot(solution, type = "score") # plot expected scores ## Plot attainable information range from constraints plot(constraints_science) ## Plot assembly results from Shadow() cfg <- createShadowTestConfig() set.seed(1) solution <- Shadow(cfg, constraints_science, true_theta = rnorm(1)) plot(solution, type = 'audit' , examinee_id = 1) plot(solution, type = 'shadow', examinee_id = 1, simple = TRUE) ## plot(solution, type = 'exposure') ## plot(solution, type = 'overlap')
Extension of print() for objects in TestDesign package
## S4 method for signature 'item_1PL' print(x) ## S4 method for signature 'item_2PL' print(x) ## S4 method for signature 'item_3PL' print(x) ## S4 method for signature 'item_PC' print(x) ## S4 method for signature 'item_GPC' print(x) ## S4 method for signature 'item_GR' print(x) ## S4 method for signature 'item_pool' print(x) ## S4 method for signature 'item_attrib' print(x) ## S4 method for signature 'st_attrib' print(x) ## S4 method for signature 'summary_item_attrib' print(x) ## S4 method for signature 'summary_st_attrib' print(x) ## S4 method for signature 'constraints' print(x) ## S4 method for signature 'config_Static' print(x) ## S4 method for signature 'config_Shadow' print(x) ## S4 method for signature 'output_Static' print(x, index_only = TRUE) ## S4 method for signature 'output_Shadow' print(x) ## S4 method for signature 'output_Shadow_all' print(x) ## S4 method for signature 'exposure_rate_plot' print(x) ## S4 method for signature 'summary_item_pool' print(x) ## S4 method for signature 'summary_constraints' print(x) ## S4 method for signature 'summary_output_Static' print(x, digits = 3) ## S4 method for signature 'summary_output_Shadow_all' print(x, digits = 3)
## S4 method for signature 'item_1PL' print(x) ## S4 method for signature 'item_2PL' print(x) ## S4 method for signature 'item_3PL' print(x) ## S4 method for signature 'item_PC' print(x) ## S4 method for signature 'item_GPC' print(x) ## S4 method for signature 'item_GR' print(x) ## S4 method for signature 'item_pool' print(x) ## S4 method for signature 'item_attrib' print(x) ## S4 method for signature 'st_attrib' print(x) ## S4 method for signature 'summary_item_attrib' print(x) ## S4 method for signature 'summary_st_attrib' print(x) ## S4 method for signature 'constraints' print(x) ## S4 method for signature 'config_Static' print(x) ## S4 method for signature 'config_Shadow' print(x) ## S4 method for signature 'output_Static' print(x, index_only = TRUE) ## S4 method for signature 'output_Shadow' print(x) ## S4 method for signature 'output_Shadow_all' print(x) ## S4 method for signature 'exposure_rate_plot' print(x) ## S4 method for signature 'summary_item_pool' print(x) ## S4 method for signature 'summary_constraints' print(x) ## S4 method for signature 'summary_output_Static' print(x, digits = 3) ## S4 method for signature 'summary_output_Shadow_all' print(x, digits = 3)
x |
an object to print. |
index_only |
if |
digits |
minimal number of *significant* digits. See |
Calculate Relative Errors.
RE(RMSE_foc, RMSE_ref)
RE(RMSE_foc, RMSE_ref)
RMSE_foc |
A vector of RMSE values for the focal group. |
RMSE_ref |
A vector of RMSE values for the reference group. |
Calculate Root Mean Squared Error.
RMSE(x, y, conditional = TRUE)
RMSE(x, y, conditional = TRUE)
x |
A vector of values. |
y |
A vector of values. |
conditional |
If |
Shadow
is a test assembly function for performing adaptive test assembly based on the generalized shadow-test framework.
Shadow( config, constraints = NULL, true_theta = NULL, data = NULL, prior = NULL, prior_par = NULL, exclude = NULL, include_items_for_estimation = NULL, force_solver = FALSE, session = NULL, seed = NULL, cumulative_usage_matrix = NULL ) ## S4 method for signature 'config_Shadow' Shadow( config, constraints = NULL, true_theta = NULL, data = NULL, prior = NULL, prior_par = NULL, exclude = NULL, include_items_for_estimation = NULL, force_solver = FALSE, session = NULL, seed = NULL, cumulative_usage_matrix = NULL )
Shadow( config, constraints = NULL, true_theta = NULL, data = NULL, prior = NULL, prior_par = NULL, exclude = NULL, include_items_for_estimation = NULL, force_solver = FALSE, session = NULL, seed = NULL, cumulative_usage_matrix = NULL ) ## S4 method for signature 'config_Shadow' Shadow( config, constraints = NULL, true_theta = NULL, data = NULL, prior = NULL, prior_par = NULL, exclude = NULL, include_items_for_estimation = NULL, force_solver = FALSE, session = NULL, seed = NULL, cumulative_usage_matrix = NULL )
config |
a |
constraints |
a |
true_theta |
(optional) true theta values to use in simulation. Either |
data |
(optional) a matrix containing item response data to use in simulation. Either |
prior |
(optional) density at each |
prior_par |
(optional) normal distribution parameters |
exclude |
(optional) a list containing item names in |
include_items_for_estimation |
(optional) an examinee-wise list containing:
|
force_solver |
if |
session |
(optional) used to communicate with Shiny app |
seed |
(optional) used to perform data generation internally. |
cumulative_usage_matrix |
(optional) a *nj* by (*ni* + *ns*) matrix containing the number of times the item/stimulus was administered previously to each participant. Stimuli representations are appended to the right side of the matrix. |
Shadow
returns an output_Shadow_all
object containing assembly results.
van der Linden, W. J., Reese, L. M. (1998). A model for optimal constrained adaptive testing. Applied Psychological Measurement, 22, 259-270.
van der Linden, W. J. (1998). Optimal assembly of psychological and educational tests. Applied Psychological Measurement, 22, 195-211.
van der Linden, W. J. (2000). Optimal assembly of tests with item sets. Applied Psychological Measurement, 24, 225-240.
van der Linden, W. J. (2005). Linear models for optimal test design. Springer Science & Business Media.
config <- createShadowTestConfig() true_theta <- rnorm(1) solution <- Shadow(config, constraints_science, true_theta) solution@output
config <- createShadowTestConfig() true_theta <- rnorm(1) solution <- Shadow(config, constraints_science, true_theta) solution@output
Extension of show() for objects in TestDesign package
## S4 method for signature 'item_1PL' show(object) ## S4 method for signature 'item_2PL' show(object) ## S4 method for signature 'item_3PL' show(object) ## S4 method for signature 'item_PC' show(object) ## S4 method for signature 'item_GPC' show(object) ## S4 method for signature 'item_GR' show(object) ## S4 method for signature 'item_pool' show(object) ## S4 method for signature 'item_pool_cluster' show(object) ## S4 method for signature 'item_attrib' show(object) ## S4 method for signature 'st_attrib' show(object) ## S4 method for signature 'constraints' show(object) ## S4 method for signature 'summary_item_pool' show(object) ## S4 method for signature 'summary_item_attrib' show(object) ## S4 method for signature 'summary_st_attrib' show(object) ## S4 method for signature 'summary_constraints' show(object) ## S4 method for signature 'config_Static' show(object) ## S4 method for signature 'config_Shadow' show(object) ## S4 method for signature 'output_Static' show(object) ## S4 method for signature 'output_Shadow' show(object) ## S4 method for signature 'output_Shadow_all' show(object) ## S4 method for signature 'summary_output_Static' show(object) ## S4 method for signature 'summary_output_Shadow_all' show(object) ## S4 method for signature 'exposure_rate_plot' show(object)
## S4 method for signature 'item_1PL' show(object) ## S4 method for signature 'item_2PL' show(object) ## S4 method for signature 'item_3PL' show(object) ## S4 method for signature 'item_PC' show(object) ## S4 method for signature 'item_GPC' show(object) ## S4 method for signature 'item_GR' show(object) ## S4 method for signature 'item_pool' show(object) ## S4 method for signature 'item_pool_cluster' show(object) ## S4 method for signature 'item_attrib' show(object) ## S4 method for signature 'st_attrib' show(object) ## S4 method for signature 'constraints' show(object) ## S4 method for signature 'summary_item_pool' show(object) ## S4 method for signature 'summary_item_attrib' show(object) ## S4 method for signature 'summary_st_attrib' show(object) ## S4 method for signature 'summary_constraints' show(object) ## S4 method for signature 'config_Static' show(object) ## S4 method for signature 'config_Shadow' show(object) ## S4 method for signature 'output_Static' show(object) ## S4 method for signature 'output_Shadow' show(object) ## S4 method for signature 'output_Shadow_all' show(object) ## S4 method for signature 'summary_output_Static' show(object) ## S4 method for signature 'summary_output_Shadow_all' show(object) ## S4 method for signature 'exposure_rate_plot' show(object)
object |
an object to display. |
simResp
is a function for simulating item response data.
simResp(object, theta) ## S4 method for signature 'item_1PL,numeric' simResp(object, theta) ## S4 method for signature 'item_1PL,matrix' simResp(object, theta) ## S4 method for signature 'item_2PL,numeric' simResp(object, theta) ## S4 method for signature 'item_2PL,matrix' simResp(object, theta) ## S4 method for signature 'item_3PL,numeric' simResp(object, theta) ## S4 method for signature 'item_3PL,matrix' simResp(object, theta) ## S4 method for signature 'item_PC,numeric' simResp(object, theta) ## S4 method for signature 'item_PC,matrix' simResp(object, theta) ## S4 method for signature 'item_GPC,numeric' simResp(object, theta) ## S4 method for signature 'item_GPC,matrix' simResp(object, theta) ## S4 method for signature 'item_GR,numeric' simResp(object, theta) ## S4 method for signature 'item_GR,matrix' simResp(object, theta) ## S4 method for signature 'item_pool,numeric' simResp(object, theta) ## S4 method for signature 'item_pool,matrix' simResp(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' simResp(object, theta) ## S4 method for signature 'item_pool_cluster,list' simResp(object, theta)
simResp(object, theta) ## S4 method for signature 'item_1PL,numeric' simResp(object, theta) ## S4 method for signature 'item_1PL,matrix' simResp(object, theta) ## S4 method for signature 'item_2PL,numeric' simResp(object, theta) ## S4 method for signature 'item_2PL,matrix' simResp(object, theta) ## S4 method for signature 'item_3PL,numeric' simResp(object, theta) ## S4 method for signature 'item_3PL,matrix' simResp(object, theta) ## S4 method for signature 'item_PC,numeric' simResp(object, theta) ## S4 method for signature 'item_PC,matrix' simResp(object, theta) ## S4 method for signature 'item_GPC,numeric' simResp(object, theta) ## S4 method for signature 'item_GPC,matrix' simResp(object, theta) ## S4 method for signature 'item_GR,numeric' simResp(object, theta) ## S4 method for signature 'item_GR,matrix' simResp(object, theta) ## S4 method for signature 'item_pool,numeric' simResp(object, theta) ## S4 method for signature 'item_pool,matrix' simResp(object, theta) ## S4 method for signature 'item_pool_cluster,numeric' simResp(object, theta) ## S4 method for signature 'item_pool_cluster,list' simResp(object, theta)
object |
|
theta |
theta values to use. |
nq denotes the number of theta values.
ni denotes the number of items in the item_pool
object.
item
object:simResp
returns a length nq vector containing simulated item response data.
item_pool
object:simResp
returns a (nq, ni) matrix containing simulated item response data.
Rasch, G. (1960). Probabilistic models for some intelligence and attainment tests. Copenhagen: Danish Institute for Educational Research.
Lord, F. M. (1952). A theory of test scores (Psychometric Monograph No. 7). Richmond, VA: Psychometric Corporation.
Birnbaum, A. (1957). Efficient design and use of tests of mental ability for various decision-making problems (Series Report No. 58-16. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). On the estimation of mental ability (Series Report No. 15. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1958). Further considerations of efficiency in tests of a mental ability (Series Report No. 17. Project No. 7755-23). Randolph Air Force Base, TX: USAF School of Aviation Medicine.
Birnbaum, A. (1968). Some latent trait models and their use in inferring an examinee's ability. In Lord, F. M., Novick, M. R. (eds.), Statistical Theories of Mental Test Scores, 397-479. Reading, MA: Addison-Wesley.
Masters, G. N. (1982). A Rasch model for partial credit scoring. Psychometrika, 47(2), 149-174.
Andrich, D. (1978). A rating formulation for ordered response categories. Psychometrika, 43(4), 561-573.
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159-176.
Samejima, F. (1969). Estimation of latent ability using a response pattern of graded scores. Psychometrika Monograph, 17.
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) sim_item_1 <- simResp(item_1, seq(-3, 3, 1)) sim_item_2 <- simResp(item_2, seq(-3, 3, 1)) sim_item_3 <- simResp(item_3, seq(-3, 3, 1)) sim_item_4 <- simResp(item_4, seq(-3, 3, 1)) sim_item_5 <- simResp(item_5, seq(-3, 3, 1)) sim_item_6 <- simResp(item_6, seq(-3, 3, 1)) sim_pool <- simResp(itempool_science, seq(-3, 3, 1))
item_1 <- new("item_1PL", difficulty = 0.5) item_2 <- new("item_2PL", slope = 1.0, difficulty = 0.5) item_3 <- new("item_3PL", slope = 1.0, difficulty = 0.5, guessing = 0.2) item_4 <- new("item_PC", threshold = c(-1, 0, 1), ncat = 4) item_5 <- new("item_GPC", slope = 1.2, threshold = c(-0.8, -1.0, 0.5), ncat = 4) item_6 <- new("item_GR", slope = 0.9, category = c(-1, 0, 1), ncat = 4) sim_item_1 <- simResp(item_1, seq(-3, 3, 1)) sim_item_2 <- simResp(item_2, seq(-3, 3, 1)) sim_item_3 <- simResp(item_3, seq(-3, 3, 1)) sim_item_4 <- simResp(item_4, seq(-3, 3, 1)) sim_item_5 <- simResp(item_5, seq(-3, 3, 1)) sim_item_6 <- simResp(item_6, seq(-3, 3, 1)) sim_pool <- simResp(itempool_science, seq(-3, 3, 1))
simulation_data_cache
is an S4 class for representing data cache for Shadow().
item_pool
the item_pool
object.
theta_grid
the theta grid to use as quadrature points.
prob_grid
the list containing item response probabilities at theta quadratures.
info_grid
the matrix containing item information values at theta quadratures.
max_info
the maximum value of info_grid
.
true_theta
(optional) the true theta values.
response_data
(optional) the matrix containing item responses.
Split
is a function for splitting a pool into multiple parallel tests or pools.
When constructing parallel tests, each test is constructed to satisfy all constraints.
When constructing parallel pools, each pool is constructed so that it contains a test that satisfies all constraints.
Split( config, constraints, n_partition, partition_type, partition_size_range = NULL, n_maximum_partitions_per_item = 1, force_solver = FALSE ) ## S4 method for signature 'config_Static' Split( config, constraints, n_partition, partition_type, partition_size_range = NULL, n_maximum_partitions_per_item = 1, force_solver = FALSE )
Split( config, constraints, n_partition, partition_type, partition_size_range = NULL, n_maximum_partitions_per_item = 1, force_solver = FALSE ) ## S4 method for signature 'config_Static' Split( config, constraints, n_partition, partition_type, partition_size_range = NULL, n_maximum_partitions_per_item = 1, force_solver = FALSE )
config |
a |
constraints |
a |
n_partition |
the number of partitions to create. |
partition_type |
|
partition_size_range |
(optional) two integer values for the desired range for the size of a partition. Has no effect when |
n_maximum_partitions_per_item |
(optional) the number of times an item can be assigned to a partition.
Setting this to 1 is equivalent to requiring all partitions to be mutually exclusive.
A caveat is that when this is equal to |
force_solver |
if |
Split
returns an output_Split
object containing item/set indices of created tests/pools.
## Not run: config <- createStaticTestConfig(MIP = list(solver = "RSYMPHONY")) constraints <- constraints_science[1:10] solution <- Split(config, constraints, n_partition = 4, partition_type = "test")) plot(solution) solution <- Split(config, constraints, n_partition = 4, partition_type = "pool")) plot(solution) ## End(Not run)
## Not run: config <- createStaticTestConfig(MIP = list(solver = "RSYMPHONY")) constraints <- constraints_science[1:10] solution <- Split(config, constraints, n_partition = 4, partition_type = "test")) plot(solution) solution <- Split(config, constraints, n_partition = 4, partition_type = "pool")) plot(solution) ## End(Not run)
loadStAttrib
is a data loading function for creating an st_attrib
object.
loadStAttrib
can read itemset-level attributes from a data.frame
or a .csv file.
loadStAttrib(object, item_attrib)
loadStAttrib(object, item_attrib)
object |
itemset-level attributes. Can be a |
item_attrib |
an |
loadStAttrib
returns a st_attrib
object.
data
a data.frame
containing itemset-level attributes.
dataset_reading
for examples.
## Read from data.frame: itempool_reading <- loadItemPool(itempool_reading_data) itemattrib_reading <- loadItemAttrib(itemattrib_reading_data, itempool_reading) stimattrib_reading <- loadStAttrib(stimattrib_reading_data, itemattrib_reading) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "stimattrib_reading.csv") write.csv(stimattrib_reading_data, f, row.names = FALSE) stimattrib_reading <- loadStAttrib(f, itemattrib_reading) file.remove(f)
## Read from data.frame: itempool_reading <- loadItemPool(itempool_reading_data) itemattrib_reading <- loadItemAttrib(itemattrib_reading_data, itempool_reading) stimattrib_reading <- loadStAttrib(stimattrib_reading_data, itemattrib_reading) ## Read from file: write to tempdir() for illustration and clean afterwards f <- file.path(tempdir(), "stimattrib_reading.csv") write.csv(stimattrib_reading_data, f, row.names = FALSE) stimattrib_reading <- loadStAttrib(f, itemattrib_reading) file.remove(f)
Basic functions for stimulus attribute objects
## S4 method for signature 'st_attrib,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'st_attrib' dim(x) ## S4 method for signature 'st_attrib' colnames(x) ## S4 method for signature 'st_attrib' rownames(x) ## S4 method for signature 'st_attrib' names(x) ## S4 method for signature 'st_attrib' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
## S4 method for signature 'st_attrib,numeric' x[i, j, ..., drop = TRUE] ## S4 method for signature 'st_attrib' dim(x) ## S4 method for signature 'st_attrib' colnames(x) ## S4 method for signature 'st_attrib' rownames(x) ## S4 method for signature 'st_attrib' names(x) ## S4 method for signature 'st_attrib' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
a |
i , j
|
indices to use in subsetting. |
... |
not used, exists for compatibility. |
drop |
not used, exists for compatibility. |
row.names |
not used, exists for compatibility. |
optional |
not used, exists for compatibility. |
x <- stimattrib_reading x[1:10] dim(x) ncol(x) nrow(x) colnames(x) rownames(x) names(x) as.data.frame(x)
x <- stimattrib_reading x[1:10] dim(x) ncol(x) nrow(x) colnames(x) rownames(x) names(x) as.data.frame(x)
Static
is a test assembly function for performing fixed-form test assembly based on the generalized shadow-test framework.
Static(config, constraints, force_solver = FALSE) ## S4 method for signature 'config_Static' Static(config, constraints, force_solver = FALSE)
Static(config, constraints, force_solver = FALSE) ## S4 method for signature 'config_Static' Static(config, constraints, force_solver = FALSE)
config |
a |
constraints |
a |
force_solver |
if |
Static
returns a output_Static
object containing the selected items.
van der Linden, W. J. (2005). Linear models for optimal test design. Springer Science & Business Media.
config_science <- createStaticTestConfig( list( method = "MAXINFO", target_location = c(-1, 1) ) ) solution <- Static(config_science, constraints_science)
config_science <- createStaticTestConfig( list( method = "MAXINFO", target_location = c(-1, 1) ) ) solution <- Static(config_science, constraints_science)
Extension of summary() for objects in TestDesign package
## S4 method for signature 'item_pool' summary(object) ## S4 method for signature 'item_attrib' summary(object) ## S4 method for signature 'st_attrib' summary(object) ## S4 method for signature 'constraints' summary(object) ## S4 method for signature 'output_Static' summary(object, simple = FALSE) ## S4 method for signature 'output_Shadow_all' summary(object, simple = FALSE)
## S4 method for signature 'item_pool' summary(object) ## S4 method for signature 'item_attrib' summary(object) ## S4 method for signature 'st_attrib' summary(object) ## S4 method for signature 'constraints' summary(object) ## S4 method for signature 'output_Static' summary(object, simple = FALSE) ## S4 method for signature 'output_Shadow_all' summary(object, simple = FALSE)
object |
an object to summarize. |
simple |
if |
summary(itempool_science) summary(itemattrib_science) cfg <- createStaticTestConfig() solution <- Static(cfg, constraints_science) summary(solution) summary(solution, simple = TRUE) cfg <- createShadowTestConfig() solution <- Shadow(cfg, constraints_science, true_theta = seq(-1, 1, 1)) summary(solution) summary(solution, simple = TRUE)
summary(itempool_science) summary(itemattrib_science) cfg <- createStaticTestConfig() solution <- Static(cfg, constraints_science) summary(solution) summary(solution, simple = TRUE) cfg <- createShadowTestConfig() solution <- Shadow(cfg, constraints_science, true_theta = seq(-1, 1, 1)) summary(solution) summary(solution, simple = TRUE)
test_cluster
is an S4 class for representing data cache for running simulations.
Despite the name, this class does not represent a series of tests and is not related to a series of tests. That is, test length is not stored in this class.
This class is only kept for backwards compatibility.
nt
the number of test
objects in this cluster.
tests
the list containing test
objects.
names
test ID strings for each test
object.
Create a subset of a test
object.
subsetTest(x, i = NULL) ## S4 method for signature 'test,ANY' x[i, j, ..., drop = TRUE]
subsetTest(x, i = NULL) ## S4 method for signature 'test,ANY' x[i, j, ..., drop = TRUE]
x |
a |
i |
item indices to use in subsetting. |
j , drop , ...
|
not used, exists for compatibility. |
test
is an S4 class for representing data cache for running simulations.
Despite the name, this class does not represent a test and is not related to a test. That is, test length is not stored in this class.
This class is only kept for backwards compatibility.
The functionality of this class is superseded by simulation_data_cache
.
pool
the item_pool
object.
theta
the theta grid to use as quadrature points.
prob
the list containing item response probabilities.
info
the matrix containing item information values.
true_theta
(optional) the true theta values.
data
(optional) the matrix containing item responses.
TestDesign
is a caller function for opening the Shiny interface of TestDesign package.
TestDesign()
TestDesign()
## Not run: if (interactive()) { TestDesign() } ## End(Not run)
## Not run: if (interactive()) { TestDesign() } ## End(Not run)
Test solver
testSolver(solver)
testSolver(solver)
solver |
a solver package name. Accepts |
empty string ""
if solver works. A string containing error messages otherwise.
theta_EAP()
and theta_EAP_matrix()
are functions for calculating a theta estimate using EAP (expected a posteriori) method.
theta_EAP(theta_grid, item_parm, resp, ncat, model, prior, prior_parm) theta_EAP_matrix(theta_grid, item_parm, resp, ncat, model, prior, prior_parm)
theta_EAP(theta_grid, item_parm, resp, ncat, model, prior, prior_parm) theta_EAP_matrix(theta_grid, item_parm, resp, ncat, model, prior, prior_parm)
theta_grid |
theta quadrature points. |
item_parm |
a matrix containing item parameters. |
resp |
responses on each item. Must be a vector for |
ncat |
a vector containing the number of response categories of each item. |
model |
a vector indicating item models of each item, using
|
prior |
an integer indicating the type of prior distribution, using
|
prior_parm |
a vector containing parameters for the prior distribution. |
theta_EAP()
and theta_EAP_matrix()
are designed for multiple items.
theta_EAP()
is designed for one examinee, and theta_EAP_matrix()
is designed for multiple examinees.
Currently supports unidimensional models.
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) # simulate response item_parm <- as.data.frame(item_parm) item_parm <- cbind(101:106, 1:6, item_parm) pool <- loadItemPool(item_parm) true_theta <- seq(-3, 3, 1) resp <- simResp(pool, true_theta) theta_grid <- matrix(seq(-3, 3, .1), , 1) theta_EAP(theta_grid, pool@ipar, resp[1, ], ncat, model, 1, c(1, 2)) theta_EAP_matrix(theta_grid, pool@ipar, resp, ncat, model, 1, c(1, 2))
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) # simulate response item_parm <- as.data.frame(item_parm) item_parm <- cbind(101:106, 1:6, item_parm) pool <- loadItemPool(item_parm) true_theta <- seq(-3, 3, 1) resp <- simResp(pool, true_theta) theta_grid <- matrix(seq(-3, 3, .1), , 1) theta_EAP(theta_grid, pool@ipar, resp[1, ], ncat, model, 1, c(1, 2)) theta_EAP_matrix(theta_grid, pool@ipar, resp, ncat, model, 1, c(1, 2))
theta_EB_single()
and theta_EB()
are functions for calculating a theta estimate using EB (Empirical Bayes) method.
theta_EB( nx, theta_init, theta_prop, item_parm, resp, ncat, model, prior, prior_parm ) theta_EB_single( nx, theta_init, theta_prop, item_parm, resp, ncat, model, prior, prior_parm )
theta_EB( nx, theta_init, theta_prop, item_parm, resp, ncat, model, prior, prior_parm ) theta_EB_single( nx, theta_init, theta_prop, item_parm, resp, ncat, model, prior, prior_parm )
nx |
the number of MCMC draws. |
theta_init |
the initial estimate to use. |
theta_prop |
the SD of the proposal distribution. |
item_parm |
a matrix containing item parameters. Each row should represent an item. |
resp |
a vector containing responses on each item. |
ncat |
a vector containing the number of response categories of each item. |
model |
a vector indicating item models of each item, using
|
prior |
an integer indicating the type of prior distribution, using
|
prior_parm |
a vector containing parameters for the prior distribution. |
theta_EB_single()
is designed for one item, and theta_EB()
is designed for multiple items.
Currently supports unidimensional models.
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) resp <- c(0, 1, 0, 1, 0, 1) nx <- 100 theta_init <- 0 theta_prop <- 1.0 set.seed(1) theta_EB_single(nx, theta_init, theta_prop, item_parm[1, ], resp[1], ncat[1], model[1], 1, c(0, 1)) theta_EB(nx, theta_init, theta_prop, item_parm, resp, ncat, model, 1, c(0, 1))
# item parameters item_parm <- matrix(c( 1, NA, NA, 1, 2, NA, 1, 2, 0.25, 0, 1, NA, 2, 0, 1, 2, 0, 2), nrow = 6, byrow = TRUE ) ncat <- c(2, 2, 2, 3, 3, 3) model <- c(1, 2, 3, 4, 5, 6) resp <- c(0, 1, 0, 1, 0, 1) nx <- 100 theta_init <- 0 theta_prop <- 1.0 set.seed(1) theta_EB_single(nx, theta_init, theta_prop, item_parm[1, ], resp[1], ncat[1], model[1], 1, c(0, 1)) theta_EB(nx, theta_init, theta_prop, item_parm, resp, ncat, model, 1, c(0, 1))
theta_FB_single()
and theta_FB()
are functions for calculating a theta estimate using FB (Full Bayes) method.
theta_FB( nx, theta_init, theta_prop, items_list, item_init, resp, ncat, model, prior, prior_parm ) theta_FB_single( nx, theta_init, theta_prop, item_mcmc, item_init, resp, ncat, model, prior, prior_parm )
theta_FB( nx, theta_init, theta_prop, items_list, item_init, resp, ncat, model, prior, prior_parm ) theta_FB_single( nx, theta_init, theta_prop, item_mcmc, item_init, resp, ncat, model, prior, prior_parm )
nx |
the number of MCMC draws. |
theta_init |
the initial estimate to use. |
theta_prop |
the SD of the proposal distribution. |
item_init |
item parameter estimates. Must be a vector for |
resp |
a vector containing responses on each item. |
ncat |
a vector containing the number of response categories of each item. |
model |
a vector indicating item models of each item, using
|
prior |
an integer indicating the type of prior distribution, using
|
prior_parm |
a vector containing parameters for the prior distribution. |
item_mcmc , items_list
|
sampled item parameters. Must be a matrix for |
theta_FB_single()
is designed for one item, and theta_FB()
is designed for multiple items.
Currently supports unidimensional models.
toggleConstraints
is a function for toggling individual constraints in a constraints
object.
toggleConstraints(object, on = NULL, off = NULL)
toggleConstraints(object, on = NULL, off = NULL)
object |
a |
on |
constraint indices to mark as active. Also accepts character IDs. |
off |
constraint indices to mark as inactive. Also accepts character IDs. |
toggleConstraints
returns the updated constraints
object.
constraints_science2 <- toggleConstraints(constraints_science, off = 32:36) constraints_science3 <- toggleConstraints(constraints_science2, on = 32:36) constraints_science4 <- toggleConstraints(constraints_science, off = "C32")
constraints_science2 <- toggleConstraints(constraints_science, off = 32:36) constraints_science3 <- toggleConstraints(constraints_science2, on = 32:36) constraints_science4 <- toggleConstraints(constraints_science, off = "C32")