| Type: | Package |
| Title: | Optimal Test Design Approach to Fixed and Adaptive Test Construction |
| Version: | 1.7.0 |
| Maintainer: | Seung W. Choi <schoi@austin.utexas.edu> |
| 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/. |
| URL: | https://choi-phd.github.io/TestDesign/ (documentation) |
| BugReports: | https://github.com/choi-phd/TestDesign/issues/ |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Depends: | R (≥ 4.0) |
| Imports: | Rcpp (≥ 1.0.0), methods, lpSolve, foreach, logitnorm, crayon |
| SystemRequirements: | C++17 |
| Suggests: | Rsymphony, highs, gurobi, Rglpk, mirt, mirtCAT, progress, shiny, shinythemes, shinyWidgets, shinyjs, DT, knitr, rmarkdown, kableExtra, testthat (≥ 2.1.0), pkgdown, pkgload |
| LinkingTo: | Rcpp, RcppArmadillo |
| RoxygenNote: | 7.3.2 |
| Encoding: | UTF-8 |
| LazyData: | true |
| VignetteBuilder: | knitr |
| Collate: | 'RcppExports.R' 'import.R' 'extensions.R' 'item_class.R' 'calc_prob_functions.r' 'calc_escore_functions.r' 'calc_location_functions.r' 'calc_fisher_functions.r' 'calc_loglikelihood_functions.r' 'calc_jacobian_functions.r' 'calc_hessian_functions.r' 'sim_resp_functions.r' 'loading_functions.R' 'static_class.R' 'shadow_class.R' 'item_pool_operators.R' 'item_attrib_operators.R' 'st_attrib_operators.R' 'constraints_operators.R' 'static_functions.R' 'shadow_functions.R' 'bayes_functions.R' 'calculate_adaptivity_measures.r' 'constraint_functions.R' 'cpp_calc_documents.r' 'cpp_core_documents.r' 'cpp_theta_documents.r' 'datasets.R' 'eligibility_functions.R' 'exposure_control_functions.R' 'solver_functions.R' 'helper_functions.R' 'item_pool_cluster_operators.R' 'other_functions.R' 'partitioning_class.r' 'partitioning_functions.r' 'plot_functions.R' 'summary_class.R' 'print_functions.R' 'runshiny.R' 'shadowtest_functions.R' 'summary_functions.R' 'show_functions.R' 'simulation_data_cache_class.r' 'simulation_data_cache_operators.r' 'theta_functions.R' 'xdata_functions.R' |
| NeedsCompilation: | yes |
| Packaged: | 2024-08-22 02:27:15 UTC; chois1 |
| Author: | Seung W. Choi |
| Repository: | CRAN |
| Date/Publication: | 2024-08-22 10:50:02 UTC |
(Internal) Package startup functions
Description
.onAttach is an internal function called when the package is first loaded.
Usage
.onAttach(libname, pkgname)
Arguments
libname, pkgname |
not used; only defined for compatibility. |
Value
.onAttach does not return anything.
Calculate Relative Errors
Description
Calculate Relative Errors.
Usage
RE(RMSE_foc, RMSE_ref)
Arguments
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
Description
Calculate Root Mean Squared Error.
Usage
RMSE(x, y, conditional = TRUE)
Arguments
x |
A vector of values. |
y |
A vector of values. |
conditional |
If |
Run adaptive test assembly
Description
Shadow is a test assembly function for performing adaptive test assembly based on the generalized shadow-test framework.
Usage
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
)
Arguments
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. |
Value
Shadow returns an output_Shadow_all object containing assembly results.
References
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.
Examples
config <- createShadowTestConfig()
true_theta <- rnorm(1)
solution <- Shadow(config, constraints_science, true_theta)
solution@output
Split an item pool into partitions
Description
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.
Usage
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
)
Arguments
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 |
Value
Split returns an output_Split object containing item/set indices of created tests/pools.
Examples
## 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)
Run fixed-form test assembly
Description
Static is a test assembly function for performing fixed-form test assembly based on the generalized shadow-test framework.
Usage
Static(config, constraints, force_solver = FALSE)
## S4 method for signature 'config_Static'
Static(config, constraints, force_solver = FALSE)
Arguments
config |
a |
constraints |
a |
force_solver |
if |
Value
Static returns a output_Static object containing the selected items.
References
van der Linden, W. J. (2005). Linear models for optimal test design. Springer Science & Business Media.
Examples
config_science <- createStaticTestConfig(
list(
method = "MAXINFO",
target_location = c(-1, 1)
)
)
solution <- Static(config_science, constraints_science)
Open TestDesign app
Description
TestDesign is a caller function for opening the Shiny interface of TestDesign package.
Usage
TestDesign()
Examples
## Not run:
if (interactive()) {
TestDesign()
}
## End(Not run)
Calculate alpha angles from a-parameters
Description
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.
Usage
a_to_alpha(a)
Arguments
a |
the a-parameter vector. |
Examples
a_to_alpha(c(1, 1))
(Internal) Count number of pool items that match a constraint
Description
addCountsToConstraintData is an internal function for
counting the number of items in the pool that match a constraint.
Usage
addCountsToConstraintData(x, attrib)
Arguments
x |
a |
attrib |
an |
Value
addCountsToConstraintData returns an updated data.frame.
(Internal) Sum scores of items in a solution that match a constraint
Description
addScoreToConstraintData is an internal function for
summing the score of items in a solution that match a constraint.
Usage
addScoreToConstraintData(x, attrib, item_idx, item_resp, item_ncat)
Arguments
x |
a |
attrib |
an |
item_idx |
item indices in the solution. |
item_resp |
scores of items in the solution. |
item_ncat |
number of score categories of items in the solution. |
Value
addScoreToConstraintData returns an updated data.frame.
(Internal) Count number of items in a solution that match a constraint
Description
addSolutionToConstraintData is an internal function for
counting the number of items in a solution that match a constraint.
Usage
addSolutionToConstraintData(x, attrib, item_idx, all_values)
Arguments
x |
a |
attrib |
an |
item_idx |
item indices in the solution. |
all_values |
for set-based assembly,
|
Value
addSolutionToConstraintData returns an updated data.frame.
(Internal) Apply spike-reduction mechanism on exposure rates
Description
adjustAlphaToReduceSpike is an internal function for
applying spike-reduction mechanism on exposure rates.
Usage
adjustAlphaToReduceSpike(
exposure_record,
segment_prob_of_final_theta,
segments_visited,
eligibility_flag_in_final_theta_segment,
x,
simulation_constants
)
Arguments
exposure_record |
a named list containing exposure records. |
segment_prob_of_final_theta |
the certainty that the final theta estimate
belongs in the segment for the final theta estimate. This is |
segments_visited |
visited segments. This means a set of all segments that all interim theta estimates for this examinee belonged to. The segment that the final theta estimate belonged to is not considered a visited segment. |
eligibility_flag_in_final_theta_segment |
a named list containing eligibility flags in the segment the final theta estimate belongs to. |
x |
an |
simulation_constants |
a named list containing simulation constants. |
Value
clipEligibilityRates returns an updated exposure record.
(Internal) Aggregate item usage matrix into exposure rate table
Description
aggregateUsageMatrix is an internal function for
aggregating item usage matrix into an exposure rate table.
Usage
aggregateUsageMatrix(usage_matrix, simulation_constants, constraints)
Arguments
usage_matrix |
a (nj, nv) matrix containing item usage. |
simulation_constants |
a named list containing simulation constants. |
constraints |
a |
Value
aggregateUsageMatrix returns a data.frame containing exposure rates.
Open TestDesign app
Description
app and OAT are aliases of TestDesign.
Usage
app()
OAT()
Details
TestDesign is a caller function for opening the Shiny interface of TestDesign package.
Examples
## Not run:
if (interactive()) {
TestDesign()
}
## End(Not run)
(Internal) Append mean information to shadowtest
Description
(Internal) Append mean information to shadowtest
Usage
appendMeanInfo(shadow_test, v, mean_info_name)
Arguments
shadow_test |
a |
v |
the column name to use as grouping variable. |
mean_info_name |
the column name to use for appending mean information. |
Value
appendMeanInfo returns an updated shadowtest.
(Internal) Modify item information using eligibility constraints
Description
applyEligibilityConstraintsToInfo is an internal function for modifying item information using eligibility constraints.
This is known as the big M method.
The function penalizes item information of items that are marked as ineligibile.
This leads to those items being deterred from selected in shadowtest assembly, unless necessary.
Usage
applyEligibilityConstraintsToInfo(
info,
eligibility_flag_in_current_theta_segment,
config,
simulation_constants
)
Arguments
info |
a length-ni vector containing item information on each item, intended for shadow-test assembly. |
eligibility_flag_in_current_theta_segment |
a list containing eligibility flags for the current theta segment. |
config |
a |
simulation_constants |
a named list containing simulation constants. |
Value
applyEligibilityConstraintsToInfo returns an updated item information vector.
(Internal) Augment constraint matrix-data with eligibility constraints
Description
applyEligibilityConstraintsToXdata is an internal function for augmenting constraint matrix-data with eligibility constraints.
The function marks items/sets marked as ineligibile to be formally excluded in the constraint matrix-data.
Usage
applyEligibilityConstraintsToXdata(
xdata,
eligibility_flag_in_current_theta_segment,
simulation_constants,
constraints
)
Arguments
xdata |
the constriant matrix-data. |
eligibility_flag_in_current_theta_segment |
a list containing eligibility flags for the current theta segment. |
simulation_constants |
a named list containing simulation constants. |
constraints |
a |
Value
applyEligibilityConstraintsToXdata returns an updated constriant matrix-data.
(Internal) Apply fading to exposure record
Description
applyFading is an internal function for applying fading to exposure record.
Specifically, the following exposure records are multiplied by fading_factor:
n_k: the number of examinees completed the test so far, at each segment k.f_k:a_ik: the number of times each item i was administered to examinees, at each segment kr_ik:
Usage
applyFading(exposure_record, segments_to_apply, simulation_constants)
Arguments
exposure_record |
a named list containing exposure records. |
segments_to_apply |
which segments to apply fading to. |
simulation_constants |
a named list containing simulation constants. |
Value
applyFading returns an updated exposure record.
(Internal) Modify item information using overlap constraints
Description
applyOverlapConstraintsToInfo is an internal function for modifying item information using eligibility constraints.
This is known as the big M method.
The function penalizes item information of items that have been administered previously (within examinees).
This leads to those items being deterred from selected in shadowtest assembly, unless necessary.
Usage
applyOverlapConstraintsToInfo(info, usage_flag, config, simulation_constants)
Arguments
info |
a length-ni vector containing item information on each item, intended for shadow-test assembly. |
usage_flag |
a length-ni vector containing how many times each item has been administered previously to the examinee. |
config |
a config object. |
simulation_constants |
a named list containing simulation constants. |
Value
applyEligibilityConstraintsToInfo returns an updated item information vector.
(Internal) Apply shrinkage correction to theta estimate
Description
applyShrinkageCorrection is an internal function for applying shrinkage correction to a theta estimate.
Usage
applyShrinkageCorrection(EAP, config_theta, j)
Arguments
EAP |
a named list containing an EAP theta estimate. |
config_theta |
a list containing theta estimation configurations. |
j |
the examinee index. Used to parse the prior SD from the config. |
Value
applyShrinkageCorrection returns an updated list containing corrected EAP theta estimate.
(Internal) Thin a MCMC chain
Description
applyThin is an internal function for
thinning a Markov chain. Burn-in is also applied.
Usage
applyThin(posterior_sample, bayesian_constants)
Arguments
posterior_sample |
a vector containing values in a Markov chain. |
bayesian_constants |
a named list containing Bayesian constants. |
Value
applyThin returns an updated Markov chain.
(Internal) Assemble a shadowtest
Description
(Internal) Assemble a shadowtest
Usage
assembleShadowTest(
j,
position,
o,
eligibility_flag,
exclude_flag,
usage_flag,
groupings_record,
info,
config,
simulation_constants,
constraints
)
Arguments
j |
the examinee index. |
position |
the item position, ranging from 1 to test length. |
o |
|
eligibility_flag |
a named list containing eligibility flags. |
exclude_flag |
a list of item/stimulus indices to exclude from selection for the examinee. |
usage_flag |
a vector of length ni (or ni + ns) containing the number of times each item has been administered previously to the examinee. |
groupings_record |
a list containing data on completed item sets. |
info |
a vector containing item information of each item in the pool. |
config |
a |
simulation_constants |
a named list containing simulation constants. |
constraints |
a |
Value
a named list containing a shadowtest and related data.
shadow_testadata.framecontaining the shadowtest.feasiblewhether the assembly was feasible the first time.
(Internal) Determine if shadowtest assembly was feasible for exposure control purposes
Description
assemblyInFinalThetaSegmentWasFeasibleAtLeastOnceInInterimThetaSegments
is an internal function for determining if shadowtest assembly was feasible for exposure control purposes.
Specifically, for the segment k the final theta estimate belonged to,
it returns TRUE if shadowtest assembly was feasible at any interim theta that also belonged to k,
and returns FALSE otherwise.
Usage
assemblyInFinalThetaSegmentWasFeasibleAtLeastOnceInInterimThetaSegments(
x,
final_theta_segment
)
Arguments
x |
an |
final_theta_segment |
the segment the final theta estimate belonged to. |
Details
Example 1:
Interim theta segments are
1, 2, 3, 4, 5, 1, 2, 3, 4, 5Shadowtest feasibility are
1, 1, 1, 0, 0, 1, 0, 0, 0, 0Final theta estimate is in segment
3From the two vectors, segments where shadowtest assembly was feasible:
1, 2, 3, 1Final theta segment
3is an element of the above vector. ReturnTRUE
Example 2:
Interim theta segments are
1, 2, 3, 4, 5, 1, 2, 3, 4, 5Shadowtest feasibility are
1, 1, 1, 0, 0, 1, 0, 0, 0, 0Final theta estimate is in segment
4From the two vectors, segments where shadowtest assembly was feasible:
1, 2, 3, 1Final theta segment
4is not an element of the above vector. ReturnFALSE
Value
assemblyInFinalThetaSegmentWasFeasibleAtLeastOnceInInterimThetaSegments
returns TRUE or FALSE.
Build constraints (shortcut to other loading functions)
Description
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").
Usage
buildConstraints(object, item_pool, item_attrib, st_attrib = NULL)
Arguments
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 |
Value
buildConstraints returns a constraints object. This object is used in Static and Shadow.
Examples
## 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)
Calculate expected scores
Description
calcEscore is a function for calculating expected scores.
Usage
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)
Arguments
object |
|
theta |
theta values to use. |
Value
itemobject:calcEscorea vector containing expected score of the item at the theta values.item_poolobject:calcEscorereturns a vector containing the pool-level expected score at the theta values.
References
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.
Examples
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))
Calculate Fisher information
Description
calcFisher is a function for calculating Fisher information.
Usage
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)
Arguments
object |
|
theta |
theta values to use. |
Value
itemobject:calcFisherreturns a (nq, 1) matrix of information values.item_poolobject:calcProbreturns a (nq, ni) matrix of information values.
- notations
-
nq denotes the number of theta values.
ni denotes the number of items in the
item_poolobject.
References
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.
Examples
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))
Calculate second derivative of log-likelihood
Description
calcHessian is a function for calculating the second derivative of the log-likelihood function.
Usage
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)
Arguments
object |
|
theta |
theta values to use. |
resp |
the response data to use. This must be a single value for an |
Details
- notations
-
nq denotes the number of theta values.
ni denotes the number of items in the
item_poolobject.
Value
itemobject:calcHessianreturns a length nq vector containing the second derivative of the log-likelihood function, of observing the response at each theta.item_poolobject:calcHessianreturns a (nq, ni) matrix containing the second derivative of the log-likelihood function, of observing the response at each theta.
References
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.
Examples
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)
)
Calculate first derivative of log-likelihood
Description
calcJacobian is a function for calculating the first derivative of the log-likelihood function.
Usage
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)
Arguments
object |
|
theta |
theta values to use. |
resp |
the response value to use for each item. |
Value
itemobject:calcJacobianreturns a length nq vector containing the first derivative of the log-likelihood function, of observing the response at each theta.item_poolobject:calcJacobianreturns a (nq, ni) matrix containing the first derivative of the log-likelihood function, of observing the response at each theta.
- notations
-
nq denotes the number of theta values.
ni denotes the number of items in the
item_poolobject.
References
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.
Examples
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)
)
Calculate central location (overall difficulty)
Description
calcLocation is a function for calculating the central location (overall difficulty) of items.
Usage
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)
Arguments
object |
Value
itemobject:calcLocationreturns a theta value representing the central location.item_poolobject:calcProbreturns a length ni list, each containing the central location of the item.
- notations
-
ni denotes the number of items in the
item_poolobject.
References
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.
Examples
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)
Calculate log-likelihood
Description
calcLogLikelihood is a function for calculating log-likelihood values.
Usage
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)
Arguments
object |
an |
theta |
theta values to use. |
resp |
the response data to use. |
Value
calcLogLikelihood returns values of log-likelihoods.
References
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.
Examples
j_pool <- calcLogLikelihood(itempool_science, seq(-3, 3, 1), 0)
Calculate item response probabilities
Description
calcProb is a function for calculating item response probabilities.
Usage
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)
Arguments
object |
|
theta |
theta values to use. |
Value
itemobject:calcProbreturns a (nq, ncat) matrix of probability values.item_poolobject:calcProbreturns a length ni list, each containing a matrix of probability values.
- notations
-
nq denotes the number of theta values.
ncat denotes the number of response categories.
ni denotes the number of items in the
item_poolobject.
References
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.
Examples
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))
Calculate the mutual information using full Bayesian
Description
Calculate the mutual information using full Bayesian.
Usage
calc_MI_FB(x, items_list, ncat, model)
Arguments
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). |
(C++) For multiple items, calculate Fisher information
Description
calc_info() and calc_info_matrix() are functions for calculating Fisher information.
These functions are designed for multiple items.
Usage
calc_info(x, item_parm, ncat, model)
calc_info_matrix(x, item_parm, ncat, model)
Arguments
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
|
Details
calc_info() accepts a single theta value, and calc_info_matrix() accepts multiple theta values.
Currently supports unidimensional models.
References
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.
Examples
# 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
Description
Calculate the Fisher information using empirical Bayes.
Usage
calc_info_EB(x, item_parm, ncat, model)
Arguments
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
Description
Calculate the Fisher information using full Bayesian.
Usage
calc_info_FB(x, items_list, ncat, model, useEAP = FALSE)
Arguments
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 |
|
(C++) For multiple items, calculate likelihoods
Description
calc_likelihood() and calc_likelihood_function() are functions for calculating likelihoods.
Usage
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
)
Arguments
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. |
Details
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.
References
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.
Examples
# 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 a posterior value of theta
Description
Calculate a posterior value of theta.
Usage
calc_posterior(x, item_parm, resp, ncat, model, prior, prior_parm)
Arguments
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
Description
Calculate a posterior distribution of theta.
Usage
calc_posterior_function(
theta_grid,
item_parm,
resp,
ncat,
model,
prior,
prior_parm
)
Arguments
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
Description
Calculate a posterior value of theta for a single item.
Usage
calc_posterior_single(x, item_parm, resp, ncat, model, prior, prior_parm)
Arguments
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). |
Calculate Adaptivity Measures
Description
calculateAdaptivityMeasures is a function for
calculating commonly used adaptivity measures.
Usage
calculateAdaptivityMeasures(x)
Arguments
x |
an |
Value
calculateAdaptivityMeasures returns a named list:
corrthe correlation between final theta estimates and average test locations.ratiothe ratio of (1) standard deviation of average test locations, versus (2) standard deviation of final theta estimates.PRVthe 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
Description
Check the consistency of constraints and item usage.
Usage
checkConstraints(constraints, usage_matrix, true_theta = NULL)
Arguments
constraints |
A |
usage_matrix |
A matrix of item usage data from |
true_theta |
A vector of true theta values. |
(Internal) Clip eligibility rates into 0-1 bounds
Description
clipEligibilityRates is an internal function for
processing eligibility rate updates.
Usage
clipEligibilityRates(exposure_record, simulation_constants)
Arguments
exposure_record |
a named list containing exposure records. |
simulation_constants |
a named list containing simulation constants. |
Value
clipEligibilityRates returns an updated exposure record.
(Internal) Combine constraints data
Description
combineConstraintsData is an internal function for combining constraints data.
Columns that exist on only one side are filled in with NA values.
Usage
combineConstraintsData(raw1, raw2)
Arguments
raw1, raw2 |
a |
Value
combineConstraintsData returns a data.frame containing the combined constraints data.
This can be supplied to loadConstraints.
(Internal) Combine item pool data
Description
combineItemPoolData is an internal function for combining item pool data.
Columns that exist on only one side are filled in with NA values.
Usage
combineItemPoolData(raw1, raw2, unique)
Arguments
raw1, raw2 |
a |
unique |
if |
Value
combineItemPoolData returns a data.frame containing the combined item pool data.
This can be supplied to loadItemPool.
(Internal) Combine two constraint matrix-data
Description
(Internal) Combine two constraint matrix-data
Usage
combineXdata(x1, x2)
Arguments
x1, x2 |
a named list containing constraint matrix-data |
Value
combineXdata returns
the combined constraint matrix-data.
(Internal) Convert posterior densities into an EAP estimate
Description
computeEAPFromPosterior is an internal function for converting posterior densities into an EAP estimate.
Usage
computeEAPFromPosterior(posterior, theta_grid)
Arguments
posterior |
a named list posterior densities and likelihoods. |
theta_grid |
a vector containing quadrature points corresponding to the above. |
Value
computeEAPFromPosterior returns a named list containing an EAP theta estimate.
(Internal) Compute item information at current theta estimate
Description
computeInfoAtCurrentTheta is an internal function for
computing item information at current theta estimate.
Usage
computeInfoAtCurrentTheta(
item_selection,
j,
current_theta,
item_pool,
model_code,
info_fixed_theta,
info_grid,
item_parameter_sample
)
Arguments
item_selection |
the |
j |
the examinee index. |
current_theta |
a named list containing current theta estimate. |
item_pool |
an |
model_code |
machine-sanitized item model codes for passing onto C++ functions. |
info_fixed_theta |
a list containing item information at prespecified theta points. |
info_grid |
a matrix containing item information across quadrature points. |
item_parameter_sample |
a list containing item parameter samples for Bayesian estimation. |
Create a config_Shadow object
Description
createShadowTestConfig is a config function for creating a config_Shadow object for shadowtest assembly.
Default values are used for any unspecified parameters/slots.
Usage
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)
)
Arguments
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. |
Examples
cfg1 <- createShadowTestConfig(refresh_policy = list(
method = "STIMULUS"
))
cfg2 <- createShadowTestConfig(refresh_policy = list(
method = "POSITION",
position = c(1, 5, 9)
))
Create a config_Static object
Description
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.
Usage
createStaticTestConfig(item_selection = NULL, MIP = NULL)
Arguments
item_selection |
a named list containing item selection criteria.
|
MIP |
a named list containing solver options.
|
Value
createStaticTestConfig returns a config_Static object. This object is used in Static.
Examples
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)
)
)
Class 'constraint': a single constraint
Description
constraint is an S4 class for representing a single constraint.
Slots
constraintthe numeric index of the constraint.
constraint_idthe character ID of the constraint.
ncthe number of MIP-format constraints translated from this constraint.
mat,dir,rhsthese represent MIP-format constraints. A single MIP-format constraint is associated with a row in
mat, a value inrhs, and a value indir.the i-th row of
matrepresents LHS coefficients to use on decision variables in the i-th MIP-format constraint.the i-th value of
rhsrepresents RHS values to use in the i-th MIP-format constraint.the i-th value of
dirrepresents the imposed constraint between LHS and RHS.
suspendTRUEif the constraint is not to be imposed.
Class 'constraints': a set of constraints
Description
constraints is an S4 class for representing a set of constraints and its associated objects.
Details
See constraints-operators for object manipulation functions.
Slots
constraintsa
data.framecontaining the constraint specifications.list_constraintsa list containing the
constraintobject representation of each constraint.poolthe
item_poolobject associated with the constraints.item_attribthe
item_attribobject associated with the constraints.st_attribthe
st_attribobject associated with the constraints.test_lengththe test length specified in the constraints.
nvthe number of decision variables. Equals
ni + ns.nithe number of items to search from.
nsthe number of stimulus to search from.
idthe item/stimulus ID string of each item/stimulus.
index,mat,dir,rhsthese represent MIP-format constraints. A single MIP-format constraint is associated with a value in
index, a row inmat, a value inrhs, and a value indir.the i-th value of
indexrepresents which constraint specification in theconstraintsargument it was translated from.the i-th row of
matrepresents LHS coefficients to use on decision variables in the i-th MIP-format constraint.the i-th value of
rhsrepresents RHS values to use in the i-th MIP-format constraint.the i-th value of
dirrepresents the imposed constraint between LHS and RHS.
set_basedTRUEif the constraint is set-based.FALSEotherwise.item_orderthe item attribute of each item to use in imposing an item order constraint, if any.
item_order_bythe name of the item attribute to use in imposing an item order constraint, if any.
stim_orderthe stimulus attribute of each stimulus to use in imposing a stimulus order constraint, if any.
stim_order_bythe name of the stimulus attribute to use in imposing a stimulus order constraint, if any.
item_index_by_stimulusa list containing item indices of each stimulus.
stimulus_index_by_itemthe stimulus indices of each item.
Basic operators for constraints objects
Description
Create a subset of a constraints object:
constraints[i]subsetConstraints(constraints, 1:10)
Combine two constraints objects:
c(constraints1, constraints2)combineConstraints(constraints1, constraints2)
Usage
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, ...)
Arguments
x, x1, x2 |
a |
i, j |
indices to use in subsetting. |
... |
not used, exists for compatibility. |
drop |
not used, exists for compatibility. |
Examples
c1 <- constraints_science
c2 <- c1[1:10]
c3 <- c1[c(1, 11:36)] # keep constraint 1 for test length
c4 <- c(c2, c3)
Bayes dataset
Description
Item-based example item pool with standard errors (320 items).
Details
This pool is associated with the following objects:
-
itempool_bayesanitem_poolobject containing 320 items. -
itemattrib_bayesaitem_attribobject containing 5 item-level attributes. -
constraints_bayesaconstraintsobject containing 14 constraints.
Also, the following objects are intended for illustrating expected data structures.
-
itempool_bayes_dataadata.framecontaining item parameters. -
itempool_se_bayes_dataadata.framecontaining item parameter standard errors. -
itemattrib_bayes_dataadata.framecontaining item attributes. -
constraints_bayes_dataadata.framecontaining constraint specifications.
Examples
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)
Fatigue dataset
Description
Item-based example pool with item contents (95 items).
Details
This pool is associated with the following objects:
-
itempool_fatigueanitem_poolobject containing 95 items. -
itemattrib_fatigueanitem_attribobject containing 7 item-level attributes. -
constraints_fatigueaconstraintsobject containing 111 constraints.
Also, the following objects are intended for illustrating expected data structures.
-
itempool_fatigue_dataadata.framecontaining item parameters. -
itemattrib_fatigue_dataadata.framecontaining item attributes. -
itemtext_fatigue_dataadata.framecontaining item texts. -
constraints_fatigue_dataadata.framecontaining constraint specifications. -
resp_fatigue_dataadata.framecontaining raw response data.
Examples
itempool_fatigue <- loadItemPool(itempool_fatigue_data)
itemattrib_fatigue <- loadItemAttrib(itemattrib_fatigue_data, itempool_fatigue)
constraints_fatigue <- loadConstraints(constraints_fatigue_data,
itempool_fatigue, itemattrib_fatigue)
Reading dataset
Description
Stimulus-based example item pool (303 items, 35 stimuli).
Details
This pool is associated with the following objects:
-
itempool_readinganitem_poolobject containing 303 items. -
itemattrib_readinganitem_attribobject containing 12 item-level attributes. -
stimattrib_readingast_attribobject containing 4 stimulus-level attributes. -
constraints_readingaconstraintsobject containing 18 constraints.
Also, the following objects are intended for illustrating expected data structures.
-
itempool_reading_dataadata.framecontaining item parameters. -
itemattrib_reading_dataadata.framecontaining item attributes. -
stimattrib_reading_dataadata.framecontaining stimulus attributes. -
constraints_reading_dataadata.framecontaining constraint specifications.
Examples
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)
Science dataset
Description
Item-based example item pool (1000 items).
Details
This pool is associated with the following objects:
-
itempool_scienceanitem_poolobject containing 1000 items. -
itemattrib_scienceanitem_attribobject containing 9 item-level attributes. -
constraints_scienceaconstraintsobject containing 36 constraints.
Also, the following objects are intended for illustrating expected data structures.
-
itempool_science_dataadata.framecontaining item parameters. -
itemattrib_science_dataadata.framecontaining item attributes. -
constraints_science_dataadata.framecontaining constraint specifications.
Examples
itempool_science <- loadItemPool(itempool_science_data)
itemattrib_science <- loadItemAttrib(itemattrib_science_data, itempool_science)
constraints_science <- loadConstraints(constraints_science_data,
itempool_science, itemattrib_science)
(Internal) Bind matrices diagonally
Description
dbind is an internal function for binding matrices diagonally.
This is used for constructing constraint matrix-data in Split.
Usage
dbind(...)
Arguments
... |
input matrices. |
Value
dbind returns a matrix.
Detect best solver
Description
Detect best solver
Usage
detectBestSolver()
Value
the package name of the best available solver on the system.
Examples
solver <- detectBestSolver()
cfg <- createStaticTestConfig(MIP = list(solver = solver))
cfg <- createShadowTestConfig(MIP = list(solver = solver))
(Internal) Determine the current theta segment
Description
determineCurrentThetaSegment is an internal function for
determining the current theta segment.
Usage
determineCurrentThetaSegment(
current_theta,
position,
exposure_control,
simulation_constants
)
Arguments
current_theta |
a list containing data on the current theta estimate. |
position |
the position within the current administration (i.e., test progress) |
exposure_control |
the |
simulation_constants |
a named list containing simulation constants. |
Value
determineCurrentThetaSegment returns a segment index.
(Internal) Perform exposure control
Description
doExposureControl is an internal function for performing exposure control.
This is a wrapper function for calling other low-level functions for respective exposure control methods.
Usage
doExposureControl(
exposure_record,
segment_record,
o,
j,
current_theta,
eligibility_flag,
simulation_constants
)
Arguments
exposure_record |
a named list containing exposure records. |
segment_record |
a named list containing counts on theta segments. |
o |
an |
j |
the numeric index of the examinee. |
current_theta |
a named list containing data on current theta estimate. |
eligibility_flag |
a named list containing eligibility flags. |
simulation_constants |
a named list containing simulation constants. |
Value
doExposureControl returns an updated list for exposure control records.
(C++) Calculate expected scores
Description
e_*() and array_e_*() are C++ functions for calculating expected scores.
Usage
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)
Arguments
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. |
Details
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 modelse_2pl(),array_e_2pl(): 2PL modelse_3pl(),array_e_3pl(): 3PL modelse_pc(),array_e_pc(): PC (partial credit) modelse_gpc(),array_e_gpc(): GPC (generalized partial credit) modelse_gr(),array_e_gr(): GR (graded response) modelse_m_2pl(),array_e_m_2pl(): multidimensional 2PL modelse_m_3pl(),array_e_m_3pl(): multidimensional 3PL modelse_m_gpc(),array_e_m_gpc(): multidimensional GPC modelse_m_gr(),array_e_m_gr(): multidimensional GR models
References
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.
Examples
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))
Compute expected a posteriori estimates of theta
Description
eap is a function for computing expected a posteriori estimates of theta.
Usage
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)
Arguments
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 |
Value
eap returns a list containing estimated values.
ththeta value.sestandard error.
Examples
eap(itempool_fatigue, resp = resp_fatigue_data[10, ])
eap(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
(Internal) Estimate final theta
Description
estimateFinalTheta is an internal function for
estimating final theta.
Usage
estimateFinalTheta(
o,
j,
position,
augmented_item_pool,
model_code,
augmented_item_index,
augmented_item_resp,
include_items_for_estimation,
item_parameter_sample,
config,
simulation_constants,
bayesian_constants
)
Arguments
o |
an |
j |
the numeric index of the examinee. |
position |
the item position, ranging from 1 to test length. |
augmented_item_pool |
the |
model_code |
machine-sanitized item model codes for passing onto C++ functions. |
augmented_item_index |
item indices of items administered to this examinee, also including any extra items supplied to the simulation. |
augmented_item_resp |
responses for items administered to this examinee, also including any extra items supplied to the simulation. |
include_items_for_estimation |
an examinee-wise list containing:
|
item_parameter_sample |
a list containing numerical samples of item parameters that reflect item parameter estimation uncertainty.
The output of |
config |
a |
simulation_constants |
a named list containing simulation constants. |
bayesian_constants |
a named list containing Bayesian constants. |
Value
estimateFinalTheta returns an updated output_Shadow object.
(Internal) Estimate interim theta
Description
estimateInterimTheta is an internal function for
estimating interim theta.
Usage
estimateInterimTheta(
o,
j,
position,
augmented_current_theta,
augmented_item_pool,
model_code,
augmented_item_index,
augmented_item_resp,
include_items_for_estimation,
item_parameter_sample,
config,
simulation_constants,
bayesian_constants
)
Arguments
o |
an |
j |
the numeric index of the examinee. |
position |
the item position, ranging from 1 to test length. |
augmented_current_theta |
current theta estimate, based on any extra items supplied to the simulation. |
augmented_item_pool |
the |
model_code |
machine-sanitized item model codes for passing onto C++ functions. |
augmented_item_index |
item indices of items administered to this examinee, also including any extra items supplied to the simulation. |
augmented_item_resp |
responses for items administered to this examinee, also including any extra items supplied to the simulation. |
include_items_for_estimation |
an examinee-wise list containing:
|
item_parameter_sample |
a list containing numerical samples of item parameters that reflect item parameter estimation uncertainty.
The output of |
config |
a |
simulation_constants |
a named list containing simulation constants. |
bayesian_constants |
a named list containing Bayesian constants. |
Value
estimateInterimTheta returns an updated output_Shadow object.
(C++) Classify theta values into segments using cutpoints
Description
find_segment() is a function for classifying theta values into segments based on supplied cutpoints.
Usage
find_segment(x, segment)
Arguments
x |
the theta value. This can be a vector. |
segment |
segment cutpoints. Values of |
Examples
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)
(Internal) Update eligibility flags to mark administered items as eligible
Description
flagAdministeredAsEligible is an internal function for updating eligibility flags.
Specifically, the function marks items/sets that are already administered to the current examinee as eligible.
This is necessary to ensure already administered items/sets are included in the shadowtest.
Usage
flagAdministeredAsEligible(
eligibility_flag_in_current_theta_segment,
x,
position,
simulation_constants
)
Arguments
eligibility_flag_in_current_theta_segment |
a list containing eligibility flags for the current theta segment. |
x |
an |
position |
the item position, ranging from 1 to test length. |
simulation_constants |
a named list containing simulation constants. |
Value
flagAdministeredAsEligible returns an updated eligibility flag list.
(Internal) Obtain item/set level eligibility flags
Description
flagIneligible is an internal function for obtaining item/set-level eligibility flags based on segment-wise exposure rates.
Usage
flagIneligible(
exposure_record,
simulation_constants,
item_index_by_stimulus,
seed,
j,
usage_flag = NULL
)
Arguments
exposure_record |
a named list containing exposure records. |
simulation_constants |
a named list containing simulation constants. |
item_index_by_stimulus |
a list containing item indices by stimulus. |
seed, j |
(optional) a random seed, and the examinee index. Used to determine the random seed as |
Value
flagIneligible returns a named list containing the following:
ia (n_segment, ni) matrix of 1 and 0 values.
sa (n_segment, ns) matrix of 1 and 0 values. Only returned when
simulation_constants$group_by_stimulusisTRUE.
In each matrix, 1 indicates the item/set is eligible to be selected in a shadowtest, and 0 indicates the item/set is not eligible to be selected in a shadowtest. The higher the observed exposure rate, the more likely the item/set will be flagged as 0. The rows represent theta segments, and the flags in the row corresponding to the examinee's current interim theta estimate is used for the shadowtest assembly.
(Internal) Convert prior parameters to distribution densities
Description
generateDensityFromPriorPar is an internal function for converting prior parameters to distribution densities.
Usage
generateDensityFromPriorPar(config_theta, theta_q)
Arguments
config_theta |
a list containing theta estimation configurations. |
theta_q |
a list containing all quadrature points. |
Value
parsePriorParameters returns a named list containing:
prior_distthe type of distribution. One of
NORMAL, UNIFORM, RAW.prior_paran examinee-wise list containing prior parameters.
(Internal) Generate item parameter samples for Bayesian purposes
Description
generateItemParameterSample is a function for generating item parameter samples.
Used for the FB (full-Bayesian) estimation method.
Usage
generateItemParameterSample(config, item_pool, bayesian_constants)
Arguments
config |
a |
item_pool |
an |
bayesian_constants |
a named list containing Bayesian constants. |
Value
If either the interim or the final theta estimation method is FB,
generateItemParameterSample returns a length-ni list of item parameter matrices, with each matrix having n_sample rows.
Otherwise, the function returns NULL.
(Internal) Generate random theta samples from prior distribution
Description
generateSampleFromPriorPar is an internal function for
generating random theta samples from prior distribution.
Usage
generateSampleFromPriorPar(config_theta, j, bayesian_constants)
Arguments
config_theta |
a named list containing theta estimation configurations. |
j |
the examinee index to perform the sample generation. |
bayesian_constants |
a named list containing Bayesian constants. |
Value
generateSampleFromPriorPar returns n_sample theta samples.
(Internal) Parse Bayesian-related constants
Description
getBayesianConstants is an internal function for parsing Bayesian-related constants
Usage
getBayesianConstants(config, simulation_constants)
Arguments
config |
a |
simulation_constants |
a named list containing simulation constants. |
Value
getBayesianConstants returns a named list containing:
final_theta_prior_densitiesprior densities for final theta estimation for all examinees.
If interim or final theta estimation method is EB or FB, the following are included in the list:
n_samplethe length of MCMC chain for theta estimation.
burn_inthe length of MCMC chain to trim from the start of the chain.
thinthe thinning interval to apply to the chain.
jump_factorthe scaling factor.
(Internal) Parse constants for adaptive test assembly simulation
Description
getConstants is an internal function for
parsing constants for adaptive test assembly simulation.
Usage
getConstants(constraints, config, arg_data, true_theta, max_info)
Arguments
constraints |
a |
config |
a |
arg_data |
the |
true_theta |
the |
max_info |
the maximum possible information attainable by any single item in the pool. This is used to determine the M value if M is not supplied. |
Value
getConstants returns a named list containing constants.
(Internal) Make decision variables for selecting an item
Description
getDecisionVariablesOfItemForMultipool is an internal function for
making decision variables for selecting a single item, for the purpose of multiple-pool assembly.
Usage
getDecisionVariablesOfItemForMultipool(item_idx, nv_per_bin, n_bins)
Arguments
item_idx |
the target item index. |
nv_per_bin |
the number of decision variables in the pool if this was a regular ATA. |
n_bins |
the number of pools being modeled. |
Value
getDecisionVariablesOfItemForMultipool returns a vector of indices.
(Internal) Make decision variables for selecting a pool
Description
getDecisionVariablesOfPoolForMultipool is an internal function for
making decision variables for selecting a single pool, for the purpose of multiple-pool assembly.
Usage
getDecisionVariablesOfPoolForMultipool(pool_idx, ni_per_bin, nv_per_bin)
Arguments
pool_idx |
the target pool index. |
ni_per_bin |
the number of items in the pool. |
nv_per_bin |
the number of decision variables in the pool if this was a regular ATA. |
Value
getDecisionVariablesOfPoolForMultipool returns a vector of indices.
(Internal) Parse eligibility flags for a specific theta segment
Description
getEligibilityFlagInSegment is an internal function for obtaining item/set-level eligibility flags for a specific theta segment.
Usage
getEligibilityFlagInSegment(eligiblity_flag, segment, simulation_constants)
Arguments
eligiblity_flag |
a list containing segment-wise eligibility flags. |
segment |
the segment index to read from. |
simulation_constants |
a named list containing simulation constants. |
Value
getEligibilityFlagInSegment returns a named list containing the following:
ia length-ni) vector of 1 and 0 values.
sa length-ns) vector of 1 and 0 values. Only returned when
simulation_constants$group_by_stimulusisTRUE.
In each vector, 1 indicates the item/set is eligible to be selected in a shadowtest, and 0 indicates the item/set is not eligible to be selected in a shadowtest. The higher the observed exposure rate, the more likely the item/set will be flagged as 0.
(Internal) Convert item IDs to item indices for exclusion
Description
getIndexOfExcludedEntry is an internal function for
converting item IDs to item indices for exclusion.
Usage
getIndexOfExcludedEntry(exclude, constraints)
Arguments
exclude |
a length-nj list, where each entry is a named list containing:
|
constraints |
a |
Details
Notation:
nj the number of examinees
Value
getIndexOfExcludedEntry returns a length-nj list in the same structure,
with its contents converted to item indices.
(Internal) Precalculate item information for fixed-theta item selection methods
Description
getInfoFixedTheta is an internal function for
calculating item information for fixed-theta item selection methods.
This is done once at the start of the simulation and cached for speed gain.
Usage
getInfoFixedTheta(item_selection, simulation_constants, item_pool, model)
Arguments
item_selection |
a list containing item selection config. |
simulation_constants |
a named list containing simulation constants. |
item_pool |
an item pool object. |
model |
sanitized item model codes to be fed to C++ functions. |
Value
getInfoFixedTheta returns a named list containing item information values
at designated thetas for each simulee.
(Internal) Apply information penalty on items to be excluded
Description
(Internal) Apply information penalty on items to be excluded
Usage
getInfoOfExcludedEntry(info, exclude_index, simulation_constants)
Arguments
info |
a one-row matrix containing information values on each item. |
exclude_index |
a named list containing item/set indices that need to be excluded. |
simulation_constants |
a named list containing simulation constants. |
Value
getInfoOfExcludedEntry returns
an updated one-row matrix containing information values.
(Internal) Parse item/stimulus lower/upper bounds from constraints data
Description
getLBUBInConstraintData is an internal function for
parsing maximum item/stimulus lower/upper bounds from constraints data.
Usage
getLBUBInConstraintData(
constants,
constraints,
item_constraints,
stim_constraints
)
Arguments
constants |
a names list containing constants. |
constraints |
a |
item_constraints |
row numbers indicating which are item-level constraints. |
stim_constraints |
row numbers indicating which are stimulus-level constraints. |
Value
getLBUBInConstraintData returns an updated list of constants.
Retrieve constraints-related scores from solution
Description
getScoreAttributes is a helper function for retrieving constraints-related scores from a solution.
Usage
getScoreAttributes(constraints, item_idx, item_resp, item_ncat)
Arguments
constraints |
a |
item_idx |
item indices from a solution. |
item_resp |
item scores for |
item_ncat |
number of score categories for |
Examples
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)
(Internal) Calculate theta segment of a given examinee
Description
getSegmentOf is an internal function for
calculating which theta segment an examinee belongs to.
Usage
getSegmentOf(x, simulation_constants)
Arguments
x |
an |
simulation_constants |
a named list containing simulation constants. |
Value
getSegmentOf returns a list containing:
final_theta_estthe theta segment based on final theta estimate.true_thetathe theta segment based on true theta.visitedsegments the examinee visited.
(Internal) Convert a theta distribution to segment-wise classification probabilities
Description
getSegmentProb is an internal function for
converting a theta distribution to segment-wise classification probabilities
This is used for BIGM-BAYESIAN exposure control.
Usage
getSegmentProb(posterior_sample, simulation_constants)
Arguments
posterior_sample |
a vector containing values in a Markov chain. |
simulation_constants |
a named list containing simulation constants. |
Value
getSegmentProb returns a vector of segment-wise classification probabilities.
(Internal) Make a vector for segment-dimensioned matrix update
Description
getSegmentsToApply is an internal function for
creating a vector for the purpose of updating various matrices that use theta segments as a dimension.
Usage
getSegmentsToApply(n_segment, segments)
Arguments
n_segment |
the total number of segments. |
segments |
a vector of target segments. |
Value
getSegmentsToApply returns a vector.
Print solution items
Description
Print solution items
Usage
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)
Arguments
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 |
Value
Item attributes of solution items.
Retrieve constraints-related attributes from solution
Description
getSolutionAttributes is a helper function for retrieving constraints-related attributes from a solution.
Usage
getSolutionAttributes(constraints, item_idx, all_values = FALSE)
Arguments
constraints |
a |
item_idx |
item indices from a solution. |
all_values |
if |
Value
If
all_values == FALSE,getSolutionAttributesreturns adata.framecontaining constraints data and their associated attributes.If
all_values == TRUE,getSolutionAttributesreturns alistcontaining attributes associated to each constraint.
Examples
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)
(Internal) Obtain constraint matrix-data of administered items/sets
Description
getXdataOfAdministered is an internal function for obtaining constraint matrix-data of administered items/sets.
Specifically, it returns a constraint matrix-data that tells the solver to include items/sets that are already administered to the current examinee.
This is necessary for shadow-test assembly for adaptive test assembly.
Usage
getXdataOfAdministered(
simulation_constants,
position,
x,
groupings_record,
constraints
)
Arguments
simulation_constants |
a named list containing simulation constants. |
position |
the item position, ranging from 1 to test length. |
x |
an |
groupings_record |
a list containing data on completed item sets. |
constraints |
a |
Value
getXdataOfAdministered returns a constraint matrix-data.
A constraint matrix-data is a named list containing the following:
xmata (nc, ni) matrix for the left-hand side in a MIP problem.
xdira length-nc) vector of relational operators, for comparing the two sides in a MIP problem.
xrhsa length-nc) vector, for the right-hand side in a MIP problem.
(Internal) Translate item exclusion instructions into a constraint matrix-data
Description
(Internal) Translate item exclusion instructions into a constraint matrix-data
Usage
getXdataOfExcludedEntry(simulation_constants, exclude_index)
Arguments
simulation_constants |
a named list containing simulation constants. |
exclude_index |
a named list containing item/set indices that need to be excluded. |
Value
getXdataOfExcludedEntry returns
a named list containing a constraint matrix-data.
xmatThe left-hand side multipliers on decision variables.xdirThe relation operator.xrhsThe right-hand side value.
Examples
simulation_constants <- list(
nv = 5,
ni = 5,
group_by_stimulus = FALSE
)
exclude_index <- list(
i = c(1, 2)
)
## Not run:
getXdataOfExcludedEntry(simulation_constants, exclude_index)
## End(Not run)
(C++) Calculate second derivative of log-likelihood
Description
h_*() and array_h_*() are C++ functions for calculating the second derivative of the log-likelihood function.
Usage
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)
Arguments
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. |
Details
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 modelsh_2pl(),array_h_2pl(): 2PL modelsh_3pl(),array_h_3pl(): 3PL modelsh_pc(),array_h_pc(): PC (partial credit) modelsh_gpc(),array_h_gpc(): GPC (generalized partial credit) modelsh_gr(),array_h_gr(): GR (graded response) modelsh_m_2pl(),array_h_m_2pl(): multidimensional 2PL modelsh_m_3pl(),array_h_m_3pl(): multidimensional 3PL modelsh_m_gpc(),array_h_m_gpc(): multidimensional GPC modelsh_m_gr(),array_h_m_gr(): multidimensional GR models
References
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.
Examples
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)
(Internal) Increment exposure record variable: alpha
Description
incrementAlpha is an internal function for incrementing an exposure record variable.
Specifically, the a_ijk is incremented by one for administered items/sets.
Usage
incrementAlpha(
exposure_record,
segments_to_apply,
segment_prob,
x,
simulation_constants
)
Arguments
exposure_record |
a named list containing exposure records. |
segments_to_apply |
which segments to apply the incrementing. |
segment_prob |
the amount of increment. |
x |
an |
simulation_constants |
a named list containing simulation constants. |
Value
incrementAlpha returns an updated exposure record.
(Internal) Increment exposure record variable: n
Description
incrementPhi is an internal function for incrementing an exposure record variable.
Specifically, the n_k is incremented by one.
Usage
incrementN(
exposure_record,
segments_to_apply,
segment_prob,
simulation_constants
)
Arguments
exposure_record |
a named list containing exposure records. |
segments_to_apply |
which segments to apply the incrementing. |
segment_prob |
the amount of increment. |
simulation_constants |
a named list containing simulation constants. |
Value
incrementN returns an updated exposure record.
(Internal) Increment exposure record variable: phi
Description
incrementPhi is an internal function for incrementing an exposure record variable.
Specifically, the f_k is incremented by one if the following conditions are simultaneously met:
For the final theta segment k, shadowtest assembly was feasible at least one times in any item position while interim theta segment was k.
Usage
incrementPhi(
exposure_record,
segments_to_apply,
segment_prob,
assembly_was_feasible
)
Arguments
exposure_record |
a named list containing exposure records. |
segments_to_apply |
which segments to apply fading to. |
segment_prob |
a vector containing segment-wise classification probabilities of an ability estimate. |
assembly_was_feasible |
see |
Value
incrementPhi returns an updated exposure record.
(Internal) Increment exposure record variable: rho
Description
incrementRho is an internal function for incrementing an exposure record variable.
Specifically, the s_ijk variable is incremented for accounting for infeasible shadowtests.
Usage
incrementRho(
exposure_record,
segments_to_apply,
segment_prob,
eligibility_flag,
assembly_was_feasible,
simulation_constants
)
Arguments
exposure_record |
a named list containing exposure records. |
segments_to_apply |
which segments to apply the incrementing. |
segment_prob |
the amount of increment. |
eligibility_flag |
a named list containing eligibility flags. |
assembly_was_feasible |
see |
simulation_constants |
a named list containing simulation constants. |
Value
incrementRho returns an updated exposure record.
(C++) Calculate Fisher information
Description
info_*() and array_info_*() are functions for calculating Fisher information.
Usage
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)
Arguments
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. |
Details
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 modelsinfo_2pl(),array_info_2pl(): 2PL modelsinfo_3pl(),array_info_3pl(): 3PL modelsinfo_pc(),array_info_pc(): PC (partial credit) modelsinfo_gpc(),array_info_gpc(): GPC (generalized partial credit) modelsinfo_gr(),array_info_gr(): GR (graded response) modelsinfo_m_2pl(),array_info_m_2pl(): multidimensional 2PL modelsinfo_m_3pl(),array_info_m_3pl(): multidimensional 3PL modelsinfo_m_gpc(),array_info_m_gpc(): multidimensional GPC modelsinfo_m_gr(),array_info_m_gr(): multidimensional GR modelsDirectional information for a specific angle
thisdirinfo_m_2pl(),array_thisdirinfo_m_2pl(): multidimensional 2PL modelsthisdirinfo_m_3pl(),array_thisdirinfo_m_3pl(): multidimensional 3PL modelsthisdirinfo_m_gpc(),array_thisdirinfo_m_gpc(): multidimensional GPC modelsthisdirinfo_m_gr(),array_thisdirinfo_m_gr(): multidimensional GR models
References
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.
Examples
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))
(Internal) Initialize groupings record
Description
initializeCompletedGroupingsRecord is an internal function for
creating a new groupings record. Used for keeping track of completed groups such as item sets.
Usage
initializeCompletedGroupingsRecord()
Value
initializeCompletedGroupingsRecord returns a groupings record.
(Internal) Initialize diagnostic exposure record
Description
initializeDiagnosticExposureRecord is an internal function
for creating a new diagnostic exposure record.
Usage
initializeDiagnosticExposureRecord(simulation_constants)
Arguments
simulation_constants |
a named list containing simulation constants. |
Value
initializeDiagnosticExposureRecord returns a list containing diagnostic exposure record.
(Internal) Initialize exposure record
Description
initializeExposureRecord is an internal function
for creating a new exposure record.
Usage
initializeExposureRecord(exposure_control, simulation_constants)
Arguments
exposure_control |
the |
simulation_constants |
a named list containing simulation constants. |
Value
initializeExposureRecord returns a list containing exposure record.
(Internal) Initialize segment record
Description
initializeSegmentRecord is an internal function
for creating a new segment record.
Usage
initializeSegmentRecord(simulation_constants)
Arguments
simulation_constants |
a named list containing simulation constants. |
Value
initializeSegmentRecord returns a list containing segment record.
freq_trueis a length-n_segmentvector containing the number of times examinees belonged in each theta segment, based on true thetas.freq_estis a length-n_segmentvector containing the number of times examinees belonged in each theta segment, based on final theta estimates.count_truecount_est
(Internal) Initialize item usage matrix
Description
initializeUsageMatrix is an internal function for
creating a new item usage matrix. An item usage matrix is a
(nj, nv) matrix with TRUE or FALSE values.
The rows represent examinees, and the columns represent decision variables.
Usage
initializeUsageMatrix(simulation_constants)
Arguments
simulation_constants |
a named list containing simulation constants. |
Value
initializeUsageMatrix returns a new item usage matrix.
Generate item parameter samples for Bayesian purposes
Description
iparPosteriorSample is a function for generating item parameter samples.
Used for the FB (full-Bayesian) estimation method.
Usage
iparPosteriorSample(pool, n_sample = 500)
Arguments
pool |
an |
n_sample |
the number of samples to draw. |
Value
iparPosteriorSample returns a length-ni list of item parameter matrices, with each matrix having n_sample rows.
Examples
ipar <- iparPosteriorSample(itempool_bayes, 5)
ipar <- iparPosteriorSample(itempool_science, 5) # no variation
(Internal) Check if customized first segments are available
Description
isCustomFirstSegmentAvailable is an internal function for
checking if customized first segments are available.
Usage
isCustomFirstSegmentAvailable(available, n_values, position)
Arguments
available |
|
n_values |
the number of supplied values. |
position |
the position within the current administration (i.e., test progress) |
Value
isCustomFirstSegmentAvailable returns TRUE or FALSE.
(Internal) Check whether solution is optimal
Description
isSolutionOptimal is an internal function for
checking whether a solution is optimal.
Usage
isSolutionOptimal(status, solver)
Arguments
status |
status code returned by the solver function. |
solver |
solver name. |
Value
isSolutionOptimal returns TRUE or FALSE.
Item classes
Description
item_1PLclass represents a 1PL item.item_2PLclass represents a 2PL item.item_3PLclass represents a 3PL item.item_PCclass represents a partial credit item.item_GPCclass represents a generalized partial credit item.item_GRclass represents a graded response item.
Slots
slopea slope parameter value
difficultya difficulty parameter value
guessinga guessing parameter value
thresholda vector of threshold parameter values
categorya vector of category boundary values
ncatthe number of response categories
References
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.
Examples
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)
Load item attributes
Description
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.
Usage
loadItemAttrib(object, pool)
Arguments
object |
item attributes. Can be a |
pool |
an |
Value
loadItemAttrib returns an item_attrib object.
dataadata.framecontaining item attributes.
See Also
dataset_science, dataset_reading, dataset_fatigue, dataset_bayes for examples.
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)
Basic functions for item attribute objects
Description
Basic functions for item attribute objects
Usage
## 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, ...)
Arguments
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. |
Examples
x <- itemattrib_science
x[1:10]
dim(x)
ncol(x)
nrow(x)
colnames(x)
rownames(x)
names(x)
as.data.frame(x)
Class 'item_pool': an item pool
Description
item_pool is an S4 class for representing an item pool.
Details
See item_pool-operators for object manipulation functions.
Slots
nithe number of items in the pool.
max_catthe maximum number of response categories across the pool.
indexthe numeric index of each item.
idthe ID string of each item.
modelthe item class name of each item. See
item-classes.NCATthe number of response categories of each item.
parmsa list containing item class objects. See
item-classes.ipara matrix containing item parameters.
sea matrix containing item parameter standard errors.
rawthe raw input
data.frameused inloadItemPoolto create this object.raw_sethe raw input
data.frameused inloadItemPoolto create this object.uniquewhether item IDs must be unique for this object to be a valid object.
Basic operators for item pool objects
Description
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.
Usage
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
Arguments
x, x1, x2 |
an |
i |
item indices to use in subsetting. |
unique |
if |
verbose |
if |
j, drop, ... |
not used, exists for compatibility. |
Examples
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
Class 'item_pool_cluster': an item pool
Description
item_pool_cluster is an S4 class for representing a group of item pools.
Slots
npthe number of item pools.
poolsa list of
item_poolobjects.namesa vector containing item pool names.
(C++) Calculate first derivative of log-likelihood
Description
j_*() and array_j_*() are C++ functions for calculating the first derivative of the log-likelihood function.
Usage
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)
Arguments
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. |
Details
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 modelsj_2pl(),array_j_2pl(): 2PL modelsj_3pl(),array_j_3pl(): 3PL modelsj_pc(),array_j_pc(): PC (partial credit) modelsj_gpc(),array_j_gpc(): GPC (generalized partial credit) modelsj_gr(),array_j_gr(): GR (graded response) modelsj_m_2pl(),array_j_m_2pl(): multidimensional 2PL modelsj_m_3pl(),array_j_m_3pl(): multidimensional 3PL modelsj_m_gpc(),array_j_m_gpc(): multidimensional GPC modelsj_m_gr(),array_j_m_gr(): multidimensional GR models
References
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.
Examples
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)
Convert mean and standard deviation into log-normal distribution parameters
Description
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.
Usage
lnHyperPars(mean, sd)
Arguments
mean |
the desired mean. |
sd |
the desired standard deviation. |
Value
lnHyperPars returns two values. These can be directly supplied to rlnorm.
Examples
pars <- lnHyperPars(2, 4)
x <- rlnorm(1000000, pars[1], pars[2])
mean(x) # close to 2
sd(x) # close to 4
Load constraints
Description
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.
Usage
loadConstraints(object, pool, item_attrib, st_attrib = NULL)
Arguments
object |
constraint specifications. Can be a |
pool |
an |
item_attrib |
an |
st_attrib |
(optional) an |
Value
loadConstraints returns a constraints object. This object is used in Static and Shadow.
See Also
dataset_science, dataset_reading, dataset_fatigue, dataset_bayes for examples.
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)
Load item pool
Description
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.
Usage
loadItemPool(ipar, ipar_se = NULL, unique = FALSE)
Arguments
ipar |
item parameters. Can be a |
ipar_se |
(optional) standard errors. Can be a |
unique |
if |
Value
loadItemPool returns an item_pool object.
nithe number of items in the pool.max_catthe maximum number of response categories across all items in the pool.indexthe numeric item index of each item.idthe item ID string of each item.modelthe object class names of each item representing an item model type. Can beitem_1PL,item_2PL,item_3PL,item_PC,item_GPC, oritem_GR.NCATthe number of response categories of each item.parmsa list containing the item object of each item.ipara matrix containing all item parameters.sea matrix containing all item parameter standard errors. The values will be 0 if the argumentipar_sewas not supplied.rawthe original inputiparargument used to create this object.raw_sethe original inputipar_seargument used to create this object. If the argument was not supplied, this will be in the same structure with theiparargument but the item parameter values will be filled with 0s.uniquethe original inputuniqueargument used to create this object.
See Also
dataset_science, dataset_reading, dataset_fatigue, dataset_bayes for examples.
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)
Convert mean and standard deviation into logit-normal distribution parameters
Description
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.
Usage
logitHyperPars(mean, sd)
Arguments
mean |
the desired mean. |
sd |
the desired standard deviation. |
Value
logitHyperPars returns two values. These can be directly supplied to rlogitnorm.
Examples
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
make constraints objects from Split() solution indices
Description
makeConstraintsByEachPartition is a helper function for making
constraints objects from Split solution indices.
Usage
makeConstraintsByEachPartition(constraints, solution_per_bin)
Arguments
constraints |
a |
solution_per_bin |
a list containing item/stimulus indices for each partition.
This accepts a list stored in the |
Value
makeConstraintsByEachPartition returns a list of constraints objects.
(Internal) Collect diagnostic exposure record
Description
makeDiagnosticExposureRecord is an internal function for
collecting diagnostic exposure record.
Usage
makeDiagnosticExposureRecord(
true_theta,
segment_record,
diagnostic_exposure_record,
config,
simulation_constants
)
Arguments
true_theta |
examinee's true theta. Used to determine the segment the true theta belongs to. |
segment_record |
a named list containing counts on theta segments. |
diagnostic_exposure_record |
a named list containing the diagnostic exposure record. |
config |
a |
simulation_constants |
a named list containing simulation constants. |
Value
makeDiagnosticExposureRecord returns an updated exposure record.
Create an item pool cluster object
Description
Create a item_pool_cluster object.
item_pool_cluster1 == item_pool_cluster2 tests equality of two item_pool_cluster objects.
Usage
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
Arguments
x, ... |
|
names |
(optional) names to use for |
item_pool_cluster1 |
an |
item_pool_cluster2 |
an |
Examples
cluster <- makeItemPoolCluster(itempool_science, itempool_reading)
cluster1 <- makeItemPoolCluster(itempool_science, itempool_reading)
cluster2 <- makeItemPoolCluster(cluster1@pools[[1]], cluster1@pools[[2]])
cluster1 == cluster2 ## TRUE
(Internal) Make set-based strucutre constraints
Description
makeSetStructureConstraints is an internal function for
making the left-hand side matrix of set-based structure constraints.
Usage
makeSetStructureConstraints(constraints)
Arguments
constraints |
a |
Value
makeSetStructureConstraints returns a matrix.
Create a simulation data cache object
Description
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.
Usage
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
)
Arguments
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. |
Create a test object
Description
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.
Usage
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
)
Arguments
object |
an |
theta |
a grid of theta values. |
info_type |
the type of information. |
true_theta |
(optional) true theta values to simulate response data. |
Examples
test <- makeTest(itempool_science, seq(-3, 3, 1))
Create a test cluster object
Description
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.
Usage
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)
Arguments
object |
an |
theta |
a grid of theta values. |
true_theta |
an optional vector of true theta values to simulate response data. |
Compute maximum likelihood estimates of theta
Description
mle is a function for computing maximum likelihood estimates of theta.
Usage
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)
Arguments
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 |
Value
mle returns a list containing estimated values.
ththeta value.sestandard error.convTRUEif estimation converged.truncTRUEif truncation was applied onth.
Examples
mle(itempool_fatigue, resp = resp_fatigue_data[10, ])
mle(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
Compute maximum likelihood estimates of theta using fence items
Description
mlef is a function for computing maximum likelihood estimates of theta using fence items.
Usage
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
)
Arguments
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 |
Value
mlef returns a list containing estimated values.
ththeta value.sestandard error.convTRUEif estimation converged.truncTRUEif truncation was applied onth.
References
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.
Examples
mlef(itempool_fatigue, resp = resp_fatigue_data[10, ])
mlef(itempool_fatigue, select = 1:20, resp = resp_fatigue_data[10, 1:20])
Class 'output_Shadow': adaptive assembly solution for one simulee
Description
output_Shadow is an S4 class for representing the adaptive assembly solution for one simulee.
Slots
simulee_idthe numeric ID of the simulee.
true_thetathe true theta of the simulee, if was specified.
true_theta_segmentthe segment number of the true theta.
final_theta_estfinal theta estimate.
final_se_estthe standard error of
final_theta_est.administered_item_indexitem IDs administered at each position.
administered_item_respitem responses from the simulee at each position.
administered_item_ncatthe number of categories of each administered item.
administered_stimulus_indexstimulus IDs administered at each position.
shadow_test_refreshedTRUEindicates the shadowtest was refreshed for the position.shadow_test_feasibleTRUEindicates the MIP was feasible with all constraints.solve_timeelapsed time in running the solver at each position.
initial_theta_estinitial theta estimate.
interim_theta_estinterim theta estimates at each position.
interim_se_estthe standard error of the interim estimate at each position.
theta_segment_indexsegment numbers of interim theta estimates.
priorprior distribution, if was specified.
prior_parprior parameters, if were specified.
posteriorthe posterior distribution after completing test.
posterior_sampleposterior samples of interim theta before the estimation of final theta.
mean(posterior_sample) == interim_theta_est[test_length]holds.likelihoodthe likelihood distribution after completing test.
shadow_testthe list containing the item IDs within the shadowtest used in each position.
max_cat_poolthe maximum number of response categories the item pool had.
ni_poolthe total number of items the item pool had.
ns_poolthe total number of stimuli the item pool had.
test_length_constraintsthe test length constraint used in assembly.
set_basedwhether the item pool was set-based.
item_index_by_stimulusthe list of items by each stimulus the item pool had.
Class 'output_Shadow_all': a set of adaptive assembly solutions
Description
output_Shadow_all is an S4 class for representing a set of adaptive assembly solutions.
Details
- notations
-
ni denotes the number of items in the
item_poolobject.ns denotes the number of stimuli.
nj denotes the number of participants.
Slots
callthe function call used for obtaining this object.
outputa length-*nj* list of
output_Shadowobjects, containing the assembly results for each participant.final_theta_esta length-*nj* vector containing final theta estimates for each participant.
final_se_esta length-*nj* vector standard errors of the final theta estimates for each participant.
exposure_ratea 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_matrixa *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_matrixa *nj* by (*ni* + *ns*) matrix representing the number of times the item/stimulus was administered to each participant over multiple administrations.
true_segment_counta 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_counta 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_statsexposure record for diagnostics.
check_eligibility_statsdetailed segment-wise exposure record for diagnostics. available when
config_Shadow@exposure_control$diagnostic_statsisTRUE.no_fading_eligibility_statsdetailed segment-wise exposure record without fading for diagnostics. available when
config_Shadow@exposure_control$diagnostic_statsisTRUE.freq_infeasiblea table representing the number of times the assembly was initially infeasible.
poolthe
item_poolused in the assembly.configthe
config_Shadowused in the assembly.constraintsthe
constraintsused in the assembly.true_thetathe
true_thetaargument used in the assembly.datathe
dataargument used in the assembly.priorthe
priorargument used in the assembly.prior_parthe
prior_parargument used in the assembly.adaptivitya list of adaptivity indices.
simulation_constantsa list containing simulation constants parsed from input.
Class 'output_Split': partitioning solution
Description
output_Split is an S4 class for representing the partitioning solution of an item pool.
Slots
callthe function call used for obtaining this object.
outputa list containing item/set indices of each partition.
feasiblefor partitioning into sub-pools,
TRUEindicates the complete assignment problem was feasible.solve_timeelapsed time in running the solver.
set_basedwhether the item pool is set-based.
configthe
config_Staticused in the assembly.constraintsthe
constraintsused in the assembly.partition_size_rangethe partition size range for splitting into sub-pools.
partition_typethe partition type. Can be a
testor apool.constraints_by_each_partitiona list of
constraintsobjects that represent each partition.
Class 'output_Static': fixed-form assembly solution
Description
output_Static is an S4 class for representing a fixed-form assembly solution.
Slots
callthe function call used for obtaining this object.
MIPa list containing the result from MIP solver.
selecteda
data.framecontaining the selected items and their attributes.obj_valuethe objective value of the solution.
solve_timethe elapsed time in running the solver.
achieveda
data.framecontaining attributes of the assembled test, by each constraint.poolthe
item_poolused in the assembly.configthe
config_Staticused in the assembly.constraintsthe
constraintsused in the assembly.
(C++) Calculate item response probability
Description
p_*() and array_p_*() are C++ functions for calculating item response probability.
Usage
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)
Arguments
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. |
Details
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 modelsp_2pl(),array_p_2pl(): 2PL modelsp_3pl(),array_p_3pl(): 3PL modelsp_pc(),array_p_pc(): PC (partial credit) modelsp_gpc(),array_p_gpc(): GPC (generalized partial credit) modelsp_gr(),array_p_gr(): GR (graded response) modelsp_m_2pl(),array_p_m_2pl(): multidimensional 2PL modelsp_m_3pl(),array_p_m_3pl(): multidimensional 3PL modelsp_m_gpc(),array_p_m_gpc(): multidimensional GPC modelsp_m_gr(),array_p_m_gr(): multidimensional GR models
References
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.
Examples
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))
(Internal) Parse a constraint data into an object
Description
parseConstraintData is an internal function for
parsing data for a single constraint.
Usage
parseConstraintData(x, attrib, constants)
Arguments
x |
a |
attrib |
an |
constants |
a named list containing constants. |
Value
parseConstraintData returns a constraint object.
(Internal) Parse prior parameters from viable sources
Description
parsePriorParameters is an internal function for parsing prior parameters from viable sources
Usage
parsePriorParameters(
config_theta,
simulation_constants,
prior_density_override,
prior_par_override
)
Arguments
config_theta |
a list containing theta estimation configurations. |
simulation_constants |
a named list containing simulation constants. |
prior_density_override |
(optional) if supplied, treated as |
prior_par_override |
(optional) if supplied, treated as |
Value
parsePriorParameters returns a named list containing:
prior_distthe type of distribution. One of
NORMAL, UNIFORM, RAW.prior_paran examinee-wise list containing prior parameters.
(Internal) Parse shadowtest refresh schedule
Description
parseShadowTestRefreshSchedule is an internal function for
parsing shadowtest refresh schedule from supplied config.
Usage
parseShadowTestRefreshSchedule(simulation_constants, refresh_policy)
Arguments
simulation_constants |
a named list containing simulation constants. |
refresh_policy |
the |
Value
parseShadowTestRefreshSchedule returns a named list.
Extension of plot() for objects in TestDesign package
Description
Extension of plot() for objects in TestDesign package
Usage
## 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,
...
)
Arguments
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 |
Examples
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')
(Internal) Draw an exposure rate plot
Description
plotExposurePanel is an internal function for
drawing an exposure rate plot for a single theta segment.
Usage
plotExposurePanel(
item_exposure_rate,
item_exposure_rate_final = NULL,
stim_exposure_rate = NULL,
stim_index = NULL,
max_rate = max_rate,
title = NULL,
color = "blue",
color_final = "yellow",
color_stim = "red",
color_threshold = "dark gray",
simple = FALSE,
...
)
Arguments
item_exposure_rate |
exposure rates for each item. |
item_exposure_rate_final |
exposure rates for each item, treating items administered in non-true segments as not exposed. Conceptually this will never exceed |
stim_exposure_rate |
exposure rates for each stimulus. |
stim_index |
the stimulus index each item belongs to. |
max_rate |
target exposure rate for each theta segment. |
title |
the title of this plot panel. |
color |
the color for exposure rate bars. (default = |
color_final |
the color for exposure rate bars, treating items administered in non-true segments as not exposed. (default = |
color_stim |
the color for stimulus groupings. (default = |
color_threshold |
the color for the target exposure rate bar. (default = |
simple |
not used. |
... |
arguments to pass onto |
(Internal) Plot audit trail of a single examinee
Description
plotShadowAudit is an internal function for
plotting audit trail of a single examinee,
showing interim theta estimates over the course of an adaptive test.
Usage
plotShadowAudit(x, theta_range, z_ci, use_par, ...)
Arguments
x |
an |
theta_range |
the theta range to use on the y-axis. |
z_ci |
the confindence interval value to use in the z metric. |
use_par |
|
... |
not used. |
(Internal) Plot shadow chart of a single examinee
Description
plotShadowAudit is an internal function for
plotting shadow chart of a single examinee,
showing all shadowtests over the course of an adaptive test.
Usage
plotShadowChart(x, simple, use_par, ...)
Arguments
x |
an |
simple |
|
use_par |
|
... |
not used. |
(Internal) Plot exposure rates from a simulation
Description
plotShadowExposure is an internal function for
plotting exposure rates from a simulation.
Usage
plotShadowExposure(
x,
theta_type,
segment,
use_segment_label,
color,
color_final,
rmse,
use_par,
...
)
Arguments
x |
an |
theta_type |
|
segment |
the segment index to do the plotting. |
use_segment_label |
|
color |
the color for exposure rate bars. |
color_final |
the color for exposure rate bars, treating items administered in non-true segments as not exposed. |
rmse |
|
use_par |
|
... |
not used. |
(Internal) Plot test information of a single shadow test
Description
plotShadowInfo is an internal function for
plotting the test information curve of a single shadow test.
Usage
plotShadowInfo(
x,
examinee_id,
position,
info_type,
ylim = NULL,
theta,
color,
use_par,
...
)
Arguments
x |
an |
examinee_id |
the numeric index of an examinee. |
position |
the position within the test administration (i.e., test progress), ranging from 1 to test length. |
info_type |
the information type. Currently only accepts |
ylim |
(optional) the y-axis range. Defaults to 0 to maximum information. |
theta |
theta quadrature points to compute information values at. |
color |
the color for test information curve. |
use_par |
not used. |
... |
not used. |
Extension of print() for objects in TestDesign package
Description
Extension of print() for objects in TestDesign package
Usage
## 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)
Arguments
x |
an object to print. |
index_only |
if |
digits |
minimal number of *significant* digits. See |
(Internal) Return S4 object validation error messages
Description
returnErrors is an internal function for
S4 object validation error messages.
Usage
returnErrors(errors)
Arguments
errors |
a vector containing error messages. |
Value
returnErrors returns TRUE if the input is empty.
otherwise it returns the error messages as a pass-thru.
Run Test Assembly
Description
runAssembly is a function for performing test assembly. This function is used internally in Static and Shadow.
Usage
runAssembly(config, constraints, xdata = NULL, objective = NULL)
Arguments
config |
a |
constraints |
a |
xdata |
a list containing extra constraints in MIP form, for various purposes such as including previously administered items, and excluding ineligible items. |
objective |
the objective coefficients used for decision variables. This is usually the information value for each item in the pool. |
Value
runAssembly returns a list containing the following entries:
MIPa list containing the result from MIP solver.solverthe name of the MIP solver.statusthe MIP status value, indicating whether an optimal solution was found.shadow_testthe attributes of the selected items.obj_valuethe objective value of the solution.solve_timethe elapsed time in running the solver.
References
van der Linden, W. J. (2005). Linear models for optimal test design. Springer Science & Business Media.
(Internal) Run MIP solver
Description
runMIP is an internal function for
running a MIP solver.
Usage
runMIP(
solver,
obj,
mat,
dir,
rhs,
maximize,
types,
verbosity,
time_limit,
gap_limit_abs,
gap_limit
)
Arguments
solver |
the solver name. |
obj |
a length-nd vector containing objective values. |
mat |
a (nc, nd) matrix containing left-hand side constraint coefficients. |
dir |
a length-nc vector containing equality signs. |
rhs |
a length-nc vector containing right-hand side values. |
maximize |
|
verbosity |
the verbosity level. |
time_limit |
the time limit. |
gap_limit_abs |
the gap limit in absolute metric. This determines the criteria the solver uses to declare that optimality is reached. |
gap_limit |
the gap limit in relative metric. This determines the criteria the solver uses to declare that optimality is reached. |
Value
runMIP returns solver output.
This will have different structures depending on what solver is used.
(Internal) Sanitize constraints data
Description
sanitizeConstraintsData is an internal function for
sanitizing constraints data.
Usage
sanitizeConstraintsData(x)
Arguments
x |
a |
Value
sanitizeConstraintsData returns sanitized constraints data.
(Internal) Sanitize item model names for C++ functions
Description
sanitizeModel is an internal function for
sanitizing item model names to be passed onto C++ functions.
Usage
sanitizeModel(model)
Arguments
model |
a vector containing item model names. |
Value
sanitizeModel returns a numeric vector, with
item_1PLconverted to1item_2PLconverted to2item_3PLconverted to3item_PCconverted to4item_GPCconverted to5item_GRconverted to6
(Internal) Select item from a shadowtest
Description
(Internal) Select item from a shadowtest
Usage
selectItemFromShadowTest(
shadow_test,
position,
simulation_constants,
x,
previous_selection
)
Arguments
shadow_test |
a |
position |
the item position, ranging from 1 to test length. |
simulation_constants |
a named list containing simulation constants. |
x |
a |
previous_selection |
a named list containing item selection from previous position. |
Value
a named list containing data on the selected item.
(Internal) Determine whether shadowtest should be refreshed
Description
shouldShadowTestBeRefreshed is an internal function for
deciding whether a new shadowtest should be assembled.
Usage
shouldShadowTestBeRefreshed(
shadowtest_refresh_schedule,
position,
theta_change,
previous_selection
)
Arguments
shadowtest_refresh_schedule |
refresh schedule. |
position |
the position within the current administration (i.e., test progress) |
theta_change |
the change in interim theta. |
previous_selection |
a named list containing data on what item was selected previously. |
Value
shouldShadowTestBeRefreshed returns a TRUE or FALSE value.
Extension of show() for objects in TestDesign package
Description
Extension of show() for objects in TestDesign package
Usage
## 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)
Arguments
object |
an object to display. |
Simulate item response data
Description
simResp is a function for simulating item response data.
Usage
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)
Arguments
object |
|
theta |
theta values to use. |
Details
- notations
-
nq denotes the number of theta values.
ni denotes the number of items in the
item_poolobject.
Value
itemobject:simRespreturns a length nq vector containing simulated item response data.item_poolobject:simRespreturns a (nq, ni) matrix containing simulated item response data.
References
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.
Examples
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))
Class 'simulation_data_cache': data cache for Shadow()
Description
simulation_data_cache is an S4 class for representing data cache for Shadow().
Slots
item_poolthe
item_poolobject.theta_gridthe theta grid to use as quadrature points.
prob_gridthe list containing item response probabilities at theta quadratures.
info_gridthe matrix containing item information values at theta quadratures.
max_infothe maximum value of
info_grid.true_theta(optional) the true theta values.
response_data(optional) the matrix containing item responses.
(Internal) Convert a partitioning problem solution to indices
Description
splitSolutionToBins is an internal function for converting a paritioning problem solution to indices.
Usage
splitSolutionToBins(solution, n_bins, ni_per_bin, nv_per_bin)
Arguments
solution |
the solution vector from the solver. |
n_bins |
the number of bins (i.e., partitions) |
ni_per_bin |
the number of decision variables for items in each bin. This is the number of items in the pool. |
nv_per_bin |
the number of decision variables for items+sets in each bin. This is the number of items in the pool plus the number of sets. The deviation variable is not counted here. |
Value
splitSolutionToBins returns a partition-wise list containing item/set indices.
Load set/stimulus/passage attributes
Description
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.
Usage
loadStAttrib(object, item_attrib)
Arguments
object |
itemset-level attributes. Can be a |
item_attrib |
an |
Value
loadStAttrib returns a st_attrib object.
dataadata.framecontaining itemset-level attributes.
See Also
dataset_reading for examples.
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)
Basic functions for stimulus attribute objects
Description
Basic functions for stimulus attribute objects
Usage
## 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, ...)
Arguments
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. |
Examples
x <- stimattrib_reading
x[1:10]
dim(x)
ncol(x)
nrow(x)
colnames(x)
rownames(x)
names(x)
as.data.frame(x)
Extension of summary() for objects in TestDesign package
Description
Extension of summary() for objects in TestDesign package
Usage
## 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)
Arguments
object |
an object to summarize. |
simple |
if |
Examples
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 classes
Description
Summary classes
Class 'test': data cache for simulations
Description
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.
Slots
poolthe
item_poolobject.thetathe theta grid to use as quadrature points.
probthe list containing item response probabilities.
infothe matrix containing item information values.
true_theta(optional) the true theta values.
data(optional) the matrix containing item responses.
Test solver
Description
Test solver
Usage
testSolver(solver)
Arguments
solver |
a solver package name. Accepts |
Value
empty string "" if solver works. A string containing error messages otherwise.
Class 'test_cluster': data cache for simulations
Description
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.
Slots
ntthe number of
testobjects in this cluster.teststhe list containing
testobjects.namestest ID strings for each
testobject.
Basic operators for test objects
Description
Create a subset of a test object.
Usage
subsetTest(x, i = NULL)
## S4 method for signature 'test,ANY'
x[i, j, ..., drop = TRUE]
Arguments
x |
a |
i |
item indices to use in subsetting. |
j, drop, ... |
not used, exists for compatibility. |
(C++) Calculate a theta estimate using EAP (expected a posteriori) method
Description
theta_EAP() and theta_EAP_matrix() are functions for calculating a theta estimate using EAP (expected a posteriori) method.
Usage
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)
Arguments
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. |
Details
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.
Examples
# 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))
(C++) Calculate a theta estimate using EB (Empirical Bayes) method
Description
theta_EB_single() and theta_EB() are functions for calculating a theta estimate using EB (Empirical Bayes) method.
Usage
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
)
Arguments
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. |
Details
theta_EB_single() is designed for one item, and theta_EB() is designed for multiple items.
Currently supports unidimensional models.
Examples
# 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))
(C++) Calculate a theta estimate using FB (Full Bayes) method
Description
theta_FB_single() and theta_FB() are functions for calculating a theta estimate using FB (Full Bayes) method.
Usage
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
)
Arguments
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 |
Details
theta_FB_single() is designed for one item, and theta_FB() is designed for multiple items.
Currently supports unidimensional models.
Toggle constraints
Description
toggleConstraints is a function for toggling individual constraints in a constraints object.
Usage
toggleConstraints(object, on = NULL, off = NULL)
Arguments
object |
a |
on |
constraint indices to mark as active. Also accepts character IDs. |
off |
constraint indices to mark as inactive. Also accepts character IDs. |
Value
toggleConstraints returns the updated constraints object.
Examples
constraints_science2 <- toggleConstraints(constraints_science, off = 32:36)
constraints_science3 <- toggleConstraints(constraints_science2, on = 32:36)
constraints_science4 <- toggleConstraints(constraints_science, off = "C32")
(Internal) Update groupings record for stimulus
Description
(Internal) Update groupings record for stimulus
Usage
updateCompletedGroupingsRecordForStimulus(
groupings_record,
selection,
o,
position
)
Arguments
groupings_record |
a list containing data on completed item sets. |
selection |
a named list containing data on selected item. |
o |
a |
position |
the item position, ranging from 1 to test length. |
Value
updateCompletedGroupingsRecordForStimulus returns
an updated groupings record.
(Internal) Update diagnostic exposure record
Description
updateDiagnosticExposureRecord is an internal function for updating diagnostic exposure record.
This function does not do actual exposure control;
this function is used for updating diagnostic exposure record after exposure control is performed.
Usage
updateDiagnosticExposureRecord(
diagnostic_exposure_record,
j,
exposure_record,
config,
simulation_constants
)
Arguments
diagnostic_exposure_record |
a named list containing diagnostic exposure record. |
j |
the numeric index of the examinee. |
exposure_record |
a named list containing exposure records. |
config |
a |
simulation_constants |
a named list containing simulation constants. |
Value
updateDiagnosticExposureRecord returns an updated diagnostic exposure record.
(Internal) Update eligibility rates based on exposure rates
Description
updateEligibilityRates is an internal function for
updating eligibility rates based on exposure rates.
Usage
updateEligibilityRates(exposure_record, simulation_constants)
Arguments
exposure_record |
a named list containing exposure records. |
simulation_constants |
a named list containing simulation constants. |
Value
updateEligibilityRates returns an updated exposure record.
(Internal) Update segment record
Description
updateSegmentRecord is an internal function for
updating segment record.
Usage
updateSegmentRecord(segment_record, segment_of, j)
Arguments
segment_record |
a named list containing counts on theta segments. |
segment_of |
a named list containing theta segments of this examinee. |
j |
examinee index. |
Value
updateSegmentRecord returns an updated segment record.
(Internal) Update posterior densities
Description
updateThetaPosterior is an internal function
for updating posterior densities using a response probabilty function.
Usage
updateThetaPosterior(o, prob_resp)
Arguments
o |
a named list containing posterior densities and likelihoods. |
prob_resp |
a vector containing response probability on a single response category over a theta grid. |
Value
updateThetaPosterior returns an updated list.
(Internal) Update item usage matrix
Description
updateUsageMatrix is an internal function for
updating an item usage matrix. An item usage matrix is a
(nj, nv) matrix with TRUE or FALSE values.
The rows represent examinees, and the columns represent decision variables.
Usage
updateUsageMatrix(usage_matrix, j, x, simulation_constants)
Arguments
usage_matrix |
a (nj, nv) matrix containing item usage. |
j |
the examinee index. |
x |
an |
simulation_constants |
a named list containing simulation constants. |
Value
updateUsageMatrix returns an updated item usage matrix.
(Internal) Validate constraint (wrapper for other validators)
Description
validateConstraintData is an internal function for
validating a constraint. This is a wrapper function that calls other validator functions
depending on the constraint.
Usage
validateConstraintData(x, attrib)
Arguments
x |
a |
attrib |
an |
Value
validateConstraintData does not return any values;
it stops if the input constraint is not valid.
(Internal) Validate item objects
Description
These are internal functions for validating item objects for their item parameters.
Usage
validateDifficulty(object)
validateSlope(object)
validateGuessing(object)
validateNcat(object)
validateNthr(object)
validateCategory(object)
validateOrder(object)
Arguments
object |
an item object. |
Value
These functions return an error message string if the input object is not valid. These do not return anything for valid objects.
(Internal) Validate constraint condition expression
Description
validateExpression is an internal function for
validating a constraint's condition expression.
Usage
validateExpression(x, attrib, unit_name, use_lt)
Arguments
x |
a |
attrib |
an |
unit_name |
|
use_lt |
if |
Value
validateExpression does not return any values;
it stops if the input constraint is not valid.
(Internal) Validate constraint for completeness of its required attribute column
Description
validateFullColumn is an internal function for
validating a constraint for whether its required attribute column is complete (i.e., does not have NA values).
Usage
validateFullColumn(x, attrib, class_name)
Arguments
x |
a |
attrib |
an |
class_name |
|
Value
validateFullColumn does not return any values;
it stops if the input constraint is not valid.
(Internal) Validate constraint lower/upper bounds
Description
validateLBUB is an internal function for
validating a constraint's lower/upper bounds.
Usage
validateLBUB(x, allow_range = TRUE)
Arguments
x |
a |
allow_range |
whether to allow unequal LB and UB values as valid. (default = |
Value
validateLBUB does not return any values;
it stops if the input constraint is not valid.
(Internal) Validate solver for interactive use
Description
validateSolver is an internal function for
validating whether the solver is appropriate for the task.
Usage
validateSolver(config, constraints, purpose = NULL)
Arguments
config |
a |
constraints |
a |
purpose |
the purpose of the task. If |
Value
validateSolver returns TRUE or FALSE.