rasch.Rd
This function uses pairwise conditional likelihood estimation for estimating item parameters in the Rasch model.
rasch(
data,
shape = c("auto", "wide", "long"),
visit_var = c("subjid", "agedays"),
item_var = "item",
response_var = "response",
items = NULL,
equate = NULL,
b_fixed = NULL,
b_init = NULL,
zerosum = FALSE,
pairs = NULL,
conv = 1e-05,
maxiter = 3000,
progress = FALSE,
save_pairs = FALSE,
save_wide = FALSE
)
A matrix or a data frame with item responses. The data can take
two shapes. In the wide shape the data is a matrix or data frame
with items in columns and visits in the rows. In the long shape the data
is a data frame with item responses in long format, i.e. with
visit identifying variables, a column with item names and a column
with responses. The wide format is simpler to work with, but the long
format allows for more flexibility in the data structure and is more
efficient for large datasets. The responses should be coded as 1
(pass) or
0
(fail). Missing responses are allowed and are coded as NA
.
Character string indicating the shape of the data, either
"wide"
, "long"
or "auto"
. If not specified, the function tries
to determine the shape automatically.
Only relevant for long shape. Character vector with
names of the columns identifying unique visits. Ability is assumed to be
constant for all measurements made during the visit. The default names
are visit_var = c("subjid", "agedays")
.
Only relevant for long shape. Character string with the
name of the column containing item names. The default is item_var = "item"
.
Only relevant for long shape. Character string with
the name of the column containing responses. The default is
response_var = "response"
.
Character vector with item names. If not specified, all columns in the data are included as items (for wide shape) or all items in the item column are included (for long shape).
A named list of active equates. Each list element specifies
a vector of item names belonging to the same equate group. The name
of the list element is the equate group name.
The method restricts the difficulty estimates of items within an
active equate to be identical. Note that a given item should appear
only once in an equate group. The default equate = NULL
does
not to restrict the solution.
Numeric, named vector used for fixing the item parameter estimate to a specific value. The names of the vector indicate the item name to which the fixed value applies.
Numeric, named vector of initial item difficulty estimates.
Under the default (NULL
) values initial values are calculated
internally.
Optional logical indicating whether item difficulties should be centered in each iteration. The default is that no centering is conducted.
A table of counts t(data == 0)
times data == 1
for all items specified by items
.
The default (NULL
) calculates the pairs table for the active item
set in the data. This step can take substantial execution time
in large dataset. In that case, it is recommended to pre-compute the
pairs table and pass it to this function.
Convergence criterion in maximal absolute parameter change
Maximal number of iterations
A logical which displays the iterative process.
Default is FALSE
.
Logical. Save the pairs object in the result?
Logical. Save the data (wide format) in the result?
A list with the following elements:
item
: A character vector containing the names of the items for which
item parameters were estimated.
visit_var
: A character vector with the names of the variables to define
unique visits.
item_var
: The name of the variable containing item names.
response_var
: The name of the variable containing item responses.
ability_var
: The name of the ability variable (e.g, "dscore"
)
shape
: The shape of the data, either "wide"
or "long"
.
b_fixed
: The b_fixed
argument values.
equate
: The equate
argument values.
b_init
: The b_init
argument values.
orphans
: A character vector with item names that are not connected
to any other item in the data.
zerosum
: The zerosum
argument value.
iter
: Iteration counter.
convergence
: Convergence criterion.
item
: Data frame with estimated item parameters (n
, p
, b
).
betapar
: A named vector with negated item difficulties.
call
: The matched call to the function.
pairs
: The pairs table used by the algorithm, if save_pairs
is TRUE
.
May be used to speed up subsequent calls for the same set of items.
wide
: The data in wide format, if save_wide
is TRUE
.
This function is loosely based on sirt::rasch.pairwise.itemcluster()
.
The rasch_wide()
and rasch_long()
functions provide a few special
capabilities:
They allow the user to specify a set of items that should be equated.
They allow the user to fix item parameters to a specific value.
They allow the user to specify a pairs table, which can speed up subsequent calls for the same set of items.
No standard errors are provided by this function. Use resampling methods for conducting statistical inference. Formulas for asymptotic standard errors of this pairwise estimation method are described in Zwinderman (1995).
van der Linden, W. J., & Eggen, T. J. H. M. (1986). An empirical Bayes approach to item banking. Research Report 86-6, University of Twente.
Zwinderman, A. H. (1995). Pairwise parameter estimation in Rasch models. Applied Psychological Measurement, 19, 369-375.