Item Characteristic Curve (ICC) IRT modelinin vizual təqdimatıdır və CAT sistemlərinin anlaşılması üçün əsasdır. Bu bölmədə ICC əyrilərini yaratmaq və təhlil etmək üçün müxtəlif funksiyalar öyrənəcəksiniz.
ICC əyrisi test tapşırığının xarakteristikalarını vizual olaraq göstərir və qabiliyyət səviyyəsi ilə doğru cavab ehtimalı arasındakı əlaqəni təsvir edir.
ICC əyrisi 3-parametr logistik (3PL) modelinə əsaslanır:
\[P(\theta) = c + \frac{1-c}{1 + e^{-a(\theta - b)}}\]
Bu tənliyin alternativ yazılışı: \[P(\theta) = c + (1-c) \cdot \text{plogis}(a(\theta - b))\]
# ICC əyrisinin riyazi əsaslarını göstərək
demonstrate_icc_formula <- function() {
theta <- seq(-4, 4, 0.1)
a <- 1.5; b <- 0.5; c <- 0.25
# Müxtəlif hesablama üsulları
method1 <- c + (1 - c) / (1 + exp(-a * (theta - b)))
method2 <- c + (1 - c) * plogis(a * (theta - b))
# Fərqi yoxlayaq
difference <- abs(method1 - method2)
cat("Maksimum fərq iki metod arasında:", max(difference), "\n")
# Əyrinin xarakteristik nöqtələri
prob_at_b <- c + (1 - c) * plogis(a * (b - b)) # theta = b olduqda
cat("Çətinlik parametrində (θ = b) ehtimal:", round(prob_at_b, 3), "\n")
# Alt asimptot və üst asimptot
cat("Alt asimptot (c parametri):", c, "\n")
cat("Üst asimptot:", 1, "\n")
return(method1)
}
demonstrate_icc_formula()
## Maksimum fərq iki metod arasında: 1.110223e-16
## Çətinlik parametrində (θ = b) ehtimal: 0.625
## Alt asimptot (c parametri): 0.25
## Üst asimptot: 1
## [1] 0.2508771 0.2510189 0.2511835 0.2513747 0.2515967 0.2518545 0.2521537
## [8] 0.2525011 0.2529043 0.2533722 0.2539151 0.2545449 0.2552752 0.2561219
## [15] 0.2571033 0.2582402 0.2595568 0.2610805 0.2628430 0.2648802 0.2672330
## [22] 0.2699477 0.2730766 0.2766784 0.2808185 0.2855694 0.2910110 0.2972300
## [29] 0.3043199 0.3123795 0.3215121 0.3318226 0.3434150 0.3563883 0.3708317
## [36] 0.3868191 0.4044028 0.4236064 0.4444188 0.4667879 0.4906160 0.5157578
## [43] 0.5420206 0.5691681 0.5969276 0.6250000 0.6530724 0.6808319 0.7079794
## [50] 0.7342422 0.7593840 0.7832121 0.8055812 0.8263936 0.8455972 0.8631809
## [57] 0.8791683 0.8936117 0.9065850 0.9181774 0.9284879 0.9376205 0.9456801
## [64] 0.9527700 0.9589890 0.9644306 0.9691815 0.9733216 0.9769234 0.9800523
## [71] 0.9827670 0.9851198 0.9871570 0.9889195 0.9904432 0.9917598 0.9928967
## [78] 0.9938781 0.9947248 0.9954551 0.9960849
# ICC çıxarmaq üçün əsas funksiya
plot_icc <- function(a, b, c, title = "Item Characteristic Curve",
theta_range = c(-4, 4)) {
theta <- seq(theta_range[1], theta_range[2], 0.1)
prob <- c + (1 - c) * plogis(a * (theta - b))
plot(theta, prob, type = "l", lwd = 2, col = "blue",
xlab = "Qabiliyyət (θ)", ylab = "Doğru cavab ehtimalı",
main = title, ylim = c(0, 1), xlim = theta_range)
# Köməkçi xətlər
abline(h = 0.5, col = "red", lty = 2, lwd = 1) # 50% xətti
abline(v = b, col = "green", lty = 2, lwd = 1) # Çətinlik parametri
abline(h = c, col = "orange", lty = 3, lwd = 1) # Alt asimptot
# Parametrləri göstər
legend("bottomright",
legend = c(paste("a =", round(a, 2)),
paste("b =", round(b, 2)),
paste("c =", round(c, 3)),
"P = 0.5", "θ = b", "Alt asimptot"),
col = c("blue", "green", "red", "red", "green", "orange"),
lty = c(1, 2, 1, 2, 2, 3),
cex = 0.8)
# Grid əlavə et
grid(col = "lightgray", lty = "dotted")
}
# Nümunə ICC çıxarın
plot_icc(a = 1.5, b = 0.5, c = 0.25, "Nümunə Tapşırıq ICC")
# ggplot2 ilə təkmilləşdirilmiş ICC funksiyası
plot_icc_ggplot <- function(a, b, c, title = "Item Characteristic Curve",
theta_range = c(-4, 4), show_points = FALSE) {
theta <- seq(theta_range[1], theta_range[2], 0.05)
prob <- c + (1 - c) * plogis(a * (theta - b))
# Verilənlər çərçivəsi
df <- data.frame(theta = theta, probability = prob)
# Əsas qrafik
p <- ggplot(df, aes(x = theta, y = probability)) +
geom_line(size = 1.5, color = "blue") +
labs(
title = title,
subtitle = paste("a =", round(a, 2), ", b =", round(b, 2), ", c =", round(c, 3)),
x = "Qabiliyyət Səviyyəsi (θ)",
y = "Doğru Cavab Ehtimalı"
) +
xlim(theta_range[1], theta_range[2]) +
ylim(0, 1) +
theme_minimal() +
theme(
plot.title = element_text(size = 14, face = "bold"),
plot.subtitle = element_text(size = 12),
axis.title = element_text(size = 12),
axis.text = element_text(size = 10)
)
# Köməkçi xətlər
p <- p +
geom_hline(yintercept = 0.5, color = "red", linetype = "dashed", alpha = 0.7) +
geom_vline(xintercept = b, color = "green", linetype = "dashed", alpha = 0.7) +
geom_hline(yintercept = c, color = "orange", linetype = "dotted", alpha = 0.7)
# Nöqtələr əlavə etmək
if (show_points) {
key_points <- data.frame(
theta = c(b, b - 1/a, b + 1/a),
probability = c + (1 - c) * plogis(a * (c(b, b - 1/a, b + 1/a) - b))
)
p <- p + geom_point(data = key_points, color = "red", size = 3)
}
return(p)
}
# Nümunə ggplot ICC
plot_icc_ggplot(a = 1.5, b = 0.5, c = 0.25, "Təkmilləşdirilmiş ICC", show_points = TRUE)
# Çoxlu ICC əyrilərini müqayisə etmək üçün funksiya
compare_multiple_icc <- function(param_list, title = "ICC Əyrilərinin Müqayisəsi") {
theta <- seq(-4, 4, 0.05)
all_curves <- data.frame()
for (i in 1:length(param_list)) {
params <- param_list[[i]]
prob <- params$c + (1 - params$c) * plogis(params$a * (theta - params$b))
curve_data <- data.frame(
theta = theta,
probability = prob,
curve_label = paste0("a=", params$a, ", b=", params$b, ", c=", params$c),
parameter_type = params$label
)
all_curves <- rbind(all_curves, curve_data)
}
ggplot(all_curves, aes(x = theta, y = probability, color = parameter_type)) +
geom_line(size = 1.2) +
labs(
title = title,
x = "Qabiliyyət Səviyyəsi (θ)",
y = "Doğru Cavab Ehtimalı",
color = "Parametr Növü"
) +
theme_minimal() +
theme(legend.position = "bottom") +
guides(color = guide_legend(nrow = 2)) +
scale_color_brewer(type = "qual", palette = "Set2")
}
# Müxtəlif parametrlərlə nümunə
param_examples <- list(
list(a = 0.8, b = 0, c = 0.2, label = "Aşağı Ayrıd Edicilik"),
list(a = 2.0, b = 0, c = 0.2, label = "Yüksək Ayrıd Edicilik"),
list(a = 1.2, b = -1, c = 0.2, label = "Asan Tapşırıq"),
list(a = 1.2, b = 1, c = 0.2, label = "Çətin Tapşırıq"),
list(a = 1.2, b = 0, c = 0.1, label = "Aşağı Təsadüfi Cavab"),
list(a = 1.2, b = 0, c = 0.35, label = "Yüksək Təsadüfi Cavab")
)
compare_multiple_icc(param_examples)
# Fərqli parametr qruplarını müqayisə edin
compare_parameter_groups <- function() {
# Ayrıd edicilik parametrinin təsiri
discrimination_effects <- list(
list(a = 0.5, b = 0, c = 0.2, label = "a = 0.5"),
list(a = 1.0, b = 0, c = 0.2, label = "a = 1.0"),
list(a = 1.5, b = 0, c = 0.2, label = "a = 1.5"),
list(a = 2.5, b = 0, c = 0.2, label = "a = 2.5")
)
p1 <- compare_multiple_icc(discrimination_effects, "Ayrıd Edicilik Parametrinin Təsiri")
# Çətinlik parametrinin təsiri
difficulty_effects <- list(
list(a = 1.2, b = -1.5, c = 0.2, label = "b = -1.5"),
list(a = 1.2, b = -0.5, c = 0.2, label = "b = -0.5"),
list(a = 1.2, b = 0.5, c = 0.2, label = "b = 0.5"),
list(a = 1.2, b = 1.5, c = 0.2, label = "b = 1.5")
)
p2 <- compare_multiple_icc(difficulty_effects, "Çətinlik Parametrinin Təsiri")
# Təsadüfi cavab parametrinin təsiri
guessing_effects <- list(
list(a = 1.5, b = 0, c = 0.0, label = "c = 0.0"),
list(a = 1.5, b = 0, c = 0.1, label = "c = 0.1"),
list(a = 1.5, b = 0, c = 0.25, label = "c = 0.25"),
list(a = 1.5, b = 0, c = 0.4, label = "c = 0.4")
)
p3 <- compare_multiple_icc(guessing_effects, "Təsadüfi Cavab Parametrinin Təsiri")
# Qrafikleri göstər
print(p1)
print(p2)
print(p3)
}
compare_parameter_groups()
# Parametr dəyişikliklərinin təsirini göstərən funksiya
demonstrate_parameter_effects <- function(base_a = 1.2, base_b = 0, base_c = 0.2) {
cat("=== PARAMETR TƏSİRLƏRİ DEMONSTRASİYASI ===\n\n")
# Əsas parametrlər
cat("Əsas parametrlər: a =", base_a, ", b =", base_b, ", c =", base_c, "\n\n")
# Ayrıd edicilik dəyişikliyi
cat("1. AYRID EDİCİLİK PARAMETRİNİN DƏYİŞİKLİYİ:\n")
for (a_val in c(0.5, 1.0, 1.5, 2.0)) {
# θ = 0 və θ = b + 1 nöqtələrində ehtimalları hesablayın
prob_0 <- base_c + (1 - base_c) * plogis(a_val * (0 - base_b))
prob_b1 <- base_c + (1 - base_c) * plogis(a_val * ((base_b + 1) - base_b))
cat(" a =", a_val, "→ P(θ=0) =", round(prob_0, 3),
", P(θ=b+1) =", round(prob_b1, 3), "\n")
}
cat("\n2. ÇƏTİNLİK PARAMETRİNİN DƏYİŞİKLİYİ:\n")
for (b_val in c(-1, 0, 1, 2)) {
# θ = 0 nöqtəsində ehtimalı hesablayın
prob_0 <- base_c + (1 - base_c) * plogis(base_a * (0 - b_val))
cat(" b =", b_val, "→ P(θ=0) =", round(prob_0, 3), "\n")
}
cat("\n3. TƏSADÜFI CAVAB PARAMETRİNİN DƏYİŞİKLİYİ:\n")
for (c_val in c(0.0, 0.1, 0.2, 0.3)) {
# θ = -∞ və θ = +∞ asimptotları
prob_min <- c_val # θ → -∞
prob_max <- 1 # θ → +∞
cat(" c =", c_val, "→ Alt asimptot =", prob_min,
", Üst asimptot =", prob_max, "\n")
}
}
demonstrate_parameter_effects()
## === PARAMETR TƏSİRLƏRİ DEMONSTRASİYASI ===
##
## Əsas parametrlər: a = 1.2 , b = 0 , c = 0.2
##
## 1. AYRID EDİCİLİK PARAMETRİNİN DƏYİŞİKLİYİ:
## a = 0.5 → P(θ=0) = 0.6 , P(θ=b+1) = 0.698
## a = 1 → P(θ=0) = 0.6 , P(θ=b+1) = 0.785
## a = 1.5 → P(θ=0) = 0.6 , P(θ=b+1) = 0.854
## a = 2 → P(θ=0) = 0.6 , P(θ=b+1) = 0.905
##
## 2. ÇƏTİNLİK PARAMETRİNİN DƏYİŞİKLİYİ:
## b = -1 → P(θ=0) = 0.815
## b = 0 → P(θ=0) = 0.6
## b = 1 → P(θ=0) = 0.385
## b = 2 → P(θ=0) = 0.267
##
## 3. TƏSADÜFI CAVAB PARAMETRİNİN DƏYİŞİKLİYİ:
## c = 0 → Alt asimptot = 0 , Üst asimptot = 1
## c = 0.1 → Alt asimptot = 0.1 , Üst asimptot = 1
## c = 0.2 → Alt asimptot = 0.2 , Üst asimptot = 1
## c = 0.3 → Alt asimptot = 0.3 , Üst asimptot = 1
# ICC əyrisinin vacib nöqtələrini hesablayan funksiya
calculate_icc_points <- function(a, b, c) {
# Vacib θ dəyərləri
theta_values <- c(
b - 2/a, # Aşağı əyilmə nöqtəsi
b - 1/a, # Alt inflection
b, # Çətinlik parametri
b + 1/a, # Üst inflection
b + 2/a # Yuxarı əyilmə nöqtəsi
)
# Müvafiq ehtimallar
probabilities <- c + (1 - c) * plogis(a * (theta_values - b))
# Nəticələr cədvəli
results <- data.frame(
Point = c("b - 2/a", "b - 1/a", "b (çətinlik)", "b + 1/a", "b + 2/a"),
Theta = round(theta_values, 3),
Probability = round(probabilities, 3),
Description = c(
"Aşağı əyilmə sahəsi",
"Alt inflection nöqtəsi",
"50% ehtimal nöqtəsi",
"Üst inflection nöqtəsi",
"Yuxarı əyilmə sahəsi"
)
)
cat("=== ICC XARAKTERİSTİK NÖQTƏLƏRİ ===\n")
cat("Parametrlər: a =", a, ", b =", b, ", c =", c, "\n\n")
print(results)
return(results)
}
# Nümunə hesablamalar
characteristic_points <- calculate_icc_points(a = 1.5, b = 0.5, c = 0.25)
## === ICC XARAKTERİSTİK NÖQTƏLƏRİ ===
## Parametrlər: a = 1.5 , b = 0.5 , c = 0.25
##
## Point Theta Probability Description
## 1 b - 2/a -0.833 0.339 Aşağı əyilmə sahəsi
## 2 b - 1/a -0.167 0.452 Alt inflection nöqtəsi
## 3 b (çətinlik) 0.500 0.625 50% ehtimal nöqtəsi
## 4 b + 1/a 1.167 0.798 Üst inflection nöqtəsi
## 5 b + 2/a 1.833 0.911 Yuxarı əyilmə sahəsi
# ICC və Test Information Function-u birgə göstərən funksiya
plot_icc_with_info <- function(a, b, c, title = "ICC və Test Məlumat Funksiyası") {
theta <- seq(-4, 4, 0.05)
# ICC hesablayın
prob <- c + (1 - c) * plogis(a * (theta - b))
# Test Information Function hesablayın
# I(θ) = a² * P(θ) * Q(θ) / [c + P(θ) * Q(θ)]²
# Burada P(θ) = (P - c)/(1 - c), Q(θ) = 1 - P(θ)
p_star <- (prob - c) / (1 - c)
q_star <- 1 - p_star
info <- (a^2 * p_star * q_star) / ((c + p_star * q_star)^2)
# Verilənlər çərçivəsi
df <- data.frame(
theta = theta,
probability = prob,
information = info / max(info) # Normallaşdırın 0-1 aralığına
)
# Qrafik yaradın
ggplot(df, aes(x = theta)) +
geom_line(aes(y = probability, color = "ICC"), size = 1.5) +
geom_line(aes(y = information, color = "Məlumat Funksiyası"), size = 1.5) +
labs(
title = title,
subtitle = paste("a =", a, ", b =", b, ", c =", c),
x = "Qabiliyyət Səviyyəsi (θ)",
y = "Dəyər",
color = "Funksiya Növü"
) +
scale_color_manual(values = c("ICC" = "blue", "Məlumat Funksiyası" = "red")) +
theme_minimal() +
theme(legend.position = "bottom")
}
# Nümunə ICC və TIF
plot_icc_with_info(a = 1.5, b = 0.5, c = 0.25)
# Empirik və nəzəri ICC-ni müqayisə etmək üçün simulyasiya
simulate_empirical_icc <- function(a, b, c, n_subjects = 1000, title = "Empirik vs Nəzəri ICC") {
# θ dəyərlərini yaradın
theta_subjects <- rnorm(n_subjects, 0, 1)
# Doğru cavab ehtimallarını hesablayın
true_probs <- c + (1 - c) * plogis(a * (theta_subjects - b))
# Simulyasiya edilmiş cavablar
responses <- rbinom(n_subjects, 1, true_probs)
# Empirik ICC üçün θ qrupları yaradın
theta_groups <- cut(theta_subjects, breaks = 10, include.lowest = TRUE)
empirical_data <- data.frame(
theta = theta_subjects,
response = responses,
group = theta_groups
)
# Qrup ortalamaları
empirical_summary <- empirical_data %>%
group_by(group) %>%
summarise(
theta_mean = mean(theta),
prob_mean = mean(response),
n = n(),
.groups = 'drop'
) %>%
filter(n >= 20) # Kiçik qrupları çıxarın
# Nəzəri ICC
theta_theory <- seq(-4, 4, 0.05)
prob_theory <- c + (1 - c) * plogis(a * (theta_theory - b))
theory_data <- data.frame(
theta = theta_theory,
probability = prob_theory,
type = "Nəzəri"
)
# Qrafik
ggplot() +
geom_line(data = theory_data, aes(x = theta, y = probability, color = "Nəzəri"),
size = 1.5) +
geom_point(data = empirical_summary, aes(x = theta_mean, y = prob_mean, color = "Empirik"),
size = 3, alpha = 0.7) +
geom_smooth(data = empirical_summary, aes(x = theta_mean, y = prob_mean, color = "Empirik"),
method = "loess", se = FALSE, size = 1) +
labs(
title = title,
subtitle = paste("Simulyasiya: a =", a, ", b =", b, ", c =", c, "(N =", n_subjects, ")"),
x = "Qabiliyyət Səviyyəsi (θ)",
y = "Doğru Cavab Ehtimalı",
color = "ICC Növü"
) +
scale_color_manual(values = c("Nəzəri" = "blue", "Empirik" = "red")) +
theme_minimal() +
theme(legend.position = "bottom")
}
# Empirik vs Nəzəri ICC simulyasiyası
set.seed(12345)
simulate_empirical_icc(a = 1.5, b = 0.5, c = 0.25, n_subjects = 1500)
# ICC formasını təhlil edən funksiya
analyze_icc_shape <- function(a, b, c) {
cat("=== ICC FORMA ANALİZİ ===\n")
cat("Parametrlər: a =", a, ", b =", b, ", c =", c, "\n\n")
# Əyrilə xarakteristikası
slope_at_b <- a * (1 - c) * 0.25 # θ = b nöqtəsində əyilmə
cat("Çətinlik nöqtəsində əyilmə:", round(slope_at_b, 3), "\n")
# Asimptotlar
cat("Alt asimptot:", c, "\n")
cat("Üst asimptot:", 1, "\n")
cat("Asimptot aralığı:", round(1 - c, 3), "\n\n")
# Keyfiyyət qiymətləndirilməsi
quality_issues <- c()
if (a < 0.5) {
quality_issues <- c(quality_issues, "Çox aşağı ayrıd edicilik")
}
if (a > 3.0) {
quality_issues <- c(quality_issues, "Həddindən artıq yüksək ayrıd edicilik")
}
if (abs(b) > 3) {
quality_issues <- c(quality_issues, "Həddindən artıq çətinlik")
}
if (c > 0.4) {
quality_issues <- c(quality_issues, "Çox yüksək təsadüfi cavab")
}
if (c < 0) {
quality_issues <- c(quality_issues, "Mənfi təsadüfi cavab parametri")
}
if (length(quality_issues) == 0) {
cat("✅ ICC forması normal aralıqdadır\n")
} else {
cat("⚠️ Potensial problemlər:\n")
for (issue in quality_issues) {
cat(" -", issue, "\n")
}
}
# Praktiki təfsir
cat("\nPRAKTİKİ TƏFSİR:\n")
if (a >= 1.5) {
cat("- Yüksək keyfiyyətli ayrıd edici tapşırıq\n")
} else if (a >= 1.0) {
cat("- Orta keyfiyyətli ayrıd edici tapşırıq\n")
} else {
cat("- Aşağı ayrıd edici tapşırıq, təkmilləşdirməyə ehtiyac var\n")
}
if (abs(b) <= 1) {
cat("- Orta çətinlik səviyyəsində tapşırıq\n")
} else if (abs(b) <= 2) {
cat("- Məhdud qabiliyyət aralığı üçün uyğun\n")
} else {
cat("- Çox məhdud istifadə sahəsi\n")
}
if (c <= 0.25) {
cat("- Təsadüfi cavablama səviyyəsi qəbulediləndir\n")
} else {
cat("- Yüksək təsadüfi cavablama, tapşırıq keyfiyyətini yoxlayın\n")
}
}
# Müxtəlif parametrlərlə forma analizi
analyze_icc_shape(a = 1.5, b = 0.5, c = 0.25)
## === ICC FORMA ANALİZİ ===
## Parametrlər: a = 1.5 , b = 0.5 , c = 0.25
##
## Çətinlik nöqtəsində əyilmə: 0.281
## Alt asimptot: 0.25
## Üst asimptot: 1
## Asimptot aralığı: 0.75
##
## ✅ ICC forması normal aralıqdadır
##
## PRAKTİKİ TƏFSİR:
## - Yüksək keyfiyyətli ayrıd edici tapşırıq
## - Orta çətinlik səviyyəsində tapşırıq
## - Təsadüfi cavablama səviyyəsi qəbulediləndir
##
## --------------------------------------------------
## === ICC FORMA ANALİZİ ===
## Parametrlər: a = 0.8 , b = 2.5 , c = 0.4
##
## Çətinlik nöqtəsində əyilmə: 0.12
## Alt asimptot: 0.4
## Üst asimptot: 1
## Asimptot aralığı: 0.6
##
## ✅ ICC forması normal aralıqdadır
##
## PRAKTİKİ TƏFSİR:
## - Aşağı ayrıd edici tapşırıq, təkmilləşdirməyə ehtiyac var
## - Çox məhdud istifadə sahəsi
## - Yüksək təsadüfi cavablama, tapşırıq keyfiyyətini yoxlayın
Bu bölmədə ICC əyrilərini yaratmaq və təhlil etmək üçün geniş funksiya kitabxanası öyrəndik. ICC vizuallaşdırması IRT parametrlərinin anlaşılması və CAT sistemlərinin optimallaşdırılması üçün əsasdır.
Bölmə 6: Item Bankının Yaradılması və İdarə Edilməsi
Bölmə 7: CAT Adaptiv Alqoritmlərinin Tənzimlənmə