% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vis_lm_assumptions.R
\name{vis_lm_assumptions}
\alias{vis_lm_assumptions}
\alias{vis_anova_assumptions}
\title{Visualisation of the normality distribution of the standardised residuals}
\usage{
vis_lm_assumptions(samples, fact, cex = 1, regression = FALSE)

vis_anova_assumptions(...)
}
\arguments{
\item{samples}{Numeric vector; the dependent variable.}

\item{fact}{Factor; the independent variable.}

\item{cex}{Numeric; scaling factor for plot text and symbols (default: 1).}

\item{regression}{Logical; if TRUE, skips Bartlett's test (for regression diagnostics). Default is FALSE.}

\item{...}{Arguments passed to \code{vis_lm_assumptions()}.}
}
\value{
A list with elements:
\describe{
  \item{summary_anova}{Summary of the ANOVA model.}
  \item{shapiro_test}{Result from \code{shapiro.test()}.}
  \item{ad_test}{Result from \code{nortest::ad.test()} or a character message if n < 7.}
  \item{levene_test}{Result from \code{levene.test()} (only if \code{regression = FALSE}).}
  \item{bartlett_test}{Result from \code{bartlett.test()} (only if \code{regression = FALSE}).}
  \item{bp_test}{Result from \code{bp.test()} (only if \code{regression = TRUE}).}
}
}
\description{
Checks for normality of the standardised residuals in the general linear model
Student's t-test 
(t.test,var=EQUAL) 
Fisher oneway ANOVA (aov) or simple linear regression.
Performs the Shapiro-Wilk test and Anderson-Darling test for normality and,
if not a regression, also the Levene-Brown-Forsythe and the Bartlett's test for homogeneity of variances.
It produces a histogram with normal overlay, a residuals vs fitted plot,
and a normal Q-Q plot.
}
\examples{
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
vis_lm_assumptions(ToothGrowth$len, ToothGrowth$dose)

}
