Baby
Dataset 1: Descriptive Statistics and Visualization
Setup
Run the standard setup from the Student Overview before starting
this assignment.
Research Goal
Before we run statistical tests, we need to understand the
dataset.
What does birth weight look like in this sample, and what patterns
should we notice before running inferential statistics?
Variables
| Variable |
Meaning |
Type |
bwt |
Baby’s birth weight in ounces |
Quantitative |
gestation |
Length of pregnancy in days |
Quantitative |
age |
Mother’s age in years |
Quantitative |
weight |
Mother’s weight in pounds |
Quantitative |
smoke |
Smoking status; 0 = no, 1 = yes |
Categorical |
par_bi |
Previous birth history; 0 = first-time mother,
1 = has given birth before |
Categorical |
age_group |
Maternal age category; 1 = teens, 2 = 20s,
3 = 30s+ |
Categorical |
Decision
Point 1: What Kind of Variable Is Birth Weight?
- Is
bwt quantitative or categorical?
- What kind of graph is appropriate for one quantitative
variable?
- What descriptive statistics should we report for birth weight?
- Why would the mean alone not be enough?
Part 1: Describe Birth Weight
hist(babies$bwt,
main = "Distribution of Birth Weight",
xlab = "Birth Weight (ounces)")
mean(babies$bwt, na.rm = TRUE)
sd(babies$bwt, na.rm = TRUE)
median(babies$bwt, na.rm = TRUE)
range(babies$bwt, na.rm = TRUE)
Questions
- What is the average birth weight in this sample?
- Is the distribution roughly symmetric, skewed, or unusual?
- Are there possible outliers?
- Would you describe birth weight as highly variable or fairly
consistent? Explain.
Part 2:
Visualize Birth Weight by Smoking Status
boxplot(bwt ~ smoke_bi, data = babies,
names = c("Non-smoker", "Smoker"),
ylab = "Birth Weight (ounces)",
main = "Birth Weight by Smoking Status")
aggregate(bwt ~ smoke_bi, data = babies, FUN = mean, na.rm = TRUE)
aggregate(bwt ~ smoke_bi, data = babies, FUN = sd, na.rm = TRUE)
Decision Point 2: What
Are We Comparing?
- What is the outcome variable?
- What is the grouping variable?
- Is the grouping variable categorical or quantitative?
- How many groups are being compared?
- What statistical test might eventually fit this question?
Questions
- Which group appears to have the higher average birth weight?
- Do the groups look clearly different, slightly different, or very
similar?
- Is there overlap between the groups?
- Why is overlap important when interpreting group differences?
Part 3: Visualize
Birth Weight and Gestation
plot(babies$gestation, babies$bwt,
xlab = "Gestation Length (days)",
ylab = "Birth Weight (ounces)",
main = "Birth Weight by Gestation Length",
pch = 16)
lines(lowess(babies$gestation, babies$bwt), lwd = 2)
Decision
Point 3: What Kind of Relationship Is This?
- Are both variables quantitative?
- Does the plot suggest a positive, negative, or weak
relationship?
- Would a correlation be appropriate later? Why or why not?
- Would a t-test be appropriate for this question? Why or why
not?
First Scientific Summary
Write a short paragraph that includes:
- typical birth weight (mean and SD),
- whether birth weight appears to vary by smoking status,
- whether gestation appears related to birth weight,
- one caution about what we cannot conclude yet,
- one potential confounding variable that could explain a pattern you
observed.