── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
✖ dplyr::recode() masks car::recode()
✖ purrr::some() masks car::some()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
theme_set(theme_light())
Assignment Overview
This homework assignment analyzes crayfish growth data from Sargent and Lodge (2014) to examine differences in growth rates between native and invasive populations of rusty crayfish (Orconectes rusticus) across different lake environments using two-way ANOVA.
Learning Objectives
By completing this assignment, you will be able to:
Understand two-way ANOVA concepts and applications
Perform exploratory data analysis for factorial designs
Conduct two-way ANOVA analysis
Test statistical assumptions for ANOVA
Interpret main effects and interactions
Create publication-quality figures
Write scientific methods and results sections
Data Description
The dataset contains growth measurements from a common garden experiment where young-of-year (YOY) rusty crayfish from native (Ohio) and invasive (Wisconsin) populations were grown in enclosures in three northern Wisconsin lakes during summer 2011.
More conservative than η² because it adjusts for bias in small samples
Why Calculate Both?
Eta-squared (η²): Easier to calculate and interpret, but slightly overestimates effect size
Omega-squared (ω²): More accurate, unbiased estimate of population effect size
Effect Size Interpretation Guidelines:
Effect Size η² / ω² Interpretation
Small 0.01 1% of variance explained
Medium 0.06 6% of variance explained
Large 0.14 14% of variance explained
Example Output Interpretation:
If your results show:
eta_squared omega_squared
1 0.21 0.20
This means:
21% of the variance in crayfish growth rate is explained by population range (η²)
20% is the unbiased estimate of variance explained (ω²)
This represents a large effect size (much larger than 0.14)
Population range is a strong predictor of growth rate
Bottom line: Both metrics tell you how much of the differences in crayfish growth can be attributed to whether they’re from native vs. invasive populations, with omega-squared being the more conservative (and accurate) estimate.
4.3 Post-hoc Tests
# Estimated marginal means for main effects
# Pairwise comparisons with Sidak correction
# Estimated marginal means for interaction effect
# Compact letter display for interaction effect
# Custom interaction plot using emmeans results# emmeans_interaction_df <- as.data.frame(emmeans_interaction)# # emmeans_interaction_plot <- emmeans_interaction_df %>%# ggplot(aes(x = lake, y = emmean, color = range, group = range)) +# geom_point(size = 3, position = position_dodge(width=0.2)) +# geom_line(size = 1, position = position_dodge(width=0.2)) +# geom_errorbar(aes(ymin = lower.CL, ymax = upper.CL), # width = 0.1, size = 1,# , position = position_dodge(width=0.2)) +# labs(x = "Lake", # y = "Estimated Marginal Mean Growth Rate (mm/day)",# color = "Range",# title = "Estimated Marginal Means with 95% Confidence Intervals") +# scale_color_manual(values = c("Native" = "coral", "Invasive" = "steelblue")) +# theme_classic()# # emmeans_interaction_plot
a quarto markdown file and dataframe if you modified the original. All of the code should be able to run with what you turn in. (2 points)
a self-contained html file showing the code and output (2 points)
annotations in the quarto file that shows or tells what is being done in the r code chunks describing what you are trying to do - credit will be given even if it does not work as long as you detail what you are doing. As we start to move into more statistics you will be expected to interpret the results. (2 points)