% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/acc_mahalanobis_ratio.R
\name{acc_mahalanobis_ratio}
\alias{acc_mahalanobis_ratio}
\title{Internal function only existing for technical reasons, planned to be removed in
future releases}
\usage{
acc_mahalanobis_ratio(
  resp_vars = NULL,
  study_data,
  label_col = VAR_NAMES,
  item_level = "item_level",
  meta_data = item_level,
  meta_data_v2,
  meta_data_cross_item = "cross-item_level",
  cross_item_level,
  `cross-item_level`
)
}
\arguments{
\item{resp_vars}{\link{variable} the names of the computed variable
containing \code{Mahalanobis} distance ratio}

\item{study_data}{\link{data.frame} the data frame that contains the measurements}

\item{label_col}{\link{variable attribute} the name of the column in the
metadata containing the labels of
the variables}

\item{item_level}{\link{data.frame} the data frame that contains metadata
attributes of study data}

\item{meta_data}{\link{data.frame} old name for \code{item_level}}

\item{meta_data_v2}{\link{character} path or file name of the workbook like
metadata file, see
\code{\link{prep_load_workbook_like_file}} for details.
\strong{ALL LOADED DATAFRAMES WILL BE PURGED},
using \code{\link{prep_purge_data_frame_cache}},
if you specify \code{meta_data_v2}}

\item{meta_data_cross_item}{\link{data.frame} -- Cross-item level metadata}

\item{cross_item_level}{\link{data.frame} alias for \code{meta_data_cross_item}}

\item{`cross-item_level`}{\link{data.frame} alias for \code{meta_data_cross_item}}
}
\value{
a list with:
\itemize{
\item \code{SummaryData}: \link{data.frame} underlying the plot with user friendly caption
\item \code{SummaryTable}: \link{data.frame} underlying the plot
\item \code{SummaryPlot}: \link[ggplot2:ggplot2]{ggplot2::ggplot2} Q-Q plot of squared \code{Mahalanobis}
distances vs. a theoretical
chi-squared distribution showing \code{outliers}.
\item \code{FlaggedStudyData} \link{data.frame} contains the original data frame of the
variables used to calculate
the squared \code{Mahalanobis} distances
with an additional column indicating if
for a group of variables if the
observational unit is a
multivariate \code{outlier}.
}
}
\description{
Please use instead the function \code{\link[=acc_mahalanobis]{acc_mahalanobis()}}

\link{Indicator}
}
\details{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}
}
\section{ALGORITHM OF THIS IMPLEMENTATION:}{
\itemize{
\item Implementation is restricted to variables of type integer
\item Remove missing codes from the study data (if defined in the metadata)
\item The covariance matrix is estimated for all variables of \code{resp_vars}
\item The \code{Mahalanobis} distance of each observation is calculated
\eqn{MD^2_i  = (x_i - \mu)^T \Sigma^{-1} (x_i -  \mu)}
\item The default to consider a value an \code{outlier} is to use the 0.975 quantile
of a theoretical chi-square distribution with degrees of freedom
equals to the number of variables used to calculate the
\code{Mahalanobis} distance (\verb{Mayrhofer and Filzmoser}, 2023)
}
}

\seealso{
\href{https://dataquality.qihs.uni-greifswald.de/VIN_acc_impl_multivariate_outlier.html}{Online Documentation}
}
