Description Usage Arguments Value Examples
hgrmDIF
fits a hierarchical graded response model similar to hgrm(), but person-specific
covariates x
are allowed to affect item responses directly (not via the latent preference).
This model can be used to test for the presence of differential item functioning.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
y |
A data frame or matrix of item responses. |
x |
An optional model matrix, including the intercept term, that predicts the mean of the latent preference. If not supplied, only the intercept term is included. |
z |
An optional model matrix, including the intercept term, that predicts the variance of the latent preference. If not supplied, only the intercept term is included. |
x0 |
A matrix specifying the covariates by which differential item functioning operates. If not supplied,
|
items_dif |
The indices of the items for which differential item functioning is tested. |
form_dif |
Form of differential item functioning being tested. Either "uniform" or "non-uniform." |
constr |
The type of constraints used to identify the model: "latent_scale", or "items". The default, "latent_scale" constrains the mean of latent preferences to zero and the geometric mean of prior variance to one; "items" places constraints on item parameters instead and sets the mean of item difficulty parameters to zero and the geometric mean of the discrimination parameters to one. Currently, only "latent_scale" is supported in hgrmDIF(). |
beta_set |
The index of the item for which the discrimination parameter is
restricted to be positive (or negative). It may take any integer value from
1 to |
sign_set |
Logical. Should the discrimination parameter of
the corresponding item (indexed by |
init |
A character string indicating how item parameters are initialized. It can be "naive", "glm", or "irt". |
control |
A list of control values
|
An object of class hgrm
.
coefficients |
A data frame of parameter estimates, standard errors, z values and p values. |
scores |
A data frame of EAP estimates of latent preferences and their approximate standard errors. |
vcov |
Variance-covariance matrix of parameter estimates. |
log_Lik |
The log-likelihood value at convergence. |
N |
Number of units. |
J |
Number of items. |
H |
A vector denoting the number of response categories for each item. |
ylevels |
A list showing the levels of the factorized response categories. |
p |
The number of predictors for the mean equation. |
q |
The number of predictors for the variance equation. |
p0 |
The number of predictors for items with DIF. |
coef_item |
Item coefficient estimates. |
control |
List of control values. |
call |
The matched call. |
1 2 3 4 | y <- nes_econ2008[, -(1:3)]
x <- model.matrix( ~ party * educ, nes_econ2008)
nes_m2 <- hgrmDIF(y, x, items_dif = 1:2)
coef_item(nes_m2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.