% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/equating.R
\name{equate_tests}
\alias{equate_tests}
\title{Equate two test calibrations through their common items}
\usage{
equate_tests(fit, reference, shift = c("mean", "none"))
}
\arguments{
\item{fit}{A fitted object from \code{\link{rasch}}.}

\item{reference}{A second \code{\link{rasch}} fit, or a data frame with
columns \code{item}, \code{location}, and optionally \code{se}.}

\item{shift}{\code{"mean"} (default) allows a scale shift between the two
analyses; \code{"none"} compares raw locations, appropriate when both
analyses are already on a shared (anchored) scale.}
}
\value{
A list with the comparison \code{table} (locations, standard
  errors, difference, t, raw and BH-adjusted p, drift flag), the
  estimated \code{shift},
  the location \code{correlation}, the root mean square difference after
  shifting (\code{rmsd}), and the number of common items \code{n}.
}
\description{
Compares the item locations of a fit with those of a second fit (or a
reference table such as an item bank), matched by item name. A scale
shift between the two origins is estimated by the precision-weighted mean
difference, and each common item is then tested against the shifted
identity line; flagged items show drift and weaken the equating link.
}
\examples{
set.seed(1); d <- seq(-1.5, 1.5, length.out = 8)
mk <- function() {
  X <- matrix(rbinom(400 * 8, 1, plogis(outer(rnorm(400), d, "-"))), 400, 8)
  colnames(X) <- paste0("I", 1:8); rasch(X)
}
eq <- equate_tests(mk(), mk())
eq$table
}
