Type: Package
Title: Bootstrap Hypothesis Tests for Treatment Effects in One-Way ANOVA with Unequal Variances
Version: 0.2.0
Maintainer: Sagar Salvi <sagarsalvi2713@gmail.com>
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.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.1
NeedsCompilation: no
Packaged: 2025-07-07 08:51:13 UTC; sagar
Author: Sagar Salvi [aut, cre], Diya Somichan [aut], Anjana Mondal [aut]
Repository: CRAN
Date/Publication: 2025-07-10 14:40:02 UTC

Parametric Bootstrap Likelihood Ratio Test (PB_LRT)

Description

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.

Usage

PB_LRT(means, vars, ns, tol = 1e-05, H = 1000, alpha = 0.05)

Arguments

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.

Value

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.

Examples

# 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)


Pairwise Parametric Bootstrap Mean Test (PPBMT)

Description

Performs a parametric bootstrap test to compare all pairwise group means under heteroscedasticity, assuming normality of the data.

Usage

PPBMT(means, vars, ns, B = 1000, alpha = 0.05)

Arguments

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.

Value

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.

Examples

# 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)


Rademacher Wild Pairwise Non-Parametric Bootstrap Test (RWPNPBT)

Description

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.

Usage

RWPNPBT(group_list, B = 1e+05, alpha = 0.05)

Arguments

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.

Details

The test statistic sums the absolute standardized differences between all pairs of group means. Rademacher weights are applied to centered observations for wild bootstrapping.

Value

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.

Examples

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)