Rank-based permutation heteroscedasticity test
Source:R/modern_diagnostics.R
performRankPermutationTest.RdPerforms a non-parametric permutation test based on the rank correlation between absolute residuals and a chosen ordering variable. Significant correlations imply systematic changes in residual spread.
Usage
performRankPermutationTest(
model,
data,
order_by = NULL,
B = 999,
progress = interactive()
)Arguments
- model
A fitted stats::lm object describing the mean structure whose residual variance is to be assessed.
- data
A base::data.frame (or compatible object) containing the variables referenced in
model. The data must include all observations used to fitmodeland should not contain unresolved missing values.- order_by
Optional name of a predictor variable used to rank the observations. Defaults to the first non-intercept term in the model matrix.
- B
Number of permutation replications used to approximate the null distribution.
- progress
Logical toggle for progress reporting during permutations.