estimNLR | R Documentation |
Estimates parameters of nonlinear regression models for DIF detection using either nonlinear least squares or maximum likelihood method with various algorithms.
estimNLR(y, match, group, formula, method, lower, upper, start)
## S3 method for class 'estimNLR'
logLik(object, ...)
## S3 method for class 'estimNLR'
coef(object, ...)
## S3 method for class 'estimNLR'
fitted(object, ...)
## S3 method for class 'estimNLR'
residuals(object, ...)
## S3 method for class 'estimNLR'
print(x, ...)
## S3 method for class 'estimNLR'
vcov(object, sandwich = FALSE, ...)
y |
numeric: binary vector of responses. |
match |
numeric: vector of matching criterion. |
group |
numeric: binary vector of group membership. |
formula |
formula: specification of the model. Can be obtained by the
|
method |
character: method used to estimate parameters. The options are
|
lower |
numeric: lower bounds for parameters of model specified in |
upper |
numeric: upper bounds for parameters of model specified in |
start |
numeric: initial parameters. Can be obtained by the
|
object |
an object of |
... |
other generic parameters for S3 methods. |
x |
an object of |
sandwich |
logical: should be sandwich estimator used for covariance
matrix of parameters when using |
Function offers either non-linear least squares estimation via
nls
function, maximum likelihood method with
"L-BFGS-B"
method via optim
function,
or maximum likelihood method with iteratively reweighted least
squares via glm
function.
Adela Hladka (nee Drabinova)
Institute of Computer Science of the Czech Academy of Sciences
Faculty of Mathematics and Physics, Charles University
hladka@cs.cas.cz
Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz
Hladka, A. (2021). Statistical models for detection of differential item functioning. Dissertation thesis. Faculty of Mathematics and Physics, Charles University.
# loading datadata(GMAT)
y <- GMAT[, 1] # item 1
match <- scale(rowSums(GMAT[, 1:20])) # standardized total score
group <- GMAT[, "group"] # group membership variable
# formula for 3PL model with the same guessing for both groups
M <- formulaNLR(model = "3PLcg", type = "both")
# starting values for 3PL model with the same guessing for item 1
start <- startNLR(GMAT[, 1:20], group, model = "3PLcg", parameterization = "classic")
start <- start[[1]][M$M1$parameters]
# nonlinear least squares
(fit_nls <- estimNLR(
y = y, match = match, group = group,
formula = M$M1$formula, method = "nls",
lower = M$M1$lower, upper = M$M1$upper, start = start
))
coef(fit_nls)
logLik(fit_nls)
vcov(fit_nls)
vcov(fit_nls, sandwich = TRUE)
fitted(fit_nls)
residuals(fit_nls)
# maximum likelihood method
(fit_mle <- estimNLR(
y = y, match = match, group = group,
formula = M$M1$formula, method = "mle",
lower = M$M1$lower, upper = M$M1$upper, start = start
))
coef(fit_mle)
logLik(fit_mle)
vcov(fit_mle)
fitted(fit_mle)
residuals(fit_mle)
# iteratively reweighted least squares for 2PL model
M <- formulaNLR(model = "2PL", parameterization = "logistic")
(fit_irls <- estimNLR(
y = y, match = match, group = group,
formula = M$M1$formula, method = "irls"
))
coef(fit_irls)
logLik(fit_irls)
vcov(fit_irls)
fitted(fit_irls)
residuals(fit_irls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.