Learn R Programming

ItemResponseTrees (version 0.2.5)

augment.irtree_fit: Augment data with information from an irtree_fit object

Description

Augment accepts a model object and a dataset and adds information about each observation in the dataset, namely, predicted values in the .fitted column. New columns always begin with a . prefix to avoid overwriting columns in the original dataset.

Usage

# S3 method for irtree_fit
augment(x = NULL, data = NULL, se_fit = TRUE, method = "EAP", ...)

Arguments

x

object of class irtree_fit as returned from fit().

data

Optional data frame that is returned together with the predicted values. Argument is not needed since the data are contained in the fitted object.

se_fit

Logical indicating whether standard errors for the fitted values should be returned as well.

method

This is passed to mirt::fscores() or TAM:::IRT.factor.scores() (as argument type) if applicable.

...

Additional arguments passed to mirt::fscores() or TAM:::IRT.factor.scores() if applicable.

Value

Returns a tibble with one row for each observation and one (two) additional columns for each latent variable if se_fit = FALSE (if se_fit = TRUE). The names of the new columns start with .fit (and .se.fit).

Details

Note that argument method is used only for engines mirt and TAM.

See Also

generics::augment()

Examples

Run this code
# NOT RUN {
data("jackson")
df1 <- jackson[1:234, paste0("C", 1:5)]
irtree_create_template(df1)
m1 <- "
IRT:
t BY C1@1, C2@1, C3@1, C4@1, C5@1;
Class:
GRM"
fit1 <- fit(irtree_model(m1), data = df1)

tidy(fit1, par_type = "difficulty")

glance(fit1)

augment(fit1)
# }

Run the code above in your browser using DataLab