Hypothesis testing

Introduction to Statistics

George Boorman

Curriculum Manager, DataCamp

Why do we need to know about hypothesis testing?

  • Hypothesis testing is used to compare populations

  • Hypothesis testing is everywhere!

    • Can a change in price lead to increased revenue?
    • Will changing a website address result in increased traffic?
    • Is a medication effective in the treatment of a health condition?

hand_with_pills_on_the_palm.jpg

1 Image credit: https://unsplash.com/@towfiqu999999
Introduction to Statistics

The history of hypothesis testing

  • Hypothesis testing dates back to the 1700s!

 

  • Human sex ratio
    • More male births than female births

baby.jpg

1 Image credit: https://unsplash.com/@kellysikkema
Introduction to Statistics

Assume nothing!

  • Start by assuming no difference exists
  • This is called the null hypothesis

 

Male versus female birth ratio

  • Null hypothesis:

    • No difference in gender birth ratio between women who do and do not take vitamin C consumption
  • Alternative hypothesis:

    • A difference exists in gender birth ratio between the two populations
    • More female births occur among women taking vitamin C supplements
Introduction to Statistics

Hypothesis testing workflow

  • Define the target populations
    • Adult women taking or not taking vitamin C supplements
  • Develop null and alternative hypotheses
    • Births are equally like to be male or female in both populations
    • More births are female among women taking vitamin C supplements
  • Collect or access sample data
  • Perform statistical tests on the sample data
  • Draw conclusions about the population

large_crowd_representing_a_population.jpg

group_of_pawns_representing_a_sample.png

Introduction to Statistics

How much data do we need?

baby_sleeping.jpg

  • Central limit theorem
    • Mean male and female births gets closer to the population means as sample size increases
    • Time and resource intensive

 

  • Look at peer-reviewed research on similar hypothesis tests to decide on the sample size
1 Image credit: https://unsplash.com/@jxnsartstudio
Introduction to Statistics

Independent and dependent variables

  • Independent variable:
    • Unaffected by other data
    • Vitamin C supplementation

 

  • Dependent variable:
    • Affected by other data
    • Birth gender ratio
  • Commonly used to describe hypothesis test results

 

scatter_plot_with_dependent_variable_on_x_axis_and_independent_variable_on_y_axis.png

Introduction to Statistics

Let's practice!

Introduction to Statistics

Preparing Video For Download...