% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/orm_validate.R
\name{orm_validate}
\alias{orm_validate}
\title{Manual validation assistant with Cohen's Kappa}
\usage{
orm_validate(
  mx,
  n_sample = 30L,
  out_dir = "orisma_validation",
  validation_file = NULL,
  seed = 42L,
  lang = getOption("orisma.lang", "en"),
  verbose = getOption("orisma.verbose", TRUE)
)
}
\arguments{
\item{mx}{An \code{orisma_matrix} object from \code{\link[=orm_extract]{orm_extract()}}.}

\item{n_sample}{Integer. Number of records to sample. Default \code{30}.}

\item{out_dir}{Character. Directory to save validation files.}

\item{validation_file}{Character or NULL. Path to a completed validation
CSV (output of a previous \code{orm_validate()} call) for Kappa computation.
If NULL, creates the file for manual review.}

\item{seed}{Integer. Random seed for reproducibility. Default \code{42}.}

\item{lang}{Character. \code{"en"} or \code{"es"}.}

\item{verbose}{Logical.}
}
\value{
If \code{validation_file} is NULL: invisibly returns the path to the
validation CSV. If \code{validation_file} is provided: returns a data frame
with Kappa statistics per category.
}
\description{
\code{orm_validate()} supports methodological validation of ORISMA's automatic
risk extraction by presenting a random sample of classified records for
manual review. It then computes \strong{Cohen's Kappa} to measure agreement
between automatic and manual classification.

This addresses a key peer-review concern: distinguishing between
"category detected by dictionary" and "risk actually evaluated in study".

The function saves a CSV file pre-filled with automatic classifications
that the researcher edits manually, then re-loads for Kappa computation.
}
