% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_opls_model_perm.R
\name{.perm_test_from_table}
\alias{.perm_test_from_table}
\title{Permutation-test summary from an opls_perm out_df table}
\usage{
.perm_test_from_table(
  out_df,
  observed_label = "non-permuted",
  alternative = c("greater", "less"),
  add_one = TRUE,
  na_rm = TRUE
)
}
\arguments{
\item{out_df}{data.frame with columns like q2_comp, r2_comp, aucs_te, aucs_tr,
model (with one row "non-permuted"), and optionally r/r_abs.}

\item{observed_label}{character. Label used in \code{model} for the observed row.}

\item{alternative}{character. "greater" (default) tests obs > perm; "less" tests obs < perm.}

\item{add_one}{logical. If TRUE, uses (1 + count)/(B + 1) p-value correction.}

\item{na_rm}{logical. Drop NA values before computing p-values.}
}
\value{
A list with:
\itemize{
\item \code{observed}: named numeric vector of observed metrics
\item \code{perm}: list of numeric vectors for each metric
\item \code{p_value}: named numeric vector of permutation p-values
\item \code{B}: number of permutations used
}
}
\description{
Takes the \code{out_df} you showed (perm rows + one "non-permuted" row) and returns
observed values, permutation distributions, and permutation p-values.
}
