Cambridge/Humboldt Dataset 2: Independent-Samples t-Test

Setup

Run the standard setup from the Student Overview before starting this assignment. This assignment uses cam_1v1w, the 1v1-women subset.

# Drop the unused "Man" level so the grouping factor has exactly 2 levels
cam_1v1w$group <- droplevels(cam_1v1w$group)

Research Question

Do baseline hormones differ between naturally cycling (NC) women and women using oral contraceptives (OC)?

Oral contraceptives suppress the normal hormonal cycle, so this is a natural comparison for any hormone measured at baseline — before the competition even starts.

Variables

Variable Meaning Type
c1 Baseline cortisol Quantitative outcome
t1 Baseline testosterone Quantitative outcome
e1 Baseline estradiol Quantitative outcome
p1 Baseline progesterone Quantitative outcome
group NC Woman / OC Woman Categorical grouping variable

Decision Point 1: What Kind of Analysis Fits?

  1. What is the outcome variable in the worked example below?
  2. Is the outcome quantitative or categorical?
  3. What is the grouping variable?
  4. How many groups are being compared?
  5. Are the groups independent or paired?
  6. Why does an independent-samples t-test fit this question?

Worked Example: Baseline Cortisol

Visualize First

boxplot(c1 ~ group, data = cam_1v1w,
        ylab = "Cortisol (transformed)",
        main = "Baseline Cortisol by Contraceptive Group")

stripchart(c1 ~ group, data = cam_1v1w,
           vertical = TRUE,
           method = "jitter",
           pch = 16,
           add = TRUE)

Descriptive Statistics

aggregate(c1 ~ group, data = cam_1v1w, FUN = mean, na.rm = TRUE)
aggregate(c1 ~ group, data = cam_1v1w, FUN = sd, na.rm = TRUE)
table(cam_1v1w$group)

Hypotheses

Null hypothesis: There is no difference in average baseline cortisol between NC and OC women.

Alternative hypothesis: There is a difference in average baseline cortisol between NC and OC women.

Run the Independent-Samples t-Test

t.test(c1 ~ group, data = cam_1v1w)

Run the Effect Size

library(effsize)
cohen.d(c1 ~ group, data = cam_1v1w, na.rm = TRUE)

Cohen’s d conventions: small ≈ 0.20, medium ≈ 0.50, large ≈ 0.80.

Interpret the Output

Output value Value
Mean baseline cortisol: NC group
Mean baseline cortisol: OC group
Difference between means
t statistic
degrees of freedom
p-value
95% confidence interval for the difference
Cohen’s d
Effect size interpretation (small / medium / large)

Scientific Report

An independent-samples Welch t-test was used to compare baseline cortisol between naturally cycling women and women using oral contraceptives. The NC group had a mean baseline cortisol of ____ (SD = ____), whereas the OC group had a mean of ____ (SD = ____). The difference was [statistically significant / not statistically significant], t(____) = ____, p = ____. Cohen’s d = ____, indicating a [small / medium / large] effect.

Your Turn: Repeat for the Other Three Hormones

Repeat the same workflow (visualize, describe, hypotheses, t-test, Cohen’s d, interpret, report) for t1, e1, and p1.

Hormone NC mean OC mean t df p Cohen’s d
Testosterone (t1)
Estradiol (e1)
Progesterone (p1)

Questions

  1. Which of the four hormones (if any) showed a statistically significant difference between groups?
  2. For the hormones that were not significant, does that mean contraceptive use has no relationship to that hormone in general, or only that this study didn’t detect one? Explain.
  3. Which hormone showed the largest effect size, regardless of significance? Why is effect size worth reporting even when p > .05?

What Can and Can’t We Conclude?

  1. Can we say oral contraceptive use is associated with any of these baseline hormones?
  2. Can we say oral contraceptive use causes a change in these hormones based only on this analysis? Women were not randomly assigned to take the pill — what does that mean for causal claims?
  3. What other variables might confound a relationship between contraceptive use and baseline hormones?
  4. Why is cautious language important here, just as it was with the Baby Dataset’s smoking analysis?