| ks {irt} | R Documentation |
Item Characteristic Curve Estimation using Kernel Smoothing
Description
Item Characteristic Curve Estimation using Kernel Smoothing
Usage
ks(
resp,
h = NULL,
kernel_func = "gauss",
criterion = NULL,
points = seq(-3, 3, 0.05)
)
Arguments
resp |
A response matrix where each row is the responses of an examinee and each column represents an item.
|
h |
The bandwidth parameter that controls the amount of smoothing.
A small value will decrease the bias whereas increase the sampling
variability. For a standard normally distributed The default value is |
kernel_func |
Choice of kernel function. Possible choices are:
The default value is |
criterion |
The ability estimates for each examinee. The default is
|
points |
The points at which the item characteristic curve will be
calculated. The default value is |
Value
A list with following elements will be returned:
pointsThe quadrature points at which ICC is calculated.
iccA matrix where each cell represents probability of selecting a response (for dichotomous models, probability of correct response). Items are on columns and quadrature points are on rows.
seA matrix of standard errors of each point of
icc. This matrix has the same dimension asicc.criterionThe criterion values used for examinees. If
criterion = NULLthese numbers will be based on sum scores.hThe bandwidth parameter.
Author(s)
Emre Gonulates
Examples
ip <- generate_ip(model = "3PL", n = 50)
true_theta <- rnorm(10000)
resp <- sim_resp(ip = ip, theta = true_theta, prop_missing = 0.3)
kern_output <- ks(resp)
# Plot ICC
i <- 12 # select an item to plot
x <- kern_output$icc[, i]
se <- kern_output$se[, i]
p <- prob(ip = ip[i], theta = kern_output$points)
p <- sapply(p, `[`, 2) # get the probability of correct responses
graph_data <- data.frame(
theta = kern_output$points,
icc = x,
ci_low = sapply(x - qnorm(.975) * se, function(x) max(x, 0)),
ci_high = sapply(x + qnorm(.975) * se, function(x) min(x, 1)),
p = p)
## Not run:
p <- ggplot(data = graph_data) +
geom_line(aes(x = theta, y = icc), color = "blue", alpha = .7, size = 1) +
geom_line(aes(x = theta, y = p), color = "red", size = 1, alpha = .7) +
geom_ribbon(data = graph_data,
aes(x = theta, ymin = ci_low, ymax = ci_high),
alpha = .25) +
ylim(0, 1) +
labs(x = "Theta", y = "Probability",
title = "Item Characteristic Curve") +
theme_bw()
p
## End(Not run)