% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-calc.R
\name{icc_calc_anova}
\alias{icc_calc_anova}
\title{Calculate ANOVA for ICC Models}
\usage{
icc_calc_anova(data_matrix, model_type, interaction = TRUE)
}
\arguments{
\item{data_matrix}{Numeric matrix. Standardized data matrix from \code{icc_preprocess_data}.}

\item{model_type}{Character. Model type: "oneway" (one-way random) or "twoway" (two-way).}

\item{interaction}{Logical. Default \code{TRUE}. Whether to include subject×rater interaction
term for two-way models (follows standard literature settings). If FALSE, rater effect
is pooled into the residual term.}
}
\value{
A named list containing ANOVA results:
\describe{
  \item{MSR}{Numeric. Mean square for subjects (rows).}
  \item{MSC}{Numeric. Mean square for raters (columns) (NULL for one-way model).}
  \item{MSE}{Numeric. Residual mean square (two-way model only).}
  \item{MSW}{Numeric. Within-group mean square (one-way model only).}
  \item{df1}{Integer. Degrees of freedom for subjects (n-1).}
  \item{df2}{Integer. Residual degrees of freedom.}
  \item{df3}{Integer. Degrees of freedom for raters (k-1) (NULL for one-way model).}
  \item{n}{Integer. Number of subjects.}
  \item{k}{Integer. Number of raters.}
}
}
\description{
Unified function to compute mean squares and degrees of freedom for
one-way random and two-way random/mixed ANOVA models. Serves as the
foundational calculation for all ICC types, eliminating redundant code.
}
\keyword{internal}
