Data Science Classroom Series – 17/Nov/2021

Concept of Hypothesis Testing

  • We calculate the statistic by standardizing and we check if that value is in rejection region. If the statistic (test of the hypothesis) we found in rejection region we reject the null hypothesis else we accept the null hypothesis Preview

Errors in Hypothesis Testing

  • Errors in Hypothesis testing are of two types

    • Type I Error:
      • Reject a true null hypothesis
      • This depends on significance level
      • Can be represented as False Positive
    • Type II Error
      • Accept a false null Hypothesis
      • This is represented by beta
      • False Negative
      • Rejecting a false Null hypothesis is (1-beta) => Goal of hypothesis testing a.k.a power of test
  • Status Quo (H0) Preview Preview

  • Hypothesis Testing Can be done for

    • Single Population
    • Multiple Populations
  • Lets Start By doing an example on Single Population with known Population variance.

    • Glass door has published a research where mean data scientist salary is 113k
    • This attached sample has known standard deviation of 15000 $
    • Try to do hypothesis testing to find out whether to accept or reject the Glassdoor research
    • Null Hypothesis H0: μ0 is equal $113000
    • Alternative Hypothesis H1: μ0 not equals to $113000
    • In this case we have to standardize and we need to calculate the statistic Z-score represented by Z Preview Preview
    • z => one from the z-table will be referred as critical value
    • Since this two sided test we need to calculate alpha/2
    • Decision rule => IF absolute value of Z-Score > positive critical value (z) reject the null hypothesis Preview
    • According to the hypothesis testing which we have done the results are shown below Preview
    • We reject the null hypothesis at 1% and 5% significance levels as well.
    • Exercise: Try to test null hypothesis and 10% signifance level
  • P-Value:

    • A level of significance after which we can no longer reject the null hypothesis
    • This is the smallest level of significance at which we can still reject the null hypothesis
    • To calculate P-Values we can use online calculators Refer Here
    • We should reject the null hypothesis if P-value < α (level of significance)
    • Example – 1:
      • Standard error => 2739
      • Population std => 15000
      • number of samples => 30
      • Z-score => -4.67
    • Example – 2:
      • Z-score => 2.12 (Assumption)
      • critical value at 10% significance => α => 0.1 => critical value α/2 => 1.65 (Reject)
      • critical value at 5% significance => α => 0.05 => critical value α/2 => 1.96 (Reject)
      • critical value at 1% significance => α => 0.01 => critical value α/2 => 2.58 => Cannot reject
      • P-Value in this case is .034006 i.e when p-value < α reject the null hypothesis
        • We can reject the null hypothesis as long as significance level is greater than 3.4%

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin