This function creates a standardized output from different Williams test implementations.
Usage
broom_williams(x, method = c("Williams_PMCMRplus", "Williams_JG"), ...)Arguments
- x
A formula object specifying the response variable and the factor for which the test is to be performed, or an object of class 'aov' or 'lm'.
- method
Character string specifying which implementation of Williams test to use: "Williams_PMCMRplus" (default) for PMCMRplus implementation or "Williams_JG" for the drcHelper custom implementation.
- ...
Additional arguments passed to the underlying test functions.
Value
A data frame with standardized test results containing:
- comparison
The comparison being made
- estimate
The estimated difference between groups
- p.value
The p-value for the test
- conf.low
Lower bound of the confidence interval
- conf.high
Upper bound of the confidence interval
- method
The method used for the test
Examples
# Create example data
set.seed(123)
test_data <- data.frame(
dose = factor(rep(c(0, 1, 5, 10), each = 5)),
response = c(rnorm(5, 100, 10), rnorm(5, 90, 10),
rnorm(5, 80, 10), rnorm(5, 70, 10))
)
# Apply Williams test
result <- broom_williams(response ~ dose, data = test_data)
print(result)
#> # A tibble: 3 × 6
#> comparison estimate `t'-stat` `t'-crit` decision method
#> <chr> <dbl> <dbl> <dbl> <chr> <chr>
#> 1 1 - 0 <= 0 -12.4 -1.86 1.75 accept Williams_PMCMRplus
#> 2 5 - 0 <= 0 -18.9 -2.84 1.83 accept Williams_PMCMRplus
#> 3 10 - 0 <= 0 -30.8 -4.64 1.86 accept Williams_PMCMRplus