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

Description Usage Arguments Details Value See Also Examples

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

1
2
## S3 method for class '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.

Details

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

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).

See Also

generics::augment()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

ItemResponseTrees documentation built on July 2, 2020, 2:25 a.m.