This function performs Dunnett's test for comparing multiple treatment levels to a control using various model specifications, including options for random effects and variance structures.
Usage
dunnett_test(
data,
response_var = "Response",
dose_var = "Dose",
tank_var = "Tank",
control_level = NULL,
include_random_effect = TRUE,
variance_structure = c("homoscedastic", "heteroscedastic"),
alpha = 0.05,
conf_level = 0.95,
return_model = FALSE,
alternative = c("two.sided", "greater", "less")
)Arguments
- data
A data frame containing the dose-response data
- response_var
Name of the response variable column
- dose_var
Name of the dose/treatment variable column
- tank_var
Name of the blocking/tank variable column (optional)
- control_level
The level of dose_var to use as control (default is minimum dose)
- include_random_effect
Logical, whether to include random effects for blocks/tanks
- variance_structure
Character, specifying the variance structure: "homoscedastic" (default) or "heteroscedastic"
- alpha
Significance level for determining NOEC (default = 0.05)
- conf_level
Confidence level for intervals (default = 0.95)
- return_model
Logical, whether to return the fitted model object (default = FALSE)
- alternative
a character string specifying the alternative hypothesis, must be one of '"two.sided"' (default), '"greater"' or '"less"'.