Baby Dataset 4: One-Way ANOVA

Setup

Run the standard setup from the Student Overview before starting this assignment.

Research Question

Does birth weight differ across maternal age groups?

Variables

Variable Meaning Type
bwt Baby’s birth weight in ounces Quantitative outcome
age_group Maternal age category; 1 = teens, 2 = 20s, 3 = 30s+ Categorical grouping variable

Decision Point 1: What Kind of Analysis Fits?

  1. What is the outcome variable?
  2. What is the grouping variable?
  3. How many groups are being compared?
  4. Why does a one-way ANOVA fit this question?
  5. Why would an independent-samples t-test not be enough?

Prepare the Grouping Variable

babies$age_group <- factor(babies$age_group,
                           levels = c(1, 2, 3),
                           labels = c("Teens", "20s", "30s+"))

Visualize First

boxplot(bwt ~ age_group, data = babies,
        ylab = "Birth Weight (ounces)",
        xlab = "Maternal Age Group",
        main = "Birth Weight by Maternal Age Group")

stripchart(bwt ~ age_group, data = babies,
           vertical = TRUE,
           method = "jitter",
           pch = 16,
           add = TRUE)

Descriptive Statistics

aggregate(bwt ~ age_group, data = babies, FUN = mean, na.rm = TRUE)
aggregate(bwt ~ age_group, data = babies, FUN = sd, na.rm = TRUE)
table(babies$age_group)
Age group n Mean birth weight SD
Teens
20s
30s+

Hypotheses

Null hypothesis: Average birth weight is the same across all maternal age groups.

Alternative hypothesis: At least one maternal age group has a different average birth weight.

Run the One-Way ANOVA

model_age <- aov(bwt ~ age_group, data = babies)
summary(model_age)

Calculate the Effect Size

η² (eta-squared) is the effect size for ANOVA. It is the proportion of total variance in birth weight explained by age group. It is reported regardless of whether the result is statistically significant.

# Extract SS values from the ANOVA summary
anova_summary <- summary(model_age)[[1]]
SS_between <- anova_summary["age_group", "Sum Sq"]
SS_total   <- sum(anova_summary["Sum Sq"])
eta_sq     <- SS_between / SS_total
eta_sq

η² conventions: small ≈ .01, medium ≈ .06, large ≈ .14.

Interpret the ANOVA Output

Output value Value
F statistic
df between groups
df within groups
p-value
η²
Effect size interpretation (small / medium / large)

If the ANOVA Is Significant: Post-Hoc Tests

TukeyHSD(model_age)
Comparison Mean difference p-value Significant?
Teens vs 20s
Teens vs 30s+
20s vs 30s+

Scientific Report

A one-way ANOVA was used to compare birth weight across maternal age groups. Mean birth weight was ____ ounces (SD = ____) for teens, ____ ounces (SD = ____) for mothers in their 20s, and ____ ounces (SD = ____) for mothers in their 30s or older. The ANOVA showed that birth weight [did / did not] differ significantly across age groups, F(____, ____) = ____, p = ____. η² = ____, indicating a [small / medium / large] effect. [If significant: Tukey post-hoc tests indicated that ____ differed from ____, p = ____.] These results suggest that maternal age group was [associated / not clearly associated] with birth weight in this sample.

What Can and Can’t We Conclude?

  1. Can we say maternal age group was associated with birth weight?
  2. Does a non-significant result mean birth weight is definitely the same across all age groups?
  3. What other variables might confound the relationship between maternal age and birth weight?
  4. Why is it still useful to report η² even when the result is not significant?