fit_aidif: Fit the AI-DIF model

View source: R/aidif_core.R

fit_aidifR Documentation

Fit the AI-DIF model

Description

The primary estimation function of aiDIF. Runs the robust DIF procedure under both human and AI scoring using the built-in IRLS engine (estimate_robust_scale), then tests for Differential AI Scoring Bias (DASB).

Usage

fit_aidif(
  human_mle,
  ai_mle = NULL,
  alpha = 0.05,
  scale_by = "pooled",
  tol = 1e-07,
  maxit = 100L
)

Arguments

human_mle

A validated mle list for human-scored data.

ai_mle

A validated mle list for AI-scored data, or NULL.

alpha

Significance level. Default 0.05.

scale_by

Denominator for standardising intercept differences: "pooled" (default), "ref", or "focal".

tol

IRLS convergence tolerance. Default 1e-7.

maxit

Maximum IRLS iterations. Default 100.

Value

An object of class "aidif".

See Also

estimate_robust_scale, scoring_bias_test, simulate_aidif_data

Examples

dat <- simulate_aidif_data(n_items = 6, seed = 1)
mod <- fit_aidif(dat$human, dat$ai)
print(mod)
summary(mod)


aiDIF documentation built on April 22, 2026, 1:10 a.m.