0% complete — let's begin
Data Science Fundamentals

Drawing Conclusions from Data

Learn to make data-driven decisions using statistical inference, hypothesis testing, and real-world examples from PCCC to Instagram ads.

01 · Introduction

What Is Statistical Inference?

Imagine you're deciding whether to bring an umbrella to class. You look outside—dark clouds, windy—and you think, "It's probably going to rain." You just made an inference. You took limited information (what you can see right now) and drew a conclusion about what's likely to happen.

Statistical inference works the same way, but with data instead of weather. Statistical inference is the process of using data from a sample to draw conclusions about a larger population.

💡 Think in Stories, Not Formulas

Population: Not "all values in set N" → Think: "Every student at PCCC"

Sample: Not "subset of N" → Think: "50 students from your CIS class"

Why? We study the sample to learn about the population—because we can't survey everyone!

Real-World Example 1: The Umbrella Decision

Step 1: Observe

Limited Information

You look outside and see dark clouds. That's your "sample" of information.

Step 2: Infer

Draw Conclusion

Based on past experience (dark clouds → rain), you conclude it'll probably rain. That's inference!

Real-World Example 2: Restaurant Food Quality

Population

All Meals at Restaurant

Every dish the restaurant has ever served and will serve.

Sample

Your 3 Visits

You ate there 3 times, food was great each time. You infer: "This restaurant is good!"

✓ Key Takeaway

We use small pieces of information (samples) to make educated guesses about the bigger picture (population). That's the heart of statistical inference.

02 · Scientific Method

The Roadmap for Research

Before diving into statistics, let's review the scientific method—the backbone of any good research:

1

Ask a Question

What do you want to know? (e.g., "Do PCCC students get enough sleep?")

2

Background Research

Has anyone studied this before? What did they find?

3

Form a Hypothesis

Make an educated guess about the answer.

4

Collect Data

Gather information through surveys, experiments, or observations.

5

Analyze the Data

Crunch the numbers, make charts, look for patterns.

6

Draw Conclusions

What does the data tell you? Does it support your hypothesis?

📚 Running Example: Hazel & Everett

Throughout this guide, we'll follow two students investigating claims about the connection between sleep and academic performance. They want to test:

03 · Study Design

Observational Studies vs. Experiments

Observational Study Experiment
You observe and record what naturally happens without interference. You actively control conditions by assigning treatments to different groups.
Example: Survey students about their sleep and GPA. Example: Randomly assign students to sleep 6 hours or 8 hours, then measure GPAs.
Can show: Associations or correlations Can show: Cause-and-effect relationships
⚠️ Correlation ≠ Causation

Just because two things are related doesn't mean one causes the other. This is where confounding variables come in.

What's a Confounding Variable?

Think of it like this: It's a hidden "third thing" that makes two other things look connected when they're not really causing each other.

Real-World Example 1: Umbrellas and Getting Wet

Observation

Umbrellas → Wet People

You notice people carrying umbrellas are more likely to get wet. Does the umbrella cause wetness?

Confounding Variable

Rain!

People carry umbrellas when it's raining. Rain causes both umbrella-carrying AND getting wet. The umbrella doesn't cause wetness!

Real-World Example 2: Ice Cream and Drowning

Observation

Ice Cream Sales → Drowning Deaths

Cities with high ice cream sales have more drowning deaths. Does ice cream cause drowning?

Confounding Variable

Summer Heat!

Hot weather increases ice cream sales AND swimming (more drowning risk). Temperature affects both variables.

✓ The Solution: Random Assignment

In controlled experiments, when you randomly assign people to groups (Treatment A vs. Treatment B), confounding factors get equally distributed. This lets you make causal claims!

✏️ Practice Problems

Problem 3: You randomly assign 50 students to group study and 50 to solo study. Group students average 82 points, solo students average 76. p-value = 0.04. Can you claim group study CAUSES higher scores?
No—this is an observational study
Yes—this is a controlled experiment with random assignment. We can make causal claims!
No—p-value needs to be < 0.01 for causation
Yes—correlation always implies causation
Problem 4: Ice cream sales and crime rates have correlation r = 0.85. What's the confounding variable?
Ice cream causes crime
Crime causes ice cream sales
Temperature/weather—hot weather increases both ice cream sales AND outdoor crime opportunities
There is no confounding variable
04 · Statistical Significance

What Does "Statistically Significant" Mean?

💡 Think in Stories: Basketball Free Throws

Your friend claims he never misses a free throw. You watch him take 10 shots, and he misses 7.

What do you think? "He was clearly lying!"

Why? Because missing 7 out of 10 is too weird if he truly never misses.

That gut feeling = Statistical Significance

Plain English Definition

A result is statistically significant if it's so rare that we don't believe it happened by luck alone.

"This is too weird to be just chance—something else must be going on."

What it DOES mean

This result is too rare to be explained by random chance alone (assuming nothing special is happening).

What it does NOT mean

It doesn't mean the result is good, correct, or important. Just that it's unlikely to be pure luck.

Example: Testing Michael's Coin

1

Set Up Hypotheses

H₀ (Null): The coin is fair (50% heads)
Hₐ (Alternative): The coin is NOT fair

2

Collect Data

Flip the coin 25 times → observe 21 heads

3

How Weird Is This?

If fair, we'd expect ~12-13 heads. But we got 21! That's way off.

4

Calculate P-Value

Simulate 1,000 fair coin flips (25 each). Only 2 out of 1,000 got 21+ heads → p-value = 0.002

5

Decision

p-value (0.002) < 0.05 threshold → Reject H₀. The coin is probably not fair!

💡 What Is a P-Value? (Plain English)

Think in stories, not formulas:

Formula way: "Probability of observing data at least as extreme as what we got, assuming H₀ is true"

Story way: "Assuming nothing special is happening, how often would we see something this weird or weirder?"

Even simpler: "How surprising is my result if the coin is fair / nothing is going on?"

✏️ Practice Problem

Problem 1: You flip a coin 30 times and get 22 tails. You run a simulation assuming the coin is fair. Out of 1,000 simulations, only 8 produced 22+ tails. What's the p-value, and what do you conclude?
p-value = 0.22; fail to reject H₀
p-value = 0.008; reject H₀—coin is probably biased toward tails
p-value = 0.008; fail to reject H₀
p-value = 0.73; reject H₀
05 · Key Terms

Hypothesis Testing Vocabulary

Term Formula Definition Story Definition
Null Hypothesis (H₀) Default assumption; nothing special happening "The coin is fair" / "Sleep doesn't affect GPA"
Alternative Hypothesis (Hₐ) What you're trying to prove "The coin is biased" / "Sleep DOES affect GPA"
P-value P(data | H₀) "How surprising is my result if H₀ is true?"
Significance Level (α) Threshold for p-value "How weird is weird enough?" (Usually 0.05 = 5%)
Statistic Summary value from sample "21 heads in 25 flips" / "Average GPA = 3.97"
✓ When to Reject H₀

If p-value < 0.05 (or your chosen α), reject the null hypothesis. This means your result is statistically significant—too weird to be just chance!

06 · Types of Inference

Three Main Types

1. Inference for a Proportion

When to use: Studying what percentage/fraction of a population has a characteristic.

Example question: "What proportion of PCCC students get 8+ hours of sleep?"

Hypotheses

H₀: Proportion = 0.5 (national average)
Hₐ: Proportion < 0.5

Data

Sample: 32.8% (0.328) of students get 8+ hours of sleep

Simulation: 1,000 Samples Assuming H₀ is True
📊 Reading the Chart

Most simulations cluster around 0.5 (the peak). Our observed 0.328 is way out in the left tail—super rare!

p-value = 0.005 means only 5 out of 1,000 simulations produced results as extreme as 0.328.

"If nothing special is happening, most results look like the middle. Our result is way out in the rare zone, so something special probably IS happening!"

✏️ Practice Problem

Problem 2: You survey 80 PCCC students: 28 get 8+ hours of sleep (35%). National average is 50%. If p-value = 0.03, what does this mean in plain English?
PCCC students sleep more than the national average
If PCCC matched the national average, we'd only see a result this low 3% of the time by chance. PCCC students likely sleep less.
The result is not statistically significant
35% of students need more sleep

2. Inference for a Mean (t-tests)

When to use: Studying the average value of a continuous variable.

Example question: "Is the average GPA at our school higher than the national average?"

One-Sample t-test

Compares sample mean to a known population value (e.g., "Is our GPA different from 3.0?")

Two-Sample t-test

Compares means of two groups (e.g., "Do group study students score higher than solo students?")

📚 Hazel & Everett's Data

H₀: Mean GPA = 3.0
Hₐ: Mean GPA > 3.0

Sample: They surveyed students at their school (not everyone—maybe 50-100 students). Sample mean = 3.97

Why sample? Time, resources, practical constraints—even in a small school, 100% participation is hard!

Analysis: One-sample t-test → t-statistic = 21.796, p < 0.001

Plain English: If the true GPA were 3.0, getting a sample mean of 3.97 is extremely unlikely. We reject H₀—the school's GPA is significantly higher than 3.0!

3. Inference for a Correlation

When to use: Studying whether two continuous variables are related.

Example question: "Is there a relationship between hours of sleep and GPA?"

Correlation (r)

r = +1: Perfect positive relationship
r = 0: No linear relationship
r = -1: Perfect negative relationship

Hazel & Everett

H₀: r = 0 (no relationship)
Hₐ: r > 0 (positive relationship)
Data: Sample r = 0.47

⚠️ Remember: Correlation ≠ Causation

Finding r = 0.47 does NOT prove that sleep causes higher GPAs. This is an observational study—confounding variables could be at play!

To prove causation, you'd need a controlled experiment with random assignment.

07 · Type I and Type II Errors

No Test Is Perfect

Sometimes you'll make the wrong decision. Here are the two types of errors:

Type I Error (False Positive)

What it is: Rejecting H₀ when it's actually true

Plain English: You think something is happening when it's not

Example: You conclude sleep and GPA are related when they're actually not

Analogy: Fire alarm goes off when there's no fire

Type II Error (False Negative)

What it is: Failing to reject H₀ when it's actually false

Plain English: You miss something that's actually happening

Example: You conclude sleep and GPA are NOT related when they actually are

Analogy: Fire alarm doesn't go off when there IS a fire

✏️ Practice Problem

Problem 5: You're testing a focus app. H₀: app has no effect. You reject H₀ but the app actually doesn't work. What type of error is this?
Type I Error (False Positive)—you think it works when it doesn't
Type II Error (False Negative)—you miss a real effect
No error—you made the right decision
Type III Error—testing the wrong hypothesis
08 · A/B Testing

Real-World Experiments

Companies use statistical inference through A/B testing—a randomized experiment comparing two versions.

1

Create Two Versions

Version A (control) and Version B (treatment with a change)

2

Randomly Assign Users

Half see Version A, half see Version B

3

Measure Outcomes

Track metrics like clicks, purchases, sign-ups

4

Analyze Results

Use two-sample t-test to see if Version B is significantly better

5

Implement Winner

Roll out the better version to everyone

Real-World Example: Netflix Rating System

Version A

Star Ratings (1-5 stars)

Traditional rating system users were familiar with.

Version B

Thumbs Up/Down

Simpler binary choice. Result: More user engagement → Netflix switched to thumbs!

Real-World Example: Nonprofit Donation Button

A nonprofit wanted to increase donations. They tested button text:

Version Donations Avg Amount % Increase
A: "Find a Borrower" 127 $25.00 —
B: "Invest in Hope" 142 $25.42 +11.8%
✓ Analysis

Two-sample t-test: p-value = 0.023 < 0.05

Plain English: The difference in donation counts is statistically significant. If both buttons were equally effective, we'd only see a difference this large 2.3% of the time by random chance.

Decision: Implement Version B ("Invest in Hope") for all users!

⚠️ Ethics: P-Hacking

P-hacking: Manipulating data or analysis to artificially get p < 0.05. This is unethical!

Examples:

Always be honest with your data and methods!

09 · Summary

Key Takeaways

Statistical Inference

Sample → Population

Use sample data to draw conclusions about a larger population

P-Value

How Weird?

"If H₀ is true, how surprising is my result?"

Significance

p < 0.05

Result is too rare to be just chance—reject H₀

Remember: Think in stories, not formulas. Statistical significance means "too weird to be just luck." Correlation ≠ causation (watch for confounding variables). Only experiments with random assignment can prove causation!

🎓 You've Got This!

Statistical inference is a powerful tool for understanding the world. With these concepts, you can evaluate research claims, make data-driven decisions, and contribute to solving real problems. Keep practicing, stay curious, and remember—every expert was once a beginner!