This function applies a linear model to a dataset to test the effect of one or more factors. If the conditions of normality and heterosceadiscity are met, an ANOVA test is performed. Otherwise, a non-parametric Kruskal-Walis test is performed.
Utilisation
stat_on_data(
data,
formula_str,
alpha = 0.05,
force_test = NULL,
p.adj = "bonferroni"
)
Arguments
- data
a data.frame with data
- formula_str
a string with model formula, as "
FA UN_BER_PC
~ xp_trt_code"- alpha
alpha value for statistical tests
- force_test
NULL, "anova" or "kruskal". By default set to NULL, and if normality or heteroscedasticity are correct, an Anova test is done, otherwise a Kruskal test is done.
- p.adj
Method for adjusting p values. see agricolae::LSD.test()