ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Probability and Statistics
    MS-251
    Progress0 / 36 topics
    Topics
    1. Introduction: Statistics and Data Analysis2. Statistical Inference3. Samples, Populations, and the Role of Probability4. Sampling Procedures5. Discrete and Continuous Data6. Statistical Modeling7. Types of Statistical Studies8. Probability: Sample Space, Events, Counting Sample Points9. Probability of an Event10. Additive Rules11. Conditional Probability12. Independence and the Product Rule13. Bayes’ Rule14. Random Variables and Probability Distributions15. Mathematical Expectation: Mean of a Random Variable16. Variance and Covariance of Random Variables17. Means and Variances of Linear Combinations of Random Variables18. Chebyshev’s Theorem19. Discrete Probability Distributions20. Continuous Probability Distributions21. Fundamental Sampling Distributions22. Sampling Distributions and Data Descriptions23. Random Sampling24. Sampling Distributions25. Sampling Distribution of Means and the Central Limit Theorem26. Sampling Distribution of S227. t-Distribution28. F-Quantile and Probability Plots29. Single Sample & One- and Two-Sample Estimation Problems30. Single Sample & One- and Two-Sample Tests of Hypotheses31. The Use of P-Values for Decision Making in Testing Hypotheses32. Regression: Linear Regression and Correlation33. Least Squares and the Fitted Model34. Multiple Linear Regression and Certain Nonlinear Regression Models35. Linear Regression Model Using Matrices36. Properties of the Least Squares Estimators
    MS-251›Single Sample & One- and Two-Sample Tests of Hypotheses
    Probability and StatisticsTopic 30 of 36

    Single Sample & One- and Two-Sample Tests of Hypotheses

    12 minread
    2,109words
    Intermediatelevel

    Single-Sample & One- and Two-Sample Tests of Hypotheses

    In statistics, hypothesis testing is a formal method of making inferences or drawing conclusions about a population based on sample data. A hypothesis test starts with a claim or assumption about a population parameter (such as a mean or proportion), and then tests this assumption by analyzing sample data.

    There are two major types of hypothesis tests:

    1. Single-sample hypothesis tests – Involve testing a hypothesis about a single sample from a population.
    2. Two-sample hypothesis tests – Involve comparing two independent samples to test hypotheses about the differences between population parameters.

    1. Single-Sample Tests of Hypotheses

    A single-sample hypothesis test involves testing a hypothesis about a population parameter (such as the population mean or population proportion) based on sample data. The most common single-sample tests are the one-sample z-test and one-sample t-test.

    a. One-Sample Z-Test for the Population Mean (When Population Variance is Known)

    This test is used when we know the population's standard deviation σ\sigmaσ and want to test hypotheses about the population mean μ\muμ.

    • Null Hypothesis (H0H_0H0​): The population mean equals a specific value.

      H0:μ=μ0H_0: \mu = \mu_0H0​:μ=μ0​
    • Alternative Hypothesis (HAH_AHA​): The population mean is different from the hypothesized value.

      HA:μ≠μ0(Two-tailed test)H_A: \mu \neq \mu_0 \quad (\text{Two-tailed test})HA​:μ=μ0​(Two-tailed test)

      Or,

      HA:μ>μ0(Right-tailed test),HA:μ<μ0(Left-tailed test)H_A: \mu > \mu_0 \quad (\text{Right-tailed test}), \quad H_A: \mu < \mu_0 \quad (\text{Left-tailed test})HA​:μ>μ0​(Right-tailed test),HA​:μ<μ0​(Left-tailed test)
    • Test Statistic (Z-Score):

      z=xˉ−μ0σnz = \frac{\bar{x} - \mu_0}{\frac{\sigma}{\sqrt{n}}}z=n​σ​xˉ−μ0​​

      Where:

      • xˉ\bar{x}xˉ = sample mean,
      • μ0\mu_0μ0​ = hypothesized population mean,
      • σ\sigmaσ = population standard deviation (known),
      • nnn = sample size.
    • Decision Rule:

      • For a two-tailed test, reject H0H_0H0​ if ∣z∣>zα/2|z| > z_{\alpha/2}∣z∣>zα/2​, where zα/2z_{\alpha/2}zα/2​ is the critical value from the standard normal distribution corresponding to the significance level α\alphaα.
      • For a one-tailed test, reject H0H_0H0​ if z>zαz > z_{\alpha}z>zα​ for a right-tailed test or z<−zαz < -z_{\alpha}z<−zα​ for a left-tailed test.

    b. One-Sample t-Test for the Population Mean (When Population Variance is Unknown)

    When the population variance is unknown, we use the t-distribution to perform hypothesis testing for the population mean. This test is commonly used when sample sizes are small or when the population's variance is unknown.

    • Null Hypothesis (H0H_0H0​): The population mean equals a specific value.

      H0:μ=μ0H_0: \mu = \mu_0H0​:μ=μ0​
    • Alternative Hypothesis (HAH_AHA​): The population mean is different from the hypothesized value.

      HA:μ≠μ0(Two-tailed test)H_A: \mu \neq \mu_0 \quad (\text{Two-tailed test})HA​:μ=μ0​(Two-tailed test)

      Or,

      HA:μ>μ0(Right-tailed test),HA:μ<μ0(Left-tailed test)H_A: \mu > \mu_0 \quad (\text{Right-tailed test}), \quad H_A: \mu < \mu_0 \quad (\text{Left-tailed test})HA​:μ>μ0​(Right-tailed test),HA​:μ<μ0​(Left-tailed test)
    • Test Statistic (T-Statistic):

      t=xˉ−μ0snt = \frac{\bar{x} - \mu_0}{\frac{s}{\sqrt{n}}}t=n​s​xˉ−μ0​​

      Where:

      • xˉ\bar{x}xˉ = sample mean,
      • μ0\mu_0μ0​ = hypothesized population mean,
      • sss = sample standard deviation (since the population standard deviation is unknown),
      • nnn = sample size.
    • Decision Rule:

      • For a two-tailed test, reject H0H_0H0​ if ∣t∣>tα/2,n−1|t| > t_{\alpha/2, n-1}∣t∣>tα/2,n−1​, where tα/2,n−1t_{\alpha/2, n-1}tα/2,n−1​ is the critical value from the t-distribution with n−1n-1n−1 degrees of freedom and significance level α\alphaα.
      • For a one-tailed test, reject H0H_0H0​ if t>tα,n−1t > t_{\alpha, n-1}t>tα,n−1​ for a right-tailed test or t<−tα,n−1t < -t_{\alpha, n-1}t<−tα,n−1​ for a left-tailed test.

    2. Two-Sample Tests of Hypotheses

    A two-sample hypothesis test is used when comparing two independent samples. These tests are commonly used when we want to compare two population means or two population proportions.

    a. Two-Sample Z-Test for the Difference Between Means (When Population Variances are Known)

    This test is used when the population variances are known, and we want to compare the means of two independent samples.

    • Null Hypothesis (H0H_0H0​): The population means are equal.

      H0:μ1=μ2H_0: \mu_1 = \mu_2H0​:μ1​=μ2​
    • Alternative Hypothesis (HAH_AHA​): The population means are different.

      HA:μ1≠μ2(Two-tailed test)H_A: \mu_1 \neq \mu_2 \quad (\text{Two-tailed test})HA​:μ1​=μ2​(Two-tailed test)

      Or,

      HA:μ1>μ2(Right-tailed test),HA:μ1<μ2(Left-tailed test)H_A: \mu_1 > \mu_2 \quad (\text{Right-tailed test}), \quad H_A: \mu_1 < \mu_2 \quad (\text{Left-tailed test})HA​:μ1​>μ2​(Right-tailed test),HA​:μ1​<μ2​(Left-tailed test)
    • Test Statistic (Z-Score):

      z=xˉ1−xˉ2σ12n1+σ22n2z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}z=n1​σ12​​+n2​σ22​​​xˉ1​−xˉ2​​

      Where:

      • xˉ1\bar{x}_1xˉ1​ and xˉ2\bar{x}_2xˉ2​ are the sample means of the two groups,
      • σ12\sigma_1^2σ12​ and σ22\sigma_2^2σ22​ are the known population variances,
      • n1n_1n1​ and n2n_2n2​ are the sample sizes.
    • Decision Rule:

      • For a two-tailed test, reject H0H_0H0​ if ∣z∣>zα/2|z| > z_{\alpha/2}∣z∣>zα/2​, where zα/2z_{\alpha/2}zα/2​ is the critical value from the standard normal distribution corresponding to the significance level α\alphaα.
      • For a one-tailed test, reject H0H_0H0​ if z>zαz > z_{\alpha}z>zα​ for a right-tailed test or z<−zαz < -z_{\alpha}z<−zα​ for a left-tailed test.

    b. Two-Sample t-Test for the Difference Between Means (When Population Variances are Unknown)

    When the population variances are unknown and the sample sizes are small, we use the t-distribution to test the difference between the means of two independent samples.

    • Null Hypothesis (H0H_0H0​): The population means are equal.

      H0:μ1=μ2H_0: \mu_1 = \mu_2H0​:μ1​=μ2​
    • Alternative Hypothesis (HAH_AHA​): The population means are different.

      HA:μ1≠μ2(Two-tailed test)H_A: \mu_1 \neq \mu_2 \quad (\text{Two-tailed test})HA​:μ1​=μ2​(Two-tailed test)

      Or,

      HA:μ1>μ2(Right-tailed test),HA:μ1<μ2(Left-tailed test)H_A: \mu_1 > \mu_2 \quad (\text{Right-tailed test}), \quad H_A: \mu_1 < \mu_2 \quad (\text{Left-tailed test})HA​:μ1​>μ2​(Right-tailed test),HA​:μ1​<μ2​(Left-tailed test)
    • Test Statistic (T-Statistic):

      t=xˉ1−xˉ2s12n1+s22n2t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}t=n1​s12​​+n2​s22​​​xˉ1​−xˉ2​​

      Where:

      • xˉ1\bar{x}_1xˉ1​ and xˉ2\bar{x}_2xˉ2​ are the sample means of the two groups,
      • s12s_1^2s12​ and s22s_2^2s22​ are the sample variances,
      • n1n_1n1​ and n2n_2n2​ are the sample sizes.
    • Degrees of Freedom: The degrees of freedom (df) for this test are calculated using the Welch-Satterthwaite equation:

      df=(s12n1+s22n2)2(s12n1)2n1−1+(s22n2)2n2−1df = \frac{\left( \frac{s_1^2}{n_1} + \frac{s_2^2}{n_2} \right)^2}{\frac{\left( \frac{s_1^2}{n_1} \right)^2}{n_1 - 1} + \frac{\left( \frac{s_2^2}{n_2} \right)^2}{n_2 - 1}}df=n1​−1(n1​s12​​)2​+n2​−1(n2​s22​​)2​(n1​s12​​+n2​s22​​)2​
    • Decision Rule:

      • For a two-tailed test, reject H0H_0H0​ if ∣t∣>tα/2,df|t| > t_{\alpha/2, df}∣t∣>tα/2,df​, where tα/2,dft_{\alpha/2, df}tα/2,df​ is the critical value from the t-distribution with dfdfdf degrees of freedom.
      • For a one-tailed test, reject H0H_0H0​ if t>tα,dft > t_{\alpha, df}t>tα,df​ for a right-tailed test or t<−tα,dft < -t_{\alpha, df}t<−tα,df​ for a left-tailed test.

    Summary

    • Single-Sample Tests of Hypotheses:

      • One-sample z-test: Used when the population standard deviation is known, to test the population mean.
      • One-sample t-test: Used when the population standard deviation is unknown, to test the population mean.
    • Two-Sample Tests of Hypotheses:

      • Two-sample z-test: Used when population variances are known, to compare the means of two independent samples.
      • Two-sample t-test: Used when population variances are unknown, to compare the means of two independent samples.

    In both types of tests, the decision rule involves comparing the test statistic to a critical value from the appropriate distribution (z or t), and based on this comparison, the null hypothesis is either rejected or not rejected.

    Previous topic 29
    Single Sample & One- and Two-Sample Estimation Problems
    Next topic 31
    The Use of P-Values for Decision Making in Testing Hypotheses

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time12 min
      Word count2,109
      Code examples0
      DifficultyIntermediate