This function is only suitable to analyze residuals of ANOVA models. It must not be used to analyze residuals from regression or ANCOVA models.
residuals' normality test and residuals' homoneity test of variances.
library(planex)
library(tidyverse)
baterias <- mutate(baterias,
temperatura = as.factor(temperatura),
tipo = as.factor(tipo)
)
mod <- aov(tempo ~ temperatura*tipo, data=baterias)
testResiduals(mod)
#>
#> Shapiro-Wilk normality test
#>
#> data: resid
#> W = 0.97606, p-value = 0.6117
#>
#> ------------------------------------------
#> Bartlett test of Homogeneity of Variances:
#> Bartlett's K-squared df p.value
#> temperatura 3.311821 2 0.1909182
#> tipo 3.173694 2 0.2045696
#>
#> -----------------------------------------------
#> Durbin-Watson Test for Autocorrelated Errors:
#> lag Autocorrelation D-W Statistic p-value
#> 1 -0.3751937 2.713482 0.366
#> Alternative hypothesis: rho != 0