| Continuous | R Documentation |
Performs differential item functioning (DIF) detection for items with
continuous responses using nested linear regression models.
The procedure is an analogue of logistic-regression DIF methods for
dichotomous/ordinal items, but relies on lm.
Continuous(DATA, GROUP, member.type = c("group", "cont"),
match = "score", type = c("both", "udif", "nudif"),
criterion = c("F", "Wald"),
anchor = seq_len(ncol(DATA)),
tested_items = seq_len(ncol(DATA)),
all.cov = FALSE)
DATA |
A numeric matrix or data frame of item responses with
|
GROUP |
A vector of length |
member.type |
Character string specifying the type of membership variable.
|
match |
Matching variable specification passed to the internal matching builder.
Common options include |
type |
Defines the DIF effect tested:
|
criterion |
Test criterion used to compare nested models:
|
anchor |
Integer vector indicating anchor items used to build the matching variable. Default is all items. |
tested_items |
Integer vector indicating which items are tested for DIF. Default is all items. |
all.cov |
Logical; if |
For each tested item i, two nested linear models are fitted:
y ~ MATCH + GROUP + MATCH:GROUP when type = "both"
y ~ MATCH + GROUP when type = "udif"
y ~ MATCH + GROUP + MATCH:GROUP when type = "nudif",
depending on type.
Drops the terms corresponding to the DIF effect(s) being tested.
y ~ MATCH when type = "both"
y ~ MATCH when type = "udif"
y ~ MATCH + GROUP when type = "nudif",
The test statistic is:
an F statistic from nested regression comparison when
criterion = "F";
a Wald chi-square statistic when criterion = "Wald".
The change in explained variance, \Delta R^2, is computed as the
difference in R^2 between M1 and M0.
Coefficient tables are mapped to fixed slots:
(Intercept), MATCH, GROUP, and MATCH:GROUP,
to ensure stable output even if GROUP is internally expanded
(e.g., GROUP1).
A list with components:
Numeric vector of length M containing test statistics for
each tested item (non-tested items are NA).
M \times 4 matrix of parameter estimates for full models
(M1), columns (Intercept), MATCH, GROUP,
MATCH:GROUP.
M \times 4 matrix of standard errors for full models (M1).
List of length M with covariance matrices for M1
(only if all.cov = TRUE).
M \times 4 matrix of parameter estimates for reduced models
(M0).
M \times 4 matrix of standard errors for reduced models (M0).
List of length M with covariance matrices for M0
(only if all.cov = TRUE).
Numeric vector of length M giving
\Delta R^2 = R^2_{M1} - R^2_{M0} for each tested item.
Character string describing the matching option used.
difContinuous, difLogistic.
## Toy example with continuous items
set.seed(123)
N <- 400
M <- 8
## Simulate a continuous "ability"
theta <- rnorm(N)
## Two groups
GROUP <- rep(0:1, each = N/2)
## Continuous item scores (no DIF)
DATA <- sapply(1:M, function(j){
0.5 + 1.0 * theta + rnorm(N, sd = 1)
})
## Add uniform DIF to item 3
DATA[, 3] <- DATA[, 3] + 0.6 * GROUP
## Run Continuous DIF detection
res <- Continuous(DATA = DATA, GROUP = GROUP,
match = "score", type = "both",
criterion = "F")
res$stat
res$deltaR2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.