Comprehensive Guide to Statistical Inference: Two-Sample Analysis, Confidence Intervals, and Quantitative Summaries
Dolphin Therapy Study on Depression
Research Question & Context:
- The study evaluates whether swimming with dolphins reduces depression symptoms compared to a control group (swimming without dolphins).
- The observed sample difference in improvement rates between the two groups is .
- The core statistical question is whether an observed difference of is statistically significant or if it could plausibly occur by random chance under the null hypothesis ().
Hypotheses:
- Null Hypothesis (): Swimming with dolphins has no effect on depression improvement rates (). Any observed difference in the sample is a fluke resulting from small sample size, meaning improvers would have improved regardless of group assignment.
- Alternative Hypothesis (): Swimming with dolphins increases depression improvement rates ().
Sample Data Breakdown:
- Total subjects: .
- Total improvers across both groups: .
- Total non-improvers across both groups: .
- Dolphin group (): improvers, non-improvers ( improvement rate).
- Control group (): improvers, non-improvers ( improvement rate).
- Observed difference: ().
Card Simulation Methodology (3S Strategy):
- To test what differences occur naturally under , simulation is conducted using physical or computer cards:
- cards are labeled "improver" and cards are labeled "non-improver".
- Cards are shuffled and randomly dealt into two piles of (representing the dolphin group and control group).
- The difference in proportions between the two simulated piles () is computed and stored.
- Sample Simulation Trials:
- Trial 1: Dolphin group , Control group , Difference .
- Trial 2: Difference .
- Trial 3: Difference .
- Simulation Results:
- Across initial simulations: Most differences fall in the range of to . Differences up to are rare. Only out of simulations ( ) yielded a difference .
- Across full simulations:
- Mean of simulated differences .
- Standard error () of simulated differences .
- Exactly out of simulations produced a difference .
- Empirical ( ).
Standardized Test Statistic ():
- .
- Both the () and the () provide strong evidence against . The observed difference is statistically significant.
Confidence Interval for Dolphin Study:
- Formula:
- Multiplier for confidence
- Calculation:
- Interval: or to
- Conclusion: Zero () is excluded from the interval. We are confident that swimming with dolphins increases the population improvement rate by between and compared to swimming without dolphins.
Causation vs. Generalization:
- Causation: Yes, causal conclusions are justified because subjects were randomly assigned to treatment groups in a randomized controlled experiment. Random assignment equalizes potential confounding variables between groups.
- Generalization: Generalizing to all depressed individuals is questionable. Subjects were not selected via simple random sampling; outpatients aged to with mild-to-moderate depression were recruited through internet, radio, newspaper, and hospital announcements. They may not represent the general population.
Prediction vs. Causation and Confounding Factors
- Core Distinction:
- When the primary goal is prediction of a response variable rather than establishing causation ( causes ), confounding factors do not invalidate the utility of a predictor variable.
- Examples:
- Smoking and Liver Cancer:
- Smoking correlates with liver cancer primarily due to confounding (smokers drink more alcohol, and alcohol directly causes liver damage/cancer).
- If the objective is solely predicting whether an individual will develop liver cancer or estimating lifespan, smoking remains a valuable predictor variable even if non-causal.
- Temperature and Wildfires:
- Hotter days exhibit higher wildfire incidence due to direct thermal mechanisms (easier ignition/spread) and confounding human mechanisms (higher temperatures prompt more camping, increasing illegal campfires).
- For wildfire forecasting models, temperature serves as a highly effective predictive input regardless of which mechanism dominates.
Comparing Two Proportions: Parental Smoking and Infant Gender
Study Background (Fukuda et al., 2002):
- Investigated whether parental smoking influences the sex ratio of offspring in a Japanese cohort.
- Both parents smokers: births, male births ( male).
- Both parents non-smokers: births, male births ( male).
- Combined cohort: total births, male births ( male).
Hypotheses:
- Null Hypothesis (): (Parental smoking is not associated with child's gender).
- Alternative Hypothesis (): (Two-sided test).
Summary Statistic:
- ( ).
Simulation-Based Analysis ( Replications):
- Mean difference under
- Standard error () ( )
- Empirical
- Simulated
Theory-Based Standard Error Formulas:
- For Hypothesis Testing (Pooled Proportion):
- Assumes is true ().
- Pooled proportion ():
- Test Standard Error formula:
- Calculation:
- Theoretical :
- Theoretical : ( ).
- For Confidence Intervals (Unpooled Proportions):
- Does not assume is true; estimates individual group variances.
- Confidence Interval Standard Error formula:
- Calculation:
- Confidence Interval (): ( to ).
- Confidence Interval (): ( to ).
Validity Conditions for Theoretical Proportions Methods:
- At least observations in each of the four cells of the cross-tabulation table (at least boys and girls in both smoking and non-smoking groups).
Methodological Evaluation & Biases:
- This study was strictly observational; subjects self-selected smoking behavior.
- James (2004) highlighted confounding factors such as social factors, diet, environmental exposures, or stress.
- Publication Bias: Hundreds of sex-ratio studies are performed; non-significant findings often remain unpublished, whereas rare anomalous flukes are accepted for publication.
- Data Anomalies: An overall male proportion of ( female) is unusually high relative to global human baseline birth ratios, suggesting possible recording or sampling errors.
Summary Statistics for Quantitative Data
Visual Summaries:
- Dot Plots: Display individual data points on a numeric scale; stacking vertical dots highlights distributional shape.
- Box Plots: Graphical representation of the five-number summary.
Five-Number Summary & Definitions:
- Minimum: Lowest recorded observation.
- Lower Quartile ( / Percentile): Median of the lower half of data (at or below overall median).
- Median ( / Percentile): Middle boundary value splitting sorted dataset .
- Upper Quartile ( / Percentile): Median of the upper half of data.
- Maximum: Highest recorded observation.
Interquartile Range ():
- Formula:
- Measures spread/variability in quantitative data. It is a single scalar value, not an interval.
Quartile Calculation Conventions:
- Dataset: ( )
- Median (): Boundary falls between and
- Lower Quartile (): Median of lower half ()
- Upper Quartile (): Median of upper half ()
- R Software Convention: Standard course convention uses
type = 2(averaging middle values during ties).type = 1takes the lower minimum boundary point on ties.
Case Study: Old Faithful Geyser Inter-Eruption Times:
- Vertically stacked dot plots and box plots allow direct comparison of eruption intervals between and
- Dataset Summary: , , , Minimum , Maximum .
- Dataset Summary: , , , Median .
- Comparison: In , eruption intervals were shorter on average but exhibited far greater variability () compared to ().
Box Plot Construction & Outlier Rules:
- Box: Extends from to ; vertical bar marks (median).
- Outlier Threshold Boundary: Any observation lower than or higher than is defined as an outlier and plotted as an individual asterisk/symbol.
- Whiskers: Extend outwards to the most extreme data points that are not outliers (do not extend blindly to the exact fence boundary).
Comparing Two Means: Breastfeeding and Infant Intelligence
Study Background (Pediatrics, 1999):
- Investigated whether breastfed infants differ in cognitive intelligence at age compared to bottle-fed infants.
- Cohort: children recruited at birth () across Western Michigan hospitals.
- Measure: General Cognitive Index () at age (known to be normally distributed in the general population).
- Observational study: Parents selected feeding method.
Sample Data Breakdown:
- Breastfed group (): Mean , Sample SD
- Bottle-fed group (): Mean , Sample SD
- Difference in sample means:
Inference & Calculations:
- Standard Error formula for two independent means:
- Calculation:
- Standardized Test Statistic ():
- ( ).
- Confidence Interval ():
- Conclusion: Statistically significant evidence (; CI excludes ) that breastfed children have a significantly higher average GCI score at age than bottle-fed children.
Confounding Variables in Breastfeeding Study:
- Maternal education level (more educated mothers may be more likely to breastfeed and provide greater intellectual stimulation).
- Maternal health status and medication use (unhealthy mothers may be physically unable to breastfeed).
- Time spent directly interacting with infant during feeding.
- Infant baseline health/appetite differences.
Comprehensive Decision Matrix for Standard Errors and Confidence Intervals
Sample Size Thresholds:
- Quantitative data: Sample size is considered large.
- Binary data: At least successes and failures ( and ) is considered large.
Confidence Interval Multipliers (Normal Distribution):
- Confidence Level: Multiplier
- Confidence Level: Multiplier
- Confidence Level: Multiplier
One-Sample Quantitative Data:
- Formula:
- If and population is normal with unknown , substitute (from t-distribution) for .
One-Sample Binary Data:
- Formula:
- Note: Binary proportions are mathematically equivalent to numeric mean formulas where data values are strictly and , with and .
Two-Sample Quantitative Data:
- Formula:
Two-Sample Binary Data:
- Confidence Interval Formula:
- Hypothesis Testing Formula: where .
Review Problems and Exam Questions
Problem 1: NCIS Viewing and Mortality:
- Scenario: NCIS was a top-rated TV show in . A study finds that people who watch NCIS are much more likely to die than non-viewers. Can we conclude NCIS is dangerous to watch?
- Answer: No. Age is a severe confounding factor in this observational study; the median age of an NCIS viewer is .
Problem 2: Systolic Blood Pressure Sampling:
- Scenario: Adult population mean systolic blood pressure , . Simple random sample of adults taken.
- Question 1: How much does a typical adult's blood pressure differ from ?
- Answer: (Population standard deviation ).
- Question 2: How much does a typical sample mean of size differ from ?
- Answer: ().
Problem 3: UCLA vs. Second Graders Blood Sugar:
- Data: UCLA students (, , ). Second graders (, , ).
- Question A: Find a confidence interval for how much lower an average UCLA student's blood glucose level is than a second grader's ( ).
- Observed Difference:
- CI:
- Question B: Is this difference statistically significant?
- Answer: Yes, because the confidence interval does not contain zero.
- Question C: Study classification?
- Answer: Observational study. Explanatory variable is grade/education level (UCLA vs second grader).
- Question D: Does attending UCLA cause blood sugar to drop?
- Answer: No, age is a confounding variable; second graders consume more sugary food/candy.
- Question E: The mean blood sugar level of ALL UCLA students is a:
- Answer: Population parameter.
- Question F: How much would another sample difference typically be off by?
- Answer: (Standard Error of the difference).
- Question G: How much does one UCLA student's blood sugar differ from the mean typically?
- Answer: (Sample standard deviation of UCLA group).
Questions & Student Discussion
- Decimal Rounding on Exams:
- Final numerical answers should be rounded to decimal places. Avoid rounding intermediate steps to prevent rounding errors.
- Significance Threshold ():
- Default significance level is ( ) unless explicitly specified otherwise in a problem.
- vs. Criteria:
- Both statistics always yield consistent conclusions. If any ambiguity occurs, trust the as the primary decision metric.
- Exam Requirements:
- No R coding syntax (e.g.,
pnorm,pt) is required to be executed or written during exams.
- No R coding syntax (e.g.,