Main function irt_analysis
The main function irt_analysis() automatically performs the required
IRT analyses, returns results in several tables and as text in the
console, and saves the (most important) results as Excel files and in
RDS format. ICC plots and Wright maps can also be generated and saved
(plots = TRUE). If the file names need to be modified (e.g., because a
test is scaled simultaneously for several cohorts), use the function
argument name_group that adds a suffix to each file name (e.g.,
"cohort_6"). The function automatically detects whether the item set
contains polytomous items and accordingly performs either a 1PL and 2PL
analysis (dichotomous items only) or a PCM and GPCM analysis (including
polytomous items). PCM and GPCM are estimated using the ConQuest
parameterisation "item + item*step".
The function performs analyses for a single item set (e.g., all items
selected via the argument select). If IRT analyses are required for
multiple item sets (e.g., easy and difficult test booklets and common
items), but repeated calls to irt_analysis() should be avoided, the
function grouped_irt_analysis() can be used instead (see following
section).
Sometimes, the item parameters for the IRT analyses are already known
and need to be fixed to predetermined values. The function
irt_analysis() provides the possibility to use fixed item
difficulties. Because this function conducts two IRT analyses (1PL and
2PL models for dichotomous items, PCM and GPCM for polytomous or mixed
items), it contains two different function arguments: xsi_fixed_1p and
xsi_fixed_2p. The first argument may contain the fixed item
difficulties for the 1PL model or PCM, while the second argument may
contain the fixed item difficulties for the 2PL model or GPCM. Please
note that the item discrimination parameters from the 2PL model and GPCM
cannot be fixed within this package.
Example code:
# Rasch and 2PL
NEPSroutines::irt_analysis(
resp = resp,
vars = vars,
select = "dich",
valid = "valid",
missing_by_design = -54,
scoring = NULL,
plots = TRUE,
save = TRUE,
print = TRUE,
return = FALSE,
path_results = "results",
path_table = "tables",
path_plots = "plots",
overwrite = TRUE,
digits = 3,
name_group = "all"
)
# PCM and GPCM
NEPSroutines::irt_analysis(
resp = resp,
vars = vars,
select = "mixed",
valid = "valid",
scoring = "scoring",
missing_by_design = -54,
plots = TRUE,
save = TRUE,
print = TRUE,
return = FALSE,
path_results = "results",
path_table = "tables",
path_plots = "plots",
suf_item_names = TRUE,
overwrite = TRUE,
digits = 3,
name_group = "all"
)Information on the individual function arguments can be obtained via the
help function (?irt_analysis).