| Lam_G_test | R Documentation |
Performs Lam's G test, an extension of Cochran's C test, to evaluate the internal consistency of variances. Although it is primarily a variance outlier test rather than a "true" homoscedasticity test such as Levene's test or Bartlett's test, it can still be used conceptually to assess the homogeneity of variances across groups.
Lam_G_test(
data,
formula,
alpha = 0.05,
silent = FALSE,
summary = FALSE,
misc = FALSE,
alternative = c("two.sided", "less", "greater")
)
data |
A data frame containing the variables specified in the formula. |
formula |
A formula of the form |
alpha |
A numeric value specifying the significance level. Must be between 0 and 1. Default is 0.05. |
silent |
A logical value. If |
summary |
A logical value (default: |
misc |
A logical value. If |
alternative |
Character (default: "two.sided"). Specifies the alternative hypothesis. Available options are c("two.sided", "less", "greater"). |
Note:
Under normally distributed data and moderate sample sizes (8 < n < 20),
Lam's G test performs comparably to Bartlett's test. For small sample sizes
(n < 8), it appears to outperform several alternative tests, providing a
favorable balance between Type I and Type II error rates. In contrast, some
alternative methods achieve lower Type I error rates at the cost of
substantially higher Type II error rates. Note that this test is highly
sensitive to outliers.
A list containing the test statistics, p-value, degrees of freedom,
and optionally a summary table and/or auxiliary parameters,
depending on the values of summary and misc.
’T Lam, R. U. E. (2010). Scrutiny of variance results for outliers: Cochran’s test optimized. Analytica Chimica Acta, 659(1–2), 68–84. https://doi.org/10.1016/j.aca.2009.11.032
Brown_Forsythe_test
df0 <- roGFP[[1]]
out <- Lam_G_test(df0, ro ~ grp)
boxplot(ro ~ grp, df0, horizontal = TRUE)
points(x = df0$ro, y = jitter(as.numeric(df0$grp), amount = 0.15))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.