Baby Dataset 3: Independent-Samples t-Test

Setup

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

Research Question

Do babies whose mothers smoked during pregnancy have different birth weights than babies whose mothers did not smoke?

Variables

Variable Meaning Type
bwt Baby’s birth weight in ounces Quantitative outcome
smoke Smoking status during pregnancy; 0 = no, 1 = yes Categorical grouping variable

Decision Point 1: What Kind of Analysis Fits?

  1. What is the outcome variable?
  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?

Visualize First

boxplot(bwt ~ smoke_bi, data = babies,
        names = c("Non-smoker", "Smoker"),
        ylab = "Birth Weight (ounces)",
        main = "Birth Weight by Maternal Smoking Status")

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

Descriptive Statistics

aggregate(bwt ~ smoke_bi, data = babies, FUN = mean, na.rm = TRUE)
aggregate(bwt ~ smoke_bi, data = babies, FUN = sd, na.rm = TRUE)
table(babies$smoke_bi)
Group n Mean birth weight SD
Non-smoker
Smoker

Hypotheses

Null hypothesis: There is no difference in average birth weight between babies whose mothers smoked and babies whose mothers did not smoke.

Alternative hypothesis: There is a difference in average birth weight between babies whose mothers smoked and babies whose mothers did not smoke.

Run the Independent-Samples t-Test

Use Welch’s t-test, which is the default in R and does not assume equal variances.

t.test(bwt ~ smoke_bi, data = babies)

Run the Effect Size

Cohen’s d is the effect size for an independent-samples t-test. It is reported regardless of whether the result is statistically significant.

library(effsize)
cohen.d(bwt ~ smoke_bi, data = babies, na.rm = TRUE)

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

Interpret the Output

Output value Value
Mean birth weight: non-smoker group
Mean birth weight: smoker 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 birth weight between babies whose mothers smoked during pregnancy and babies whose mothers did not smoke. Babies in the non-smoking group had a mean birth weight of ____ ounces (SD = ____), whereas babies in the smoking group had a mean birth weight of ____ ounces (SD = ____). The difference was [statistically significant / not statistically significant], t(____) = ____, p = ____. The mean difference was approximately ____ ounces (95% CI [____, ____]). Cohen’s d = ____, indicating a [small / medium / large] effect.

What Can and Can’t We Conclude?

  1. Can we say smoking status was associated with birth weight?
  2. Can we say smoking caused lower birth weight based only on this analysis?
  3. What other variables might confound this relationship?
  4. Why is cautious language important?