# Load required packages and data
library(dplyr)
data(survey_data)
# Basic one-way ANOVA (comparing across education levels)
survey_data %>%
oneway_anova(life_satisfaction, group = education)
# Multiple dependent variables
survey_data %>%
oneway_anova(life_satisfaction, trust_government, group = education)
# Using tidyselect helpers
survey_data %>%
oneway_anova(starts_with("trust_"), group = education)
# Weighted analysis
survey_data %>%
oneway_anova(income, group = education, weights = sampling_weight)
# Grouped analysis (separate ANOVA for each region)
survey_data %>%
group_by(region) %>%
oneway_anova(life_satisfaction, group = education)
# Store results for post-hoc analysis
result <- survey_data %>%
oneway_anova(life_satisfaction, group = education)
# Follow up with post-hoc tests
result %>% tukey_test()
result %>% levene_test() # Check homogeneity of variances
# --- Three-layer output ---
result # compact one-line overview
summary(result) # full detailed output with all sections
summary(result, descriptives = FALSE) # hide group statistics
Run the code above in your browser using DataLab