Analysis of Variance

anova(df, keep_data_object = FALSE)

Arguments

df

data frame

keep_data_object

logical to keep objects from aov and TukeyHSD

Examples

data(gw_data) wells <- c("MW-1", "MW-2", "MW-3", "MW-4") params <- c("Calcium, dissolved", "Sodium, dissolved", "Sulfate, total") gw_data %>% filter(location_id %in% wells, param_name %in% params) %>% anova()
#> Warning: `cols` is now required. #> Please use `cols = c(pairwise)`
#> # A tibble: 18 x 6 #> param_name rowname diff lwr upr p.adj #> <chr> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 Sodium, dissolved MW-2-MW-1 6.77 2.87 10.7 1.16e- 4 #> 2 Sodium, dissolved MW-3-MW-1 11.4 7.47 15.3 2.42e-10 #> 3 Sodium, dissolved MW-4-MW-1 4.04 0.0335 8.05 4.73e- 2 #> 4 Sodium, dissolved MW-3-MW-2 4.61 0.703 8.51 1.42e- 2 #> 5 Sodium, dissolved MW-4-MW-2 -2.73 -6.73 1.28 2.88e- 1 #> 6 Sodium, dissolved MW-4-MW-3 -7.33 -11.3 -3.32 4.59e- 5 #> 7 Sulfate, total MW-2-MW-1 83.6 65.5 102. 0. #> 8 Sulfate, total MW-3-MW-1 42.2 24.1 60.3 2.41e- 7 #> 9 Sulfate, total MW-4-MW-1 7.12 -11.5 25.7 7.46e- 1 #> 10 Sulfate, total MW-3-MW-2 -41.4 -59.6 -23.3 3.78e- 7 #> 11 Sulfate, total MW-4-MW-2 -76.5 -95.1 -57.9 0. #> 12 Sulfate, total MW-4-MW-3 -35.1 -53.7 -16.5 2.64e- 5 #> 13 Calcium, dissolved MW-2-MW-1 -5.42 -20.6 9.75 7.84e- 1 #> 14 Calcium, dissolved MW-3-MW-1 -15.0 -30.2 0.127 5.28e- 2 #> 15 Calcium, dissolved MW-4-MW-1 14.8 -0.774 30.4 6.85e- 2 #> 16 Calcium, dissolved MW-3-MW-2 -9.62 -24.8 5.55 3.48e- 1 #> 17 Calcium, dissolved MW-4-MW-2 20.2 4.65 35.8 5.67e- 3 #> 18 Calcium, dissolved MW-4-MW-3 29.9 14.3 45.4 1.92e- 5
anova_object <- gw_data %>% filter(location_id %in% wells, param_name %in% params) %>% anova(., keep_data_object = TRUE) plot(anova_object$anova[[1]], 1)