Rank-based permutation heteroscedasticity test¶
Source: R/modern_diagnostics.R ยท Help: ?performRankPermutationTest
Performs 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 = NULL,
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. WhenNULL, the default, the model frame ofmodelis used. It holds the terms of the model rather than its variables (log(x)rather thanx), so a model that transforms a variable needsdata, as does a model with anoffset()term, and so may a fit whoseweightsoroffsetargument is a column of the data, which the model frame holds as(weights)or(offset). 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. Defaults to 999, the default of every resampling test in the package.
progress- Logical toggle for progress reporting during permutations.
Value¶
An htest object containing the observed Spearman
correlation and a permutation-based p-value.
References¶
Hollander, M., Wolfe, D. A., & Chicken, E. (2013). Nonparametric Statistical Methods (3rd ed.). Wiley.