eirm: Estimating explanatory item response modeling using the GLMM...

Description Usage Arguments Value Examples

View source: R/eirm.R

Description

The eirm function estimates explanatory item response models with item-related and person-related covariates. The function requires the data to be in a long format where items are nested within persons. If item responses are polytomous, then the data has to be reformatted using the polyreformat function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
eirm(
  formula,
  data,
  engine = "lme4",
  na.action = "na.omit",
  weights = NULL,
  mustart = NULL,
  etastart = NULL,
  cov.prior = "wishart",
  fixef.prior = NULL,
  control = glmerControl(optimizer = "optimx", calc.derivs = FALSE, optCtrl =
    list(method = "nlminb", starttests = FALSE, kkt = FALSE))
)

Arguments

formula

A regression-like formula that defines item responses as a dependent variable and explanatory predictors as independent predictors. For example, "response ~ -1 + predictor1 + predictor2". Use -1 in the formula to avoid the estimation of an intercept parameter.

data

A data frame in a long format where there are multiple rows for each person (i.e., nested data). The data should involve a variable that represents item responses, a variable that represents persons, and additional predictors to be used for 'explaining' item responses.

engine

Estimation engine with the options of either "lme4" (default) or "blme".

na.action

How missing data should be handled (default: "na.omit").

weights

Weights to be used in the estimation.

mustart, etastart

Model specification arguments for glmer. See glmer for details. Not used when engine = "lme4".

cov.prior

A BLME prior or list of priors with the options of "wishart" (default), "invwishart", "gamma", "invgamma", or NULL to impose a prior over the covariance of the random effects. Not used when engine = "lme4".

fixef.prior

A BLME prior of family "normal", "t", "horseshoe", or NULL (default) to impose a prior over the fixed effects. Not used when engine = "lme4".

control

Control settings for the glmer function in lme4. Note that the optimx package is used by default to speed up the estimation. For higher accuracy in the results, the default lme4 optimizers can be used.

Value

An eirm-class list that includes the EIRM formula used for the estimation, estimated parameters in the model, ability estimates for persons and other random effects (if any), and the complete set of results returned from the glmer function. These results can be used for further analysis and graphics based on lme4.

Examples

1
2
3
4
5
6
7
8
9
data("VerbAgg")
mod0 <- eirm(formula = "r2 ~ -1 + situ + btype + (1|id)", data = VerbAgg)
print(mod0) # To get easiness parameters
print(mod0, difficulty = TRUE) # To get difficulty parameters
plot(mod0)
mod1 <- eirm(formula = "r2 ~ -1 + situ + btype + mode + (1|id)", data = VerbAgg)
print(mod1) # To get easiness parameters
print(mod1, difficulty = TRUE) # To get difficulty parameters
plot(mod1)

eirm documentation built on Oct. 25, 2021, 9:11 a.m.