| Title: | Bootstrap Hypothesis Tests for Treatment Effects in One-Way ANOVA with Unequal Variances |
|---|---|
| Description: | Implements three test procedures using bootstrap resampling techniques for assessing treatment effects in one-way ANOVA models with unequal variances (heteroscedasticity). It includes a parametric bootstrap likelihood ratio test (PB_LRT()), a pairwise parametric bootstrap mean test (PPBMT()), and a Rademacher wild pairwise non-parametric bootstrap test (RWPNPBT()). These methods provide robust alternatives to classical ANOVA and standard pairwise comparisons when the assumption of homogeneity of variances is violated. |
| Authors: | Sagar Salvi [aut, cre], Diya Somichan [aut], Anjana Mondal [aut] |
| Maintainer: | Sagar Salvi <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-05-18 08:26:24 UTC |
| Source: | https://github.com/cran/bootLRTpairwise |
Performs a parametric bootstrap likelihood ratio test for comparing group means under heteroscedasticity (unequal variances). This test serves as a robust alternative to classical one-way ANOVA when the assumption of equal variances is violated.
PB_LRT(means, vars, ns, tol = 1e-05, H = 1000, alpha = 0.05)PB_LRT(means, vars, ns, tol = 1e-05, H = 1000, alpha = 0.05)
means |
A numeric vector of group sample means. |
vars |
A numeric vector of group sample variances. |
ns |
A numeric vector of group sample sizes. |
tol |
Convergence tolerance for iterative re-estimation under the null hypothesis. Default is 1e-5. |
H |
Number of bootstrap iterations. Default is 1000. |
alpha |
Significance level for the hypothesis test. Default is 0.05. |
A list of class "PB_LRT" containing:
test_statistic |
Observed value of the likelihood ratio statistic. |
critical_value |
Bootstrap-based critical value under the null hypothesis. |
decision |
Conclusion of the hypothesis test. |
# Example with 3 groups set.seed(123) means <- c(5.1, 6.3, 7.0) vars <- c(1.2, 1.8, 2.5) ns <- c(20, 25, 22) result <- PB_LRT(means, vars, ns) print(result)# Example with 3 groups set.seed(123) means <- c(5.1, 6.3, 7.0) vars <- c(1.2, 1.8, 2.5) ns <- c(20, 25, 22) result <- PB_LRT(means, vars, ns) print(result)
Performs a parametric bootstrap test to compare all pairwise group means under heteroscedasticity, assuming normality of the data.
PPBMT(means, vars, ns, B = 1000, alpha = 0.05)PPBMT(means, vars, ns, B = 1000, alpha = 0.05)
means |
A numeric vector containing the sample means for each group. |
vars |
A numeric vector containing the sample variances for each group. |
ns |
An integer vector indicating the sample sizes of each group. |
B |
Number of bootstrap re-samples. Default is 1000. |
alpha |
Significance level for the hypothesis test. Default is 0.05. |
A list of class "PPBMT" containing:
test_statistic |
Observed value of the test statistic. |
critical_value |
Bootstrap-based critical value. |
decision |
Conclusion of the hypothesis test. |
# Example with 3 groups set.seed(123) g1 <- rnorm(20, mean = 5, sd = 1.5) g2 <- rnorm(25, mean = 6.5, sd = 2) g3 <- rnorm(22, mean = 7.2, sd = 2.5) means <- c(mean(g1), mean(g2), mean(g3)) vars <- c(var(g1), var(g2), var(g3)) ns <- c(length(g1), length(g2), length(g3)) result <- PPBMT(means, vars, ns, B = 1000, alpha = 0.05) print(result)# Example with 3 groups set.seed(123) g1 <- rnorm(20, mean = 5, sd = 1.5) g2 <- rnorm(25, mean = 6.5, sd = 2) g3 <- rnorm(22, mean = 7.2, sd = 2.5) means <- c(mean(g1), mean(g2), mean(g3)) vars <- c(var(g1), var(g2), var(g3)) ns <- c(length(g1), length(g2), length(g3)) result <- PPBMT(means, vars, ns, B = 1000, alpha = 0.05) print(result)
Performs a non-parametric bootstrap test using Rademacher wild bootstrap re-sampling. This test compares all pairwise group means using a standardized distance metric, making it robust to violations of normality and heteroscedasticity.
RWPNPBT(group_list, B = 1e+05, alpha = 0.05)RWPNPBT(group_list, B = 1e+05, alpha = 0.05)
group_list |
A list where each element is a numeric vector of raw observations for a group. |
B |
Number of bootstrap re-samples. Default is 100000. |
alpha |
Significance level for the hypothesis test. Default is 0.05. |
The test statistic sums the absolute standardized differences between all pairs of group means. Rademacher weights are applied to centered observations for wild bootstrapping.
A list of class "RWPNPBT" containing:
test_statistic |
Observed value of the test statistic. |
critical_value |
Bootstrap-based critical value at the given alpha level. |
decision |
Conclusion of the hypothesis test based on the critical value. |
set.seed(123) group1 <- rexp(18, rate = 1/10) # Exponential distribution group2 <- runif(22, min = 10, max = 18) # Uniform distribution group3 <- rchisq(20, df = 5) + 7 # Right-skewed Chi-square + shift RWPNPBT(list(group1, group2, group3), B = 1000)set.seed(123) group1 <- rexp(18, rate = 1/10) # Exponential distribution group2 <- runif(22, min = 10, max = 18) # Uniform distribution group3 <- rchisq(20, df = 5) + 7 # Right-skewed Chi-square + shift RWPNPBT(list(group1, group2, group3), B = 1000)