calculate_dmodel.Rd
This function calculates ability estimates and diagnostics from a fitted Rasch model. It prepares the item bank, calculates the corresponding D-score and DAZ, and computes fit statistics for items and persons. It also handles equating and anchoring for the D-score transformation. Results can be returned in either the logit or in the D-score metric.
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
.
An object produced by rasch
.
A named numeric vector of length 2. The names of the vector
must correspond to two item names in data
that will act as anchors
to define the scale units. If specified, the function will update
both tau
and transform
parameters. The default is anchors = NULL
, which
means that the tau
is calculated through the transform
argument.
If specified, the string will be appended to "number of items"_"number of equates".
A string with a provisional key name. If not specified, the
name
is used.
A vector of length 2 with the intercept and slope of the
linear transformation of item difficulties tau
to the D-score scale.
The default c(0, 1) makes all calculations in the logit scale.
Location of the itemtable
for the items.
The default NULL
selects dscore::builtin_itemtable
.
Setting itemtable_from
to ""
creates simple sequential labels.
Setting itemtable_from
to ddata::itemtable
selects the itemtable
object in the ddata
package. Note that items not listed in itemtable
will not ” appear in the itembank
.
See dscore
.
Name of reference to calculate DAZ: See dscore()
Name of prior mean column: See dscore()
A named list or a logical. The named list
has the same structure as the equate
parameter. The argument specifies a
list of all (active and passive) equate groups. Each element specifies
a vector of item names belonging to the same equate group. Setting
background_equate = TRUE
calculates the parameter
from dscore::builtin_itemtable
. The function adds new equate groups
and updates existing equate groups by the corresponding
background_equate
, or overwrite an existing element along
the equate
object for active equates. Setting
background_equate = FALSE
(default) does not specify any passive
equates.
An object of class dmodel
. See details for a description
of the list elements.
if (FALSE) { # \dontrun{
library("dmetric")
library("tidyr")
# test with Dutch items
varlist <- prepare_items(study = "Netherlands 1")
dmo <- fit_dmodel(varlist, name = "Dutch")
} # }