# Load required packages and data
library(dplyr)
data(survey_data)
# Perform ANOVA followed by Scheffe post-hoc test
anova_result <- survey_data %>%
oneway_anova(life_satisfaction, group = education)
# Scheffe post-hoc comparisons
anova_result %>% scheffe_test()
# Multiple variables
anova_result_multi <- survey_data %>%
oneway_anova(life_satisfaction, income, group = education)
anova_result_multi %>% scheffe_test()
# Weighted analysis
anova_weighted <- survey_data %>%
oneway_anova(life_satisfaction, group = education, weights = sampling_weight)
anova_weighted %>% scheffe_test()
# Grouped analysis
anova_grouped <- survey_data %>%
group_by(region) %>%
oneway_anova(life_satisfaction, group = education)
anova_grouped %>% scheffe_test()
# Custom confidence level (99%)
anova_result %>% scheffe_test(conf.level = 0.99)
Run the code above in your browser using DataLab