Hypothesis testing is a tool for making statistical inferences about the population data. It is an analysis tool that tests assumptions and determines how likely something is within a given standard of accuracy. Hypothesis testing provides a way to verify whether the results of an experiment are valid.
A null hypothesis and an alternative hypothesis are set up before performing the hypothesis testing. This helps to arrive at a conclusion regarding the sample obtained from the population. In this article, we will learn more about hypothesis testing, its types, steps to perform the testing, and associated examples.
1. | |
2. | |
3. | |
4. | |
5. | |
6. | |
7. | |
8. |
Hypothesis testing uses sample data from the population to draw useful conclusions regarding the population probability distribution . It tests an assumption made about the data using different types of hypothesis testing methodologies. The hypothesis testing results in either rejecting or not rejecting the null hypothesis.
Hypothesis testing can be defined as a statistical tool that is used to identify if the results of an experiment are meaningful or not. It involves setting up a null hypothesis and an alternative hypothesis. These two hypotheses will always be mutually exclusive. This means that if the null hypothesis is true then the alternative hypothesis is false and vice versa. An example of hypothesis testing is setting up a test to check if a new medicine works on a disease in a more efficient manner.
The null hypothesis is a concise mathematical statement that is used to indicate that there is no difference between two possibilities. In other words, there is no difference between certain characteristics of data. This hypothesis assumes that the outcomes of an experiment are based on chance alone. It is denoted as \(H_{0}\). Hypothesis testing is used to conclude if the null hypothesis can be rejected or not. Suppose an experiment is conducted to check if girls are shorter than boys at the age of 5. The null hypothesis will say that they are the same height.
The alternative hypothesis is an alternative to the null hypothesis. It is used to show that the observations of an experiment are due to some real effect. It indicates that there is a statistical significance between two possible outcomes and can be denoted as \(H_{1}\) or \(H_{a}\). For the above-mentioned example, the alternative hypothesis would be that girls are shorter than boys at the age of 5.
In hypothesis testing, the p value is used to indicate whether the results obtained after conducting a test are statistically significant or not. It also indicates the probability of making an error in rejecting or not rejecting the null hypothesis.This value is always a number between 0 and 1. The p value is compared to an alpha level, \(\alpha\) or significance level. The alpha level can be defined as the acceptable risk of incorrectly rejecting the null hypothesis. The alpha level is usually chosen between 1% to 5%.
All sets of values that lead to rejecting the null hypothesis lie in the critical region. Furthermore, the value that separates the critical region from the non-critical region is known as the critical value.
Depending upon the type of data available and the size, different types of hypothesis testing are used to determine whether the null hypothesis can be rejected or not. The hypothesis testing formula for some important test statistics are given below:
We will learn more about these test statistics in the upcoming section.
Selecting the correct test for performing hypothesis testing can be confusing. These tests are used to determine a test statistic on the basis of which the null hypothesis can either be rejected or not rejected. Some of the important tests used for hypothesis testing are given below.
A z test is a way of hypothesis testing that is used for a large sample size (n ≥ 30). It is used to determine whether there is a difference between the population mean and the sample mean when the population standard deviation is known. It can also be used to compare the mean of two samples. It is used to compute the z test statistic. The formulas are given as follows:
The t test is another method of hypothesis testing that is used for a small sample size (n < 30). It is also used to compare the sample mean and population mean. However, the population standard deviation is not known. Instead, the sample standard deviation is known. The mean of two samples can also be compared using the t test.
The Chi square test is a hypothesis testing method that is used to check whether the variables in a population are independent or not. It is used when the test statistic is chi-squared distributed.
One tailed hypothesis testing is done when the rejection region is only in one direction. It can also be known as directional hypothesis testing because the effects can be tested in one direction only. This type of testing is further classified into the right tailed test and left tailed test.
Right Tailed Hypothesis Testing
The right tail test is also known as the upper tail test. This test is used to check whether the population parameter is greater than some value. The null and alternative hypotheses for this test are given as follows:
\(H_{0}\): The population parameter is ≤ some value
\(H_{1}\): The population parameter is > some value.
If the test statistic has a greater value than the critical value then the null hypothesis is rejected
Left Tailed Hypothesis Testing
The left tail test is also known as the lower tail test. It is used to check whether the population parameter is less than some value. The hypotheses for this hypothesis testing can be written as follows:
\(H_{0}\): The population parameter is ≥ some value
\(H_{1}\): The population parameter is < some value.
The null hypothesis is rejected if the test statistic has a value lesser than the critical value.
In this hypothesis testing method, the critical region lies on both sides of the sampling distribution. It is also known as a non - directional hypothesis testing method. The two-tailed test is used when it needs to be determined if the population parameter is assumed to be different than some value. The hypotheses can be set up as follows:
\(H_{0}\): the population parameter = some value
\(H_{1}\): the population parameter ≠ some value
The null hypothesis is rejected if the test statistic has a value that is not equal to the critical value.
Hypothesis testing can be easily performed in five simple steps. The most important step is to correctly set up the hypotheses and identify the right method for hypothesis testing. The basic steps to perform hypothesis testing are as follows:
The best way to solve a problem on hypothesis testing is by applying the 5 steps mentioned in the previous section. Suppose a researcher claims that the mean average weight of men is greater than 100kgs with a standard deviation of 15kgs. 30 men are chosen with an average weight of 112.5 Kgs. Using hypothesis testing, check if there is enough evidence to support the researcher's claim. The confidence interval is given as 95%.
Step 1: This is an example of a right-tailed test. Set up the null hypothesis as \(H_{0}\): \(\mu\) = 100.
Step 2: The alternative hypothesis is given by \(H_{1}\): \(\mu\) > 100.
Step 3: As this is a one-tailed test, \(\alpha\) = 100% - 95% = 5%. This can be used to determine the critical value.
1 - \(\alpha\) = 1 - 0.05 = 0.95
0.95 gives the required area under the curve. Now using a normal distribution table, the area 0.95 is at z = 1.645. A similar process can be followed for a t-test. The only additional requirement is to calculate the degrees of freedom given by n - 1.
Step 4: Calculate the z test statistic. This is because the sample size is 30. Furthermore, the sample and population means are known along with the standard deviation.
z = \(\frac{\overline{x}-\mu}{\frac{\sigma}{\sqrt{n}}}\).
\(\mu\) = 100, \(\overline{x}\) = 112.5, n = 30, \(\sigma\) = 15
z = \(\frac{112.5-100}{\frac{15}{\sqrt{30}}}\) = 4.56
Step 5: Conclusion. As 4.56 > 1.645 thus, the null hypothesis can be rejected.
Confidence intervals form an important part of hypothesis testing. This is because the alpha level can be determined from a given confidence interval. Suppose a confidence interval is given as 95%. Subtract the confidence interval from 100%. This gives 100 - 95 = 5% or 0.05. This is the alpha value of a one-tailed hypothesis testing. To obtain the alpha value for a two-tailed hypothesis testing, divide this value by 2. This gives 0.05 / 2 = 0.025.
Related Articles:
Important Notes on Hypothesis Testing
go to slide go to slide go to slide
Book a Free Trial Class
What is hypothesis testing.
Hypothesis testing in statistics is a tool that is used to make inferences about the population data. It is also used to check if the results of an experiment are valid.
The z test in hypothesis testing is used to find the z test statistic for normally distributed data . The z test is used when the standard deviation of the population is known and the sample size is greater than or equal to 30.
The t test in hypothesis testing is used when the data follows a student t distribution . It is used when the sample size is less than 30 and standard deviation of the population is not known.
The formula for a one sample z test in hypothesis testing is z = \(\frac{\overline{x}-\mu}{\frac{\sigma}{\sqrt{n}}}\) and for two samples is z = \(\frac{(\overline{x_{1}}-\overline{x_{2}})-(\mu_{1}-\mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}}+\frac{\sigma_{2}^{2}}{n_{2}}}}\).
The p value helps to determine if the test results are statistically significant or not. In hypothesis testing, the null hypothesis can either be rejected or not rejected based on the comparison between the p value and the alpha level.
When the rejection region is only on one side of the distribution curve then it is known as one tail hypothesis testing. The right tail test and the left tail test are two types of directional hypothesis testing.
To get the alpha level in a two tail hypothesis testing divide \(\alpha\) by 2. This is done as there are two rejection regions in the curve.
Descriptive statistics, inferential statistics, stat reference, statistics - hypothesis testing a mean.
A population mean is an average of value a population.
Hypothesis tests are used to check a claim about the size of that population mean.
The following steps are used for a hypothesis test:
For example:
And we want to check the claim:
"The average age of Nobel Prize winners when they received the prize is more than 55"
By taking a sample of 30 randomly selected Nobel Prize winners we could find that:
The mean age in the sample (\(\bar{x}\)) is 62.1
The standard deviation of age in the sample (\(s\)) is 13.46
From this sample data we check the claim with the steps below.
The conditions for calculating a confidence interval for a proportion are:
A moderately large sample size, like 30, is typically large enough.
In the example, the sample size was 30 and it was randomly selected, so the conditions are fulfilled.
Note: Checking if the data is normally distributed can be done with specialized statistical tests.
We need to define a null hypothesis (\(H_{0}\)) and an alternative hypothesis (\(H_{1}\)) based on the claim we are checking.
The claim was:
In this case, the parameter is the mean age of Nobel Prize winners when they received the prize (\(\mu\)).
The null and alternative hypothesis are then:
Null hypothesis : The average age was 55.
Alternative hypothesis : The average age was more than 55.
Which can be expressed with symbols as:
\(H_{0}\): \(\mu = 55 \)
\(H_{1}\): \(\mu > 55 \)
This is a ' right tailed' test, because the alternative hypothesis claims that the proportion is more than in the null hypothesis.
If the data supports the alternative hypothesis, we reject the null hypothesis and accept the alternative hypothesis.
Advertisement
The significance level (\(\alpha\)) is the uncertainty we accept when rejecting the null hypothesis in a hypothesis test.
The significance level is a percentage probability of accidentally making the wrong conclusion.
Typical significance levels are:
A lower significance level means that the evidence in the data needs to be stronger to reject the null hypothesis.
There is no "correct" significance level - it only states the uncertainty of the conclusion.
Note: A 5% significance level means that when we reject a null hypothesis:
We expect to reject a true null hypothesis 5 out of 100 times.
The test statistic is used to decide the outcome of the hypothesis test.
The test statistic is a standardized value calculated from the sample.
The formula for the test statistic (TS) of a population mean is:
\(\displaystyle \frac{\bar{x} - \mu}{s} \cdot \sqrt{n} \)
\(\bar{x}-\mu\) is the difference between the sample mean (\(\bar{x}\)) and the claimed population mean (\(\mu\)).
\(s\) is the sample standard deviation .
\(n\) is the sample size.
In our example:
The claimed (\(H_{0}\)) population mean (\(\mu\)) was \( 55 \)
The sample mean (\(\bar{x}\)) was \(62.1\)
The sample standard deviation (\(s\)) was \(13.46\)
The sample size (\(n\)) was \(30\)
So the test statistic (TS) is then:
\(\displaystyle \frac{62.1-55}{13.46} \cdot \sqrt{30} = \frac{7.1}{13.46} \cdot \sqrt{30} \approx 0.528 \cdot 5.477 = \underline{2.889}\)
You can also calculate the test statistic using programming language functions:
With Python use the scipy and math libraries to calculate the test statistic.
With R use built-in math and statistics functions to calculate the test statistic.
There are two main approaches for making the conclusion of a hypothesis test:
Note: The two approaches are only different in how they present the conclusion.
For the critical value approach we need to find the critical value (CV) of the significance level (\(\alpha\)).
For a population mean test, the critical value (CV) is a T-value from a student's t-distribution .
This critical T-value (CV) defines the rejection region for the test.
The rejection region is an area of probability in the tails of the standard normal distribution.
Because the claim is that the population mean is more than 55, the rejection region is in the right tail:
The student's t-distribution is adjusted for the uncertainty from smaller samples.
This adjustment is called degrees of freedom (df), which is the sample size \((n) - 1\)
In this case the degrees of freedom (df) is: \(30 - 1 = \underline{29} \)
Choosing a significance level (\(\alpha\)) of 0.01, or 1%, we can find the critical T-value from a T-table , or with a programming language function:
With Python use the Scipy Stats library t.ppf() function find the T-Value for an \(\alpha\) = 0.01 at 29 degrees of freedom (df).
With R use the built-in qt() function to find the t-value for an \(\alpha\) = 0.01 at 29 degrees of freedom (df).
Using either method we can find that the critical T-Value is \(\approx \underline{2.462}\)
For a right tailed test we need to check if the test statistic (TS) is bigger than the critical value (CV).
If the test statistic is bigger than the critical value, the test statistic is in the rejection region .
When the test statistic is in the rejection region, we reject the null hypothesis (\(H_{0}\)).
Here, the test statistic (TS) was \(\approx \underline{2.889}\) and the critical value was \(\approx \underline{2.462}\)
Here is an illustration of this test in a graph:
Since the test statistic was bigger than the critical value we reject the null hypothesis.
This means that the sample data supports the alternative hypothesis.
And we can summarize the conclusion stating:
The sample data supports the claim that "The average age of Nobel Prize winners when they received the prize is more than 55" at a 1% significance level .
For the P-value approach we need to find the P-value of the test statistic (TS).
If the P-value is smaller than the significance level (\(\alpha\)), we reject the null hypothesis (\(H_{0}\)).
The test statistic was found to be \( \approx \underline{2.889} \)
For a population proportion test, the test statistic is a T-Value from a student's t-distribution .
Because this is a right tailed test, we need to find the P-value of a t-value bigger than 2.889.
The student's t-distribution is adjusted according to degrees of freedom (df), which is the sample size \((30) - 1 = \underline{29}\)
We can find the P-value using a T-table , or with a programming language function:
With Python use the Scipy Stats library t.cdf() function find the P-value of a T-value bigger than 2.889 at 29 degrees of freedom (df):
With R use the built-in pt() function find the P-value of a T-Value bigger than 2.889 at 29 degrees of freedom (df):
Using either method we can find that the P-value is \(\approx \underline{0.0036}\)
This tells us that the significance level (\(\alpha\)) would need to be bigger than 0.0036, or 0.36%, to reject the null hypothesis.
This P-value is smaller than any of the common significance levels (10%, 5%, 1%).
So the null hypothesis is rejected at all of these significance levels.
The sample data supports the claim that "The average age of Nobel Prize winners when they received the prize is more than 55" at a 10%, 5%, or 1% significance level .
Note: An outcome of an hypothesis test that rejects the null hypothesis with a p-value of 0.36% means:
For this p-value, we only expect to reject a true null hypothesis 36 out of 10000 times.
Many programming languages can calculate the P-value to decide outcome of a hypothesis test.
Using software and programming to calculate statistics is more common for bigger sets of data, as calculating manually becomes difficult.
The P-value calculated here will tell us the lowest possible significance level where the null-hypothesis can be rejected.
With Python use the scipy and math libraries to calculate the P-value for a right tailed hypothesis test for a mean.
Here, the sample size is 30, the sample mean is 62.1, the sample standard deviation is 13.46, and the test is for a mean bigger than 55.
With R use built-in math and statistics functions find the P-value for a right tailed hypothesis test for a mean.
This was an example of a right tailed test, where the alternative hypothesis claimed that parameter is bigger than the null hypothesis claim.
You can check out an equivalent step-by-step guide for other types here:
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]
If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]
Top references, top examples, get certified.
Statistics tutorial, everything you need to know about the probability density function in statistics, the best guide to understand central limit theorem, an in-depth guide to measures of central tendency : mean, median and mode, the ultimate guide to understand conditional probability.
A Comprehensive Look at Percentile in Statistics
Everything you need to know about the normal distribution, an in-depth explanation of cumulative distribution function, chi-square test, what is hypothesis testing in statistics types and examples, understanding the fundamentals of arithmetic and geometric progression, the definitive guide to understand spearman’s rank correlation, mean squared error: overview, examples, concepts and more, all you need to know about the empirical rule in statistics, the complete guide to skewness and kurtosis, a holistic look at bernoulli distribution.
All You Need to Know About Bias in Statistics
The Key Differences Between Z-Test Vs. T-Test
A complete guide on the types of statistical studies, everything you need to know about poisson distribution, your best guide to understand correlation vs. regression, the most comprehensive guide for beginners on what is correlation, hypothesis testing in statistics - types | examples.
Lesson 10 of 24 By Avijeet Biswal
In today’s data-driven world, decisions are based on data all the time. Hypothesis plays a crucial role in that process, whether it may be making business decisions, in the health sector, academia, or in quality improvement. Without hypothesis & hypothesis tests, you risk drawing the wrong conclusions and making bad decisions. In this tutorial, you will look at Hypothesis Testing in Statistics.
Hypothesis Testing is a type of statistical analysis in which you put your assumptions about a population parameter to the test. It is used to estimate the relationship between 2 statistical variables.
Let's discuss few examples of statistical hypothesis from real-life -
Now that you know about hypothesis testing, look at the two types of hypothesis testing in statistics.
Z = ( x̅ – μ0 ) / (σ /√n)
An analyst performs hypothesis testing on a statistical sample to present evidence of the plausibility of the null hypothesis. Measurements and analyses are conducted on a random sample of the population to test a theory. Analysts use a random population sample to test two hypotheses: the null and alternative hypotheses.
The null hypothesis is typically an equality hypothesis between population parameters; for example, a null hypothesis may claim that the population means return equals zero. The alternate hypothesis is essentially the inverse of the null hypothesis (e.g., the population means the return is not equal to zero). As a result, they are mutually exclusive, and only one can be correct. One of the two possibilities, however, will always be correct.
The Null Hypothesis is the assumption that the event will not occur. A null hypothesis has no bearing on the study's outcome unless it is rejected.
H0 is the symbol for it, and it is pronounced H-naught.
The Alternate Hypothesis is the logical opposite of the null hypothesis. The acceptance of the alternative hypothesis follows the rejection of the null hypothesis. H1 is the symbol for it.
Let's understand this with an example.
A sanitizer manufacturer claims that its product kills 95 percent of germs on average.
To put this company's claim to the test, create a null and alternate hypothesis.
H0 (Null Hypothesis): Average = 95%.
Alternative Hypothesis (H1): The average is less than 95%.
Another straightforward example to understand this concept is determining whether or not a coin is fair and balanced. The null hypothesis states that the probability of a show of heads is equal to the likelihood of a show of tails. In contrast, the alternate theory states that the probability of a show of heads and tails would be very different.
Let's consider a hypothesis test for the average height of women in the United States. Suppose our null hypothesis is that the average height is 5'4". We gather a sample of 100 women and determine that their average height is 5'5". The standard deviation of population is 2.
To calculate the z-score, we would use the following formula:
z = ( x̅ – μ0 ) / (σ /√n)
z = (5'5" - 5'4") / (2" / √100)
z = 0.5 / (0.045)
We will reject the null hypothesis as the z-score of 11.11 is very large and conclude that there is evidence to suggest that the average height of women in the US is greater than 5'4".
Hypothesis testing is a statistical method to determine if there is enough evidence in a sample of data to infer that a certain condition is true for the entire population. Here’s a breakdown of the typical steps involved in hypothesis testing:
The significance level, often denoted by alpha (α), is the probability of rejecting the null hypothesis when it is true. Common choices for α are 0.05 (5%), 0.01 (1%), and 0.10 (10%).
Choose a statistical test based on the type of data and the hypothesis. Common tests include t-tests, chi-square tests, ANOVA, and regression analysis. The selection depends on data type, distribution, sample size, and whether the hypothesis is one-tailed or two-tailed.
Gather the data that will be analyzed in the test. This data should be representative of the population to infer conclusions accurately.
Based on the collected data and the chosen test, calculate a test statistic that reflects how much the observed data deviates from the null hypothesis.
The p-value is the probability of observing test results at least as extreme as the results observed, assuming the null hypothesis is correct. It helps determine the strength of the evidence against the null hypothesis.
Compare the p-value to the chosen significance level:
Present the findings from the hypothesis test, including the test statistic, p-value, and the conclusion about the hypotheses.
Depending on the results and the study design, further analysis may be needed to explore the data more deeply or to address multiple comparisons if several hypotheses were tested simultaneously.
To determine whether a discovery or relationship is statistically significant, hypothesis testing uses a z-test. It usually checks to see if two means are the same (the null hypothesis). Only when the population standard deviation is known and the sample size is 30 data points or more, can a z-test be applied.
A statistical test called a t-test is employed to compare the means of two groups. To determine whether two groups differ or if a procedure or treatment affects the population of interest, it is frequently used in hypothesis testing.
You utilize a Chi-square test for hypothesis testing concerning whether your data is as predicted. To determine if the expected and observed results are well-fitted, the Chi-square test analyzes the differences between categorical variables from a random sample. The test's fundamental premise is that the observed values in your data should be compared to the predicted values that would be present if the null hypothesis were true.
Both confidence intervals and hypothesis tests are inferential techniques that depend on approximating the sample distribution. Data from a sample is used to estimate a population parameter using confidence intervals. Data from a sample is used in hypothesis testing to examine a given hypothesis. We must have a postulated parameter to conduct hypothesis testing.
Bootstrap distributions and randomization distributions are created using comparable simulation techniques. The observed sample statistic is the focal point of a bootstrap distribution, whereas the null hypothesis value is the focal point of a randomization distribution.
A variety of feasible population parameter estimates are included in confidence ranges. In this lesson, we created just two-tailed confidence intervals. There is a direct connection between these two-tail confidence intervals and these two-tail hypothesis tests. The results of a two-tailed hypothesis test and two-tailed confidence intervals typically provide the same results. In other words, a hypothesis test at the 0.05 level will virtually always fail to reject the null hypothesis if the 95% confidence interval contains the predicted value. A hypothesis test at the 0.05 level will nearly certainly reject the null hypothesis if the 95% confidence interval does not include the hypothesized parameter.
Become a Data Scientist through hands-on learning with hackathons, masterclasses, webinars, and Ask-Me-Anything! Start learning now!
Depending on the population distribution, you can classify the statistical hypothesis into two types.
Simple Hypothesis: A simple hypothesis specifies an exact value for the parameter.
Composite Hypothesis: A composite hypothesis specifies a range of values.
A company is claiming that their average sales for this quarter are 1000 units. This is an example of a simple hypothesis.
Suppose the company claims that the sales are in the range of 900 to 1000 units. Then this is a case of a composite hypothesis.
The One-Tailed test, also called a directional test, considers a critical region of data that would result in the null hypothesis being rejected if the test sample falls into it, inevitably meaning the acceptance of the alternate hypothesis.
In a one-tailed test, the critical distribution area is one-sided, meaning the test sample is either greater or lesser than a specific value.
In two tails, the test sample is checked to be greater or less than a range of values in a Two-Tailed test, implying that the critical distribution area is two-sided.
If the sample falls within this range, the alternate hypothesis will be accepted, and the null hypothesis will be rejected.
If the larger than (>) sign appears in your hypothesis statement, you are using a right-tailed test, also known as an upper test. Or, to put it another way, the disparity is to the right. For instance, you can contrast the battery life before and after a change in production. Your hypothesis statements can be the following if you want to know if the battery life is longer than the original (let's say 90 hours):
The crucial point in this situation is that the alternate hypothesis (H1), not the null hypothesis, decides whether you get a right-tailed test.
Alternative hypotheses that assert the true value of a parameter is lower than the null hypothesis are tested with a left-tailed test; they are indicated by the asterisk "<".
Suppose H0: mean = 50 and H1: mean not equal to 50
According to the H1, the mean can be greater than or less than 50. This is an example of a Two-tailed test.
In a similar manner, if H0: mean >=50, then H1: mean <50
Here the mean is less than 50. It is called a One-tailed test.
A hypothesis test can result in two types of errors.
Type 1 Error: A Type-I error occurs when sample results reject the null hypothesis despite being true.
Type 2 Error: A Type-II error occurs when the null hypothesis is not rejected when it is false, unlike a Type-I error.
Suppose a teacher evaluates the examination paper to decide whether a student passes or fails.
H0: Student has passed
H1: Student has failed
Type I error will be the teacher failing the student [rejects H0] although the student scored the passing marks [H0 was true].
Type II error will be the case where the teacher passes the student [do not reject H0] although the student did not score the passing marks [H1 is true].
Our Data Scientist Master's Program covers core topics such as R, Python, Machine Learning, Tableau, Hadoop, and Spark. Get started on your journey today!
Hypothesis testing has some limitations that researchers should be aware of:
After reading this tutorial, you would have a much better understanding of hypothesis testing, one of the most important concepts in the field of Data Science . The majority of hypotheses are based on speculation about observed behavior, natural phenomena, or established theories.
If you are interested in statistics of data science and skills needed for such a career, you ought to explore the Post Graduate Program in Data Science.
If you have any questions regarding this ‘Hypothesis Testing In Statistics’ tutorial, do share them in the comment section. Our subject matter expert will respond to your queries. Happy learning!
Hypothesis testing is a statistical method used to determine if there is enough evidence in a sample data to draw conclusions about a population. It involves formulating two competing hypotheses, the null hypothesis (H0) and the alternative hypothesis (Ha), and then collecting data to assess the evidence. An example: testing if a new drug improves patient recovery (Ha) compared to the standard treatment (H0) based on collected patient data.
In statistics, H0 and H1 represent the null and alternative hypotheses. The null hypothesis, H0, is the default assumption that no effect or difference exists between groups or conditions. The alternative hypothesis, H1, is the competing claim suggesting an effect or a difference. Statistical tests determine whether to reject the null hypothesis in favor of the alternative hypothesis based on the data.
A simple hypothesis is a specific statement predicting a single relationship between two variables. It posits a direct and uncomplicated outcome. For example, a simple hypothesis might state, "Increased sunlight exposure increases the growth rate of sunflowers." Here, the hypothesis suggests a direct relationship between the amount of sunlight (independent variable) and the growth rate of sunflowers (dependent variable), with no additional variables considered.
The three major types of hypotheses are:
Name | Date | Place | |
---|---|---|---|
21 Sep -6 Oct 2024, Weekend batch | Your City | ||
12 Oct -27 Oct 2024, Weekend batch | Your City | ||
26 Oct -10 Nov 2024, Weekend batch | Your City |
Avijeet is a Senior Research Analyst at Simplilearn. Passionate about Data Analytics, Machine Learning, and Deep Learning, Avijeet is also interested in politics, cricket, and football.
Free eBook: Top Programming Languages For A Data Scientist
Normality Test in Minitab: Minitab with Statistics
Machine Learning Career Guide: A Playbook to Becoming a Machine Learning Engineer
Earlier in the course, we discussed sampling distributions. Particular distributions are associated with various types of hypothesis testing.
The following table summarizes various hypothesis tests and corresponding probability distributions that will be used to conduct the test (based on the assumptions shown below):
Type of Hypothesis Test | Population Parameter | Estimated value (point estimate) | Probability Distribution Used |
---|---|---|---|
Hypothesis test for the mean, when the population standard deviation is known | Population mean | Sample mean | Normal distribution, |
Hypothesis test for the mean, when the population standard deviation is unknown and the distribution of the sample mean is approximately normal | Population mean | Sample mean | Student’s t-distribution, |
Hypothesis test for proportions | Population proportion | Sample proportion | Normal distribution, |
When you perform a hypothesis test of a single population mean μ using a normal distribution (often called a z-test), you take a simple random sample from the population. The population you are testing is normally distributed , or your sample size is sufficiently large. You know the value of the population standard deviation , which, in reality, is rarely known.
When you perform a hypothesis test of a single population mean μ using a Student's t-distribution (often called a t -test), there are fundamental assumptions that need to be met in order for the test to work properly. Your data should be a simple random sample that comes from a population that is approximately normally distributed. You use the sample standard deviation to approximate the population standard deviation. (Note that if the sample size is sufficiently large, a t -test will work even if the population is not approximately normally distributed).
When you perform a hypothesis test of a single population proportion p , you take a simple random sample from the population. You must meet the conditions for a binomial distribution : there are a certain number n of independent trials, the outcomes of any trial are success or failure, and each trial has the same probability of a success p . The shape of the binomial distribution needs to be similar to the shape of the normal distribution. To ensure this, the quantities np and nq must both be greater than five ( n p > 5 n p > 5 and n q > 5 n q > 5 ). Then the binomial distribution of a sample (estimated) proportion can be approximated by the normal distribution with μ = p μ = p and σ = p q n σ = p q n . Remember that q = 1 - p q q = 1 - p q .
Going back to the standardizing formula we can derive the test statistic for testing hypotheses concerning means.
The standardizing formula cannot be solved as it is because we do not have μ, the population mean. However, if we substitute in the hypothesized value of the mean, μ 0 in the formula as above, we can compute a Z value. This is the test statistic for a test of hypothesis for a mean and is presented in Figure 9.3 . We interpret this Z value as the associated probability that a sample with a sample mean of X ¯ X ¯ could have come from a distribution with a population mean of H 0 and we call this Z value Z c for “calculated”. Figure 9.3 and Figure 9.4 show this process.
In Figure 9.3 two of the three possible outcomes are presented. X ¯ 1 X ¯ 1 and X ¯ 3 X ¯ 3 are in the tails of the hypothesized distribution of H 0 . Notice that the horizontal axis in the top panel is labeled X ¯ X ¯ 's. This is the same theoretical distribution of X ¯ X ¯ 's, the sampling distribution, that the Central Limit Theorem tells us is normally distributed. This is why we can draw it with this shape. The horizontal axis of the bottom panel is labeled Z and is the standard normal distribution. Z α 2 Z α 2 and -Z α 2 -Z α 2 , called the critical values , are marked on the bottom panel as the Z values associated with the probability the analyst has set as the level of significance in the test, (α). The probabilities in the tails of both panels are, therefore, the same.
Notice that for each X ¯ X ¯ there is an associated Z c , called the calculated Z, that comes from solving the equation above. This calculated Z is nothing more than the number of standard deviations that the hypothesized mean is from the sample mean. If the sample mean falls "too many" standard deviations from the hypothesized mean we conclude that the sample mean could not have come from the distribution with the hypothesized mean, given our pre-set required level of significance. It could have come from H 0 , but it is deemed just too unlikely. In Figure 9.3 both X ¯ 1 X ¯ 1 and X ¯ 3 X ¯ 3 are in the tails of the distribution. They are deemed "too far" from the hypothesized value of the mean given the chosen level of alpha. If in fact this sample mean it did come from H 0 , but from in the tail, we have made a Type I error: we have rejected a good null. Our only real comfort is that we know the probability of making such an error, α, and we can control the size of α.
Figure 9.4 shows the third possibility for the location of the sample mean, x _ x _ . Here the sample mean is within the two critical values. That is, within the probability of (1-α) and we cannot reject the null hypothesis.
This gives us the decision rule for testing a hypothesis for a two-tailed test:
Decision rule: two-tail test |
---|
If < : then do not REJECT |
If > : then REJECT |
This rule will always be the same no matter what hypothesis we are testing or what formulas we are using to make the test. The only change will be to change the Z c to the appropriate symbol for the test statistic for the parameter being tested. Stating the decision rule another way: if the sample mean is unlikely to have come from the distribution with the hypothesized mean we cannot accept the null hypothesis. Here we define "unlikely" as having a probability less than alpha of occurring.
An alternative decision rule can be developed by calculating the probability that a sample mean could be found that would give a test statistic larger than the test statistic found from the current sample data assuming that the null hypothesis is true. Here the notion of "likely" and "unlikely" is defined by the probability of drawing a sample with a mean from a population with the hypothesized mean that is either larger or smaller than that found in the sample data. Simply stated, the p-value approach compares the desired significance level, α, to the p-value which is the probability of drawing a sample mean further from the hypothesized value than the actual sample mean. A large p -value calculated from the data indicates that we should not reject the null hypothesis . The smaller the p -value, the more unlikely the outcome, and the stronger the evidence is against the null hypothesis. We would reject the null hypothesis if the evidence is strongly against it. The relationship between the decision rule of comparing the calculated test statistics, Z c , and the Critical Value, Z α , and using the p -value can be seen in Figure 9.5 .
The calculated value of the test statistic is Z c in this example and is marked on the bottom graph of the standard normal distribution because it is a Z value. In this case the calculated value is in the tail and thus we cannot accept the null hypothesis, the associated X ¯ X ¯ is just too unusually large to believe that it came from the distribution with a mean of µ 0 with a significance level of α.
If we use the p -value decision rule we need one more step. We need to find in the standard normal table the probability associated with the calculated test statistic, Z c . We then compare that to the α associated with our selected level of confidence. In Figure 9.5 we see that the p -value is less than α and therefore we cannot accept the null. We know that the p -value is less than α because the area under the p-value is smaller than α/2. It is important to note that two researchers drawing randomly from the same population may find two different P-values from their samples. This occurs because the P-value is calculated as the probability in the tail beyond the sample mean assuming that the null hypothesis is correct. Because the sample means will in all likelihood be different this will create two different P-values. Nevertheless, the conclusions as to the null hypothesis should be different with only the level of probability of α.
Here is a systematic way to make a decision of whether you cannot accept or cannot reject a null hypothesis if using the p -value and a preset or preconceived α (the " significance level "). A preset α is the probability of a Type I error (rejecting the null hypothesis when the null hypothesis is true). It may or may not be given to you at the beginning of the problem. In any case, the value of α is the decision of the analyst. When you make a decision to reject or not reject H 0 , do as follows:
Both decision rules will result in the same decision and it is a matter of preference which one is used.
The discussion of Figure 9.3 - Figure 9.5 was based on the null and alternative hypothesis presented in Figure 9.3 . This was called a two-tailed test because the alternative hypothesis allowed that the mean could have come from a population which was either larger or smaller than the hypothesized mean in the null hypothesis. This could be seen by the statement of the alternative hypothesis as μ ≠ 100, in this example.
It may be that the analyst has no concern about the value being "too" high or "too" low from the hypothesized value. If this is the case, it becomes a one-tailed test and all of the alpha probability is placed in just one tail and not split into α/2 as in the above case of a two-tailed test. Any test of a claim will be a one-tailed test. For example, a car manufacturer claims that their Model 17B provides gas mileage of greater than 25 miles per gallon. The null and alternative hypothesis would be:
The claim would be in the alternative hypothesis. The burden of proof in hypothesis testing is carried in the alternative. This is because failing to reject the null, the status quo, must be accomplished with 90 or 95 percent confidence that it cannot be maintained. Said another way, we want to have only a 5 or 10 percent probability of making a Type I error, rejecting a good null; overthrowing the status quo.
This is a one-tailed test and all of the alpha probability is placed in just one tail and not split into α/2 as in the above case of a two-tailed test.
Figure 9.6 shows the two possible cases and the form of the null and alternative hypothesis that give rise to them.
where μ 0 is the hypothesized value of the population mean.
Sample size | Test statistic |
---|---|
< 30 (σ unknown) | |
< 30 (σ known) | |
> 30 (σ unknown) | |
> 30 (σ known) |
In developing the confidence intervals for the mean from a sample, we found that most often we would not have the population standard deviation, σ. If the sample size were less than 30, we could simply substitute the point estimate for σ, the sample standard deviation, s, and use the student's t -distribution to correct for this lack of information.
When testing hypotheses we are faced with this same problem and the solution is exactly the same. Namely: If the population standard deviation is unknown, and the sample size is less than 30, substitute s, the point estimate for the population standard deviation, σ, in the formula for the test statistic and use the student's t -distribution. All the formulas and figures above are unchanged except for this substitution and changing the Z distribution to the student's t -distribution on the graph. Remember that the student's t -distribution can only be computed knowing the proper degrees of freedom for the problem. In this case, the degrees of freedom is computed as before with confidence intervals: df = (n-1). The calculated t-value is compared to the t-value associated with the pre-set level of confidence required in the test, t α , df found in the student's t tables. If we do not know σ, but the sample size is 30 or more, we simply substitute s for σ and use the normal distribution.
Table 9.5 summarizes these rules.
A systematic approach to hypothesis testing follows the following steps and in this order. This template will work for all hypotheses that you will ever test.
Decide the level of significance required for this particular case and determine the critical value. These can be found in the appropriate statistical table. The levels of confidence typical for businesses are 80, 90, 95, 98, and 99. However, the level of significance is a policy decision and should be based upon the risk of making a Type I error, rejecting a good null. Consider the consequences of making a Type I error.
Next, on the basis of the hypotheses and sample size, select the appropriate test statistic and find the relevant critical value: Z α , t α , etc. Drawing the relevant probability distribution and marking the critical value is always big help. Be sure to match the graph with the hypothesis, especially if it is a one-tailed test.
All hypotheses tested will go through this same process. The only changes are the relevant formulas and those are determined by the hypothesis required to answer the original question.
This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's permission.
Want to cite, share, or modify this book? This book uses the Creative Commons Attribution License and you must attribute OpenStax.
Access for free at https://openstax.org/books/introductory-business-statistics-2e/pages/1-introduction
© Jul 18, 2024 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution License . The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.
Run a free plagiarism check in 10 minutes, generate accurate citations for free.
Published on November 8, 2019 by Rebecca Bevans . Revised on June 22, 2023.
Hypothesis testing is a formal procedure for investigating our ideas about the world using statistics . It is most often used by scientists to test specific predictions, called hypotheses, that arise from theories.
There are 5 main steps in hypothesis testing:
Though the specific details might vary, the procedure you will use when testing a hypothesis will always follow some version of these steps.
Step 1: state your null and alternate hypothesis, step 2: collect data, step 3: perform a statistical test, step 4: decide whether to reject or fail to reject your null hypothesis, step 5: present your findings, other interesting articles, frequently asked questions about hypothesis testing.
After developing your initial research hypothesis (the prediction that you want to investigate), it is important to restate it as a null (H o ) and alternate (H a ) hypothesis so that you can test it mathematically.
The alternate hypothesis is usually your initial hypothesis that predicts a relationship between variables. The null hypothesis is a prediction of no relationship between the variables you are interested in.
Discover proofreading & editing
For a statistical test to be valid , it is important to perform sampling and collect data in a way that is designed to test your hypothesis. If your data are not representative, then you cannot make statistical inferences about the population you are interested in.
There are a variety of statistical tests available, but they are all based on the comparison of within-group variance (how spread out the data is within a category) versus between-group variance (how different the categories are from one another).
If the between-group variance is large enough that there is little or no overlap between groups, then your statistical test will reflect that by showing a low p -value . This means it is unlikely that the differences between these groups came about by chance.
Alternatively, if there is high within-group variance and low between-group variance, then your statistical test will reflect that with a high p -value. This means it is likely that any difference you measure between groups is due to chance.
Your choice of statistical test will be based on the type of variables and the level of measurement of your collected data .
Based on the outcome of your statistical test, you will have to decide whether to reject or fail to reject your null hypothesis.
In most cases you will use the p -value generated by your statistical test to guide your decision. And in most cases, your predetermined level of significance for rejecting the null hypothesis will be 0.05 – that is, when there is a less than 5% chance that you would see these results if the null hypothesis were true.
In some cases, researchers choose a more conservative level of significance, such as 0.01 (1%). This minimizes the risk of incorrectly rejecting the null hypothesis ( Type I error ).
The results of hypothesis testing will be presented in the results and discussion sections of your research paper , dissertation or thesis .
In the results section you should give a brief summary of the data and a summary of the results of your statistical test (for example, the estimated difference between group means and associated p -value). In the discussion , you can discuss whether your initial hypothesis was supported by your results or not.
In the formal language of hypothesis testing, we talk about rejecting or failing to reject the null hypothesis. You will probably be asked to do this in your statistics assignments.
However, when presenting research results in academic papers we rarely talk this way. Instead, we go back to our alternate hypothesis (in this case, the hypothesis that men are on average taller than women) and state whether the result of our test did or did not support the alternate hypothesis.
If your null hypothesis was rejected, this result is interpreted as “supported the alternate hypothesis.”
These are superficial differences; you can see that they mean the same thing.
You might notice that we don’t say that we reject or fail to reject the alternate hypothesis . This is because hypothesis testing is not designed to prove or disprove anything. It is only designed to test whether a pattern we measure could have arisen spuriously, or by chance.
If we reject the null hypothesis based on our research (i.e., we find that it is unlikely that the pattern arose by chance), then we can say our test lends support to our hypothesis . But if the pattern does not pass our decision rule, meaning that it could have arisen by chance, then we say the test is inconsistent with our hypothesis .
If you want to know more about statistics , methodology , or research bias , make sure to check out some of our other articles with explanations and examples.
Methodology
Research bias
Hypothesis testing is a formal procedure for investigating our ideas about the world using statistics. It is used by scientists to test specific predictions, called hypotheses , by calculating how likely it is that a pattern or relationship between variables could have arisen by chance.
A hypothesis states your predictions about what your research will find. It is a tentative answer to your research question that has not yet been tested. For some research projects, you might have to write several hypotheses that address different aspects of your research question.
A hypothesis is not just a guess — it should be based on existing theories and knowledge. It also has to be testable, which means you can support or refute it through scientific research methods (such as experiments, observations and statistical analysis of data).
Null and alternative hypotheses are used in statistical hypothesis testing . The null hypothesis of a test always predicts no effect or no relationship between variables, while the alternative hypothesis states your research prediction of an effect or relationship.
If you want to cite this source, you can copy and paste the citation or click the “Cite this Scribbr article” button to automatically add the citation to our free Citation Generator.
Bevans, R. (2023, June 22). Hypothesis Testing | A Step-by-Step Guide with Easy Examples. Scribbr. Retrieved September 3, 2024, from https://www.scribbr.com/statistics/hypothesis-testing/
Other students also liked, choosing the right statistical test | types & examples, understanding p values | definition and examples, what is your plagiarism score.
Statistics By Jim
Making statistics intuitive
By Jim Frost 10 Comments
A test statistic assesses how consistent your sample data are with the null hypothesis in a hypothesis test. Test statistic calculations take your sample data and boil them down to a single number that quantifies how much your sample diverges from the null hypothesis. As a test statistic value becomes more extreme, it indicates larger differences between your sample data and the null hypothesis.
When your test statistic indicates a sufficiently large incompatibility with the null hypothesis, you can reject the null and state that your results are statistically significant—your data support the notion that the sample effect exists in the population . To use a test statistic to evaluate statistical significance, you either compare it to a critical value or use it to calculate the p-value .
Statisticians named the hypothesis tests after the test statistics because they’re the quantity that the tests actually evaluate. For example, t-tests assess t-values, F-tests evaluate F-values, and chi-square tests use, you guessed it, chi-square values.
In this post, learn about test statistics, how to calculate them, interpret them, and evaluate statistical significance using the critical value and p-value methods.
Each test statistic has its own formula. I present several common test statistics examples below. To see worked examples for each one, click the links to my more detailed articles.
T-value for 1-sample t-test | Take the sample mean, subtract the hypothesized mean, and divide by the . | |
T-value for 2-sample t-test | Take one sample mean, subtract the other, and divide by the pooled standard deviation. | |
F-value for F-tests and ANOVA | Calculate the ratio of two . | |
Chi-squared value (χ ) for a Chi-squared test | Sum the squared differences between observed and expected values divided by the expected values. |
In the formulas above, it’s helpful to understand the null condition and the test statistic value that occurs when your sample data match that condition exactly. Also, it’s worthwhile knowing what causes the test statistics to move further away from the null value, potentially becoming significant. Test statistics are statistically significant when they exceed a critical value.
All these test statistics are ratios, which helps you understand their null values.
When a t-value equals 0, it indicates that your sample data match the null hypothesis exactly.
For a 1-sample t-test, when the sample mean equals the hypothesized mean, the numerator is zero, which causes the entire t-value ratio to equal zero. As the sample mean moves away from the hypothesized mean in either the positive or negative direction, the test statistic moves away from zero in the same direction.
A similar case exists for 2-sample t-tests. When the two sample means are equal, the numerator is zero, and the entire test statistic ratio is zero. As the two sample means become increasingly different, the absolute value of the numerator increases, and the t-value becomes more positive or negative.
Related post : How T-tests Work
When an F-value equals 1, it indicates that the two variances in the numerator and denominator are equal, matching the null hypothesis.
As the numerator and denominator become less and less similar, the F-value moves away from one in either direction.
Related post : The F-test in ANOVA
When a chi-squared value equals 0, it indicates that the observed values always match the expected values. This condition causes the numerator to equal zero, making the chi-squared value equal zero.
As the observed values progressively fail to match the expected values, the numerator increases, causing the test statistic to rise from zero.
Related post : How a Chi-Squared Test Works
You’ll never see a test statistic that equals the null value precisely in practice. However, trivial differences been sample values and the null value are not uncommon.
Test statistics are unitless. This fact can make them difficult to interpret on their own. You know they evaluate how well your data agree with the null hypothesis. If your test statistic is extreme enough, your data are so incompatible with the null hypothesis that you can reject it and conclude that your results are statistically significant. But how does that translate to specific values of your test statistic? Where do you draw the line?
For instance, t-values of zero match the null value. But how far from zero should your t-value be to be statistically significant? Is 1 enough? 2? 3? If your t-value is 2, what does it mean anyway? In this case, we know that the sample mean doesn’t equal the null value, but how exceptional is it? To complicate matters, the dividing line changes depending on your sample size and other study design issues.
Similar types of questions apply to the other test statistics too.
To interpret individual values of a test statistic, we need to place them in a larger context. Towards this end, let me introduce you to sampling distributions for test statistics!
Performing a hypothesis test on a sample produces a single test statistic. Now, imagine you carry out the following process:
This process produces the distribution of test statistic values that occurs when the effect does not exist in the population (i.e., the null hypothesis is true). Statisticians refer to this type of distribution as a sampling distribution, a kind of probability distribution.
Why would we need this type of distribution?
It provides the larger context required for interpreting a test statistic. More specifically, it allows us to compare our study’s single test statistic to values likely to occur when the null is true. We can quantify our sample statistic’s rareness while assuming the effect does not exist in the population. Now that’s helpful!
Fortunately, we don’t need to collect many random samples to create this distribution! Statisticians have developed formulas allowing us to estimate sampling distributions for test statistics using the sample data.
To evaluate your data’s compatibility with the null hypothesis, place your study’s test statistic in the distribution.
Related post : Understanding Probability Distributions
Suppose our t-test produces a t-value of two. That’s our test statistic. Let’s see where it fits in.
The sampling distribution below shows a t-distribution with 20 degrees of freedom, equating to a 1-sample t-test with a sample size of 21. The distribution centers on zero because it assumes the null hypothesis is correct. When the null is true, your analysis is most likely to obtain a t-value near zero and less likely to produce t-values further from zero in either direction.
The sampling distribution indicates that our test statistic is somewhat rare when we assume the null hypothesis is correct. However, the chances of observing t-values from -2 to +2 are not totally inconceivable. We need a way to quantify the likelihood.
From this point, we need to use the sampling distributions’ ability to calculate probabilities for test statistics.
Related post : Sampling Distributions Explained
The significance level uses critical values to define how far the test statistic must be from the null value to reject the null hypothesis. When the test statistic exceeds a critical value, the results are statistically significant.
The percentage of the area beneath the sampling distribution curve that is shaded represents the probability that the test statistic will fall in those regions when the null is true. Consequently, to depict a significance level of 0.05, I’ll shade 5% of the sampling distribution furthest away from the null value.
The two shaded areas are equidistant from the null value in the center. Each region has a likelihood of 0.025, which sums to our significance level of 0.05. These shaded areas are the critical regions for a two-tailed hypothesis test. Let’s return to our example t-value of 2.
Related post : What are Critical Values?
In this example, the critical values are -2.086 and +2.086. Our test statistic of 2 is not statistically significant because it does not exceed the critical value.
Other hypothesis tests have their own test statistics and sampling distributions, but their processes for critical values are generally similar.
Learn how to find critical values for test statistics using tables:
Related post : Understanding Significance Levels
P-values are the probability of observing an effect at least as extreme as your sample’s effect if you assume no effect exists in the population.
Test statistics represent effect sizes in hypothesis tests because they denote the difference between your sample effect and no effect —the null hypothesis. Consequently, you use the test statistic to calculate the p-value for your hypothesis test.
The above p-value definition is a bit tortuous. Fortunately, it’s much easier to understand how test statistics and p-values work together using a sampling distribution graph.
Let’s use our hypothetical test statistic t-value of 2 for this example. However, because I’m displaying the results of a two-tailed test, I need to use t-values of +2 and -2 to cover both tails.
Related post : One-tailed vs. Two-Tailed Hypothesis Tests
The graph below displays the probability of t-values less than -2 and greater than +2 using the area under the curve. This graph is specific to our t-test design (1-sample t-test with N = 21).
The sampling distribution indicates that each of the two shaded regions has a probability of 0.02963—for a total of 0.05926. That’s the p-value! The graph shows that the test statistic falls within these areas almost 6% of the time when the null hypothesis is true in the population.
While this likelihood seems small, it’s not low enough to justify rejecting the null under the standard significance level of 0.05. P-value results are always consistent with the critical value method. Learn more about using test statistics to find p values .
While test statistics are a crucial part of hypothesis testing, you’ll probably let your statistical software calculate the p-value for the test. However, understanding test statistics will boost your comprehension of what a hypothesis test actually assesses.
Related post : Interpreting P-values
July 5, 2024 at 8:21 am
“As the observed values progressively fail to match the observed values, the numerator increases, causing the test statistic to rise from zero”.
Sir, this sentence is written in the Chi-squared Test heading. There the observed value is written twice. I think the second one to be replaced with ‘expected values’.
July 5, 2024 at 4:10 pm
Thanks so much, Dr. Raj. You’re correct about the typo and I’ve made the correction.
May 9, 2024 at 1:40 am
Thank you very much (great page on one and two-tailed tests)!
May 6, 2024 at 12:17 pm
I would like to ask a question. If only positive numbers are the possible values in a sample (e.g. absolute values without 0), is it meaningful to test if the sample is significantly different from zero (using for example a one sample t-test or a Wilcoxon signed-rank test) or can I assume that if given a large enough sample, the result will by definition be significant (even if a small or very variable sample results in a non-significant hypothesis test).
Thank you very much,
May 6, 2024 at 4:35 pm
If you’re talking about the raw values you’re assessing using a one-sample t-test, it doesn’t make sense to compare them to zero given your description of the data. You know that the mean can’t possibly equal zero. The mean must be some positive value. Yes, in this scenario, if you have a large enough sample size, you should get statistically significant results. So, that t-test isn’t tell you anything that you don’t already know!
However, you should be aware of several things. The 1-sample test can compare your sample mean to values other than zero. Typically, you’ll need to specify the value of the null hypothesis for your software. This value is the comparison value. The test determines whether your sample data provide enough evidence to conclude that the population mean does not equal the null hypothesis value you specify. You’ll need to specify the value because there is no obvious default value to use. Every 1-sample t-test has its subject-area context with a value that makes sense for its null hypothesis value and it is frequently not zero.
I suspect that you’re getting tripped up with the fact that t-tests use a t-value of zero for its null hypothesis value. That doesn’t mean your 1-sample t-test is comparing your sample mean to zero. The test converts your data to a single t-value and compares the t-value to zero. But your actual null hypothesis value can be something else. It’s just converting your sample to a standardized value to use for testing. So, while the t-test compares your sample’s t-value to zero, you can actually compare your sample mean to any value you specify. You need to use a value that makes sense for your subject area.
I hope that makes sense!
May 8, 2024 at 8:37 am
Thank you very much Jim, this helps a lot! Actually, the value I would like to compare my sample to is zero, but I just couldn’t find the right way to test it apparently (it’s about EEG data). The original data was a sample of numbers between -1 and +1, with the question if they are significantly different from zero in either direction (in which case a one sample t-test makes sense I guess, since the sample mean can in fact be zero). However, since a sample mean of 0 can also occur if half of the sample differs in the negative, and the other half in the positive direction, I also wanted to test if there is a divergence from 0 in ‘absolute’ terms – that’s how the absolute valued numbers came about (I know that absolute values can also be zero, but in this specific case, they were all positive numbers) And a special thanks for the last paragraph – I will definitely keep in mind, it is a potential point of confusion.
May 8, 2024 at 8:33 pm
You can use a 1-sample t test for both cases but you’ll need to set them up slightly different. To detect a positive or negative difference from zero, use a 2-tailed test. For the case with absolute values, use a one-tailed test with a critical region in the positive end. To learn more, read about One- and Two-Tailed Tests Explained . Use zero for the comparison value in both cases.
February 12, 2024 at 1:00 am
Very helpful and well articulated! Thanks Jim 🙂
September 18, 2023 at 10:01 am
Thank you for brief explanation.
July 25, 2022 at 8:32 am
the content was helpful to me. thank you
Save 10% on All AnalystPrep 2024 Study Packages with Coupon Code BLOG10 .
If you’re preparing for the CFA Level I exam in 2025, you already know that Quantitative Methods is one of those topics that can make or break your preparation. It’s the kind of subject that, while initially intimidating, forms the backbone of everything you need to understand in the financial world. Whether numbers are your forte or you tend to lean towards more qualitative aspects, there’s no sidestepping the significance of Quantitative Methods. But here’s the good news: with the right approach, you can not only understand it but also master it, setting yourself up for success not just in the exam but in your entire CFA journey.
Let’s cut to the chase: Why does Quantitative Methods matter so much? You might find yourself asking, “Why should I dive deep into statistical and analytical tools when my day-to-day job doesn’t involve crunching numbers?” The answer is simple yet profound: the concepts and tools you’ll encounter in Quantitative Methods are the bedrock of sound investment decisions. Even if you don’t directly use these techniques daily, having a solid grasp of them ensures you can interpret data, understand trends, and make informed choices—skills that are invaluable in the finance industry.
Now, consider this: Quantitative Methods makes up about 6%-9% of the CFA Level I exam. That might sound like a modest slice, but don’t let the numbers fool you. The concepts you learn here are woven into other sections of the exam. Take the Time Value of Money, for example—a concept you’ll see cropping up in areas like Equity Investments and Fixed Income. So, mastering Quantitative Methods isn’t just about ticking off one section; it’s about laying a foundation that supports your entire exam performance.
So, how do you go about conquering this critical section? It’s not just about hard work; it’s about working smart. Here’s a strategic roadmap that will guide you through mastering Quantitative Methods for CFA Level I.
1. Start with the Learning Outcome Statements (LOS)
Every topic in the CFA curriculum is accompanied by Learning Outcome Statements (LOS). Think of these as your personal blueprint—they tell you exactly what you need to know and what you’ll be tested on. When it comes to Quantitative Methods, each LOS highlights specific skills, whether it’s calculating the future value of cash flows or interpreting the results of hypothesis testing. Your first step in mastering this topic should be a thorough review of each LOS before you dive into the readings.
For example, you might come across an LOS that asks you to describe the use of bootstrap resampling in conducting a simulation based on observed data in investment applications. What does this mean for you? It means you need to understand not just what bootstrap resampling is, but how it applies in real-world investment scenarios. Don’t just gloss over the LOS—take the time to understand fully what’s expected of you. This approach ensures that you’re not just passively reading but actively engaging with the material.
2. Break Down the Material
Quantitative Methods covers a wide spectrum of topics, from the basics of the Time Value of Money to more complex subjects like Hypothesis Testing and Linear Regression. Here’s a common pitfall: trying to rush through these readings in an attempt to cover more ground. Resist that urge. Instead, break down the material, and tackle each reading with patience. Make sure you truly understand one concept before moving on to the next.
For instance, when you reach Hypothesis Testing, don’t just focus on memorizing the formulas. Understand when and how to apply them. What does the LOS require you to know? Is it about recognizing the different types of errors, or is it about understanding the significance levels in hypothesis testing? Spend quality time with each concept—watch AnalystPrep’s detailed video lessons , go through the study notes meticulously, and ensure you’re comfortable with the material before attempting practice questions. This deliberate approach will pay off in the long run.
3. Practice Until You Can’t Get It Wrong
When it comes to mastering Quantitative Methods, practice is non-negotiable. Theoretical knowledge is essential, but it’s the application that will truly prepare you for the exam. Dive into AnalystPrep’s Qbank and practice as many questions as you can get your hands on. But here’s the kicker—don’t just practice for the sake of it. Analyze every mistake you make. For each incorrect answer, ask yourself: “What went wrong here, and how can I avoid this mistake in the future?” This reflective practice is crucial. It’s not about getting it right once; it’s about practicing until you can’t get it wrong.
Mock exams are another invaluable tool in your preparation. They simulate the real exam environment, helping you gauge your readiness. Pay particular attention to your performance in the Quantitative Methods section. If you find yourself consistently struggling with a particular type of question, don’t brush it off. Go back, revisit the topic, and strengthen your understanding. Your goal is to turn every weak spot into a strength before exam day.
4. Stay Organized and Keep Track of Your Progress
Preparing for the CFA Level I exam is more of a marathon than a sprint. With so much material to cover, it’s easy to lose track of your progress. That’s why organization is key. Create a study schedule that maps out your progress through the Quantitative Methods readings. Monitor how much time you’re spending on each topic, and regularly review your notes to reinforce what you’ve learned.
Consider keeping a dedicated study journal. Use it to jot down important points, questions that arise as you study, and areas where you need further clarification. This journal will be a valuable resource as the exam approaches, allowing you to quickly review key concepts and address any lingering doubts.
Now that we’ve established a solid strategy, it’s time to roll up our sleeves and dig into the heart of Quantitative Methods. Each reading in this section of the CFA Level I exam brings its own set of challenges and demands a tailored approach. Let’s explore the critical areas that will not only test your understanding but also sharpen your financial acumen.
The Time Value of Money
The Time Value of Money (TVoM) is more than just a cornerstone of finance; it’s the bedrock on which financial decision-making stands. At its core, the concept is simple: a dollar today holds more value than a dollar in the future because of its potential earning capacity. But don’t be fooled by its apparent simplicity. The calculations involved can quickly become intricate, especially when different compounding periods enter the equation.
To truly master TVoM, begin by internalizing the fundamental formulas for future value (FV) and present value (PV). These are the tools that will help you quantify the concept. Once you have these down, challenge yourself with scenarios where compounding varies—whether it’s annual, semi-annual, or even continuous. This is where your financial calculator becomes not just a tool but an extension of your analytical mind. Master the TVoM functions on your BAII Plus calculator; doing so will not only save you time during the exam but also reduce the risk of errors.
But understanding TVoM goes beyond memorizing formulas. It’s about seeing the bigger picture. How does TVoM influence the valuation of bonds? What role does it play in calculating annuities? Grasping these applications will deepen your comprehension and prepare you for the nuanced questions the CFA exam is known for.
Organizing, Visualizing, and Describing Data
In finance, data isn’t just numbers on a page; it’s the lifeblood of informed decision-making. This reading is your gateway to understanding how to manage, visualize, and interpret data—skills you’ll need daily as a finance professional.
You’ll start by exploring different types of data—nominal, ordinal, interval, and ratio—and the best ways to visualize them, from bar charts to scatter plots. But here’s the key: Don’t just memorize the definitions. Dive into the why and when . Why would you choose a scatter plot over a histogram? When is it more effective to use a bar chart? Your ability to make these decisions is what will set you apart.
This section also introduces you to skewness and kurtosis—terms that describe the shape of a data distribution. These concepts may seem abstract, but they’re critical for interpreting financial data accurately. Make sure you grasp them thoroughly, as they’ll resurface in more advanced readings and across the CFA curriculum.
Probability Concepts
Probability might seem like familiar territory at first glance—most of us have encountered it in school. But the CFA exam takes it to a higher level, requiring you to apply complex formulas and concepts to real-world financial scenarios.
Bayes’ formula is a standout in this reading. It’s not just a formula; it’s a powerful tool for updating probabilities as new information emerges—something that’s invaluable in investment decision-making. Practice applying Bayes’ formula in varied scenarios until it becomes second nature.
You’ll also need to navigate conditional probability and the law of total probability. These topics can trip up even the most prepared candidates, especially when wrapped in complex word problems. The key here is to break down each problem methodically, applying the relevant formulas step by step. With practice, you’ll find that what once seemed daunting becomes manageable, even intuitive.
Common Probability Distributions
Understanding probability distributions is crucial because they underpin much of the analysis you’ll perform in finance. The binomial and normal distributions, in particular, are fundamental.
The normal distribution, with its bell curve, is a cornerstone of statistical analysis in finance. It’s essential for constructing confidence intervals, conducting hypothesis tests, and much more. You need to be comfortable with its properties—like the empirical rule (68-95-99.7 rule)—and proficient at calculating probabilities and z-scores.
This reading also introduces Monte Carlo simulation, a technique that may seem peripheral now but will become increasingly important as you progress to Level II. Monte Carlo simulation models the probability of different outcomes in processes influenced by random variables, providing powerful insights into risk and uncertainty.
Sampling and Estimation
Sampling and estimation form the backbone of many decisions in finance. These concepts allow you to make informed conclusions about a population based on a smaller, more manageable sample.
The Importance of Sampling
Sampling isn’t just about selecting data points; it’s about choosing them wisely to minimize bias and maximize insight. Whether you’re using simple random sampling to ensure every population member has an equal chance of selection or stratified sampling to gain more accurate insights, the method you choose can significantly impact your results.
Estimation in Finance
Once you have your sample, estimation techniques allow you to make educated guesses about the broader population. Whether estimating an investment’s average return or assessing market volatility, it’s crucial to understand that all estimates carry some degree of uncertainty. But by using appropriate sampling methods and acknowledging the limitations of your data, you can make decisions that are both informed and strategically sound.
Hypothesis Testing
Hypothesis testing is more than just a statistical tool; it’s a method for making data-driven decisions. In finance, this could mean anything from evaluating a new investment strategy to testing the impact of economic policies.
Understanding Hypotheses
At the heart of hypothesis testing are two competing hypotheses: the null hypothesis (no effect) and the alternative hypothesis (the effect you’re testing for). The challenge lies in analyzing your sample data to determine whether there’s enough evidence to reject the null hypothesis in favor of the alternative. This isn’t just about crunching numbers—it’s about weighing the strength of evidence and understanding the risks of potential errors.
Real-World Applications
In practice, hypothesis testing helps you navigate the complex world of finance with confidence. Whether you’re assessing a new stock-picking strategy or analyzing the impact of macroeconomic changes, mastering this tool will give you a significant edge.
Linear Regression
Linear regression is your gateway to understanding relationships between variables in finance. Whether you’re exploring how a stock’s return correlates with market movements or predicting future trends, linear regression provides the quantitative backbone.
Exploring Relationships
With linear regression, you can quantify the relationship between two variables—like how a stock’s return relates to the market return. This relationship is encapsulated in the stock’s beta, a critical measure of risk and volatility.
Practical Uses in Finance
Linear regression isn’t just theoretical; it’s applied in everything from portfolio management to economic forecasting. By understanding how to use linear regression qualitatively, you can extract meaningful insights from financial data, even if you’re not a math whiz. This skill is invaluable, helping you make more informed decisions in a highly quantitative field.
To truly excel in the CFA Level I exam, it’s essential to transform your understanding of Quantitative Methods from a mere academic exercise into a practical toolkit that can drive real-world financial decisions. This section isn’t just about mastering formulas or memorizing concepts—it’s about cultivating the ability to think analytically and make informed judgments that will serve you throughout your finance career.
As you prepare, remember that the journey to mastery is just as critical as the destination. Each topic you delve into within Quantitative Methods builds a foundational skill that will be integral not only to passing the exam but also to your broader financial acumen. Whether it’s assessing the time value of money, interpreting complex data, or applying statistical tools to real-world scenarios, these are the skills that will differentiate you as a professional in the financial industry.
The key is to approach your studies with curiosity and an eagerness to apply what you learn to actual financial challenges. Embrace the process of learning, practice consistently, and seek out resources that deepen your understanding and sharpen your skills. With dedication and the right strategies, you’ll not only pass the CFA Level I exam but also lay the groundwork for a successful and impactful career in finance.
To further enhance your preparation, consider exploring these additional resources:
These articles will help you stay informed and prepared as you approach your CFA Level I exam, offering valuable insights and practical advice to support your success. Best of luck with your studies, and remember that mastering Quantitative Methods is just the beginning of your CFA journey.
Offered by AnalystPrep
Comprehensive guide to mastering ethic ....
As you set out on your CFA journey, there’s one area you simply... Read More
At the beginning of 2021, the CFA Institute offered February 2021 level I... Read More
Beta Beta is a measure of systematic risk, which refers to the risk... Read More
Reading 51 – Portfolio Management: An Overview Portfolio management is about creating a... Read More
IMAGES
VIDEO
COMMENTS
The mean pregnancy length is 266 days. We test the following hypotheses. H 0: μ = 266. H a: μ < 266. Suppose a random sample of 40 women who smoke during their pregnancy have a mean pregnancy length of 260 days with a standard deviation of 21 days. The P-value is 0.04.
The p-value for a hypothesis test on a population mean is the area in the tail(s) of the distribution of the sample mean. When the population standard deviation is unknown, use the [latex]t[/latex]-distribution to find the p-value.. If the p-value is the area in the left-tail: Use the t.dist function to find the p-value. In the t.dist(t-score, degrees of freedom, logic operator) function:
Answer. Set up the hypothesis test: A 5% level of significance means that α = 0.05 α = 0.05. This is a test of a single population mean. H0: μ = 65 Ha: μ > 65 H 0: μ = 65 H a: μ > 65. Since the instructor thinks the average score is higher, use a " > > ". The " > > " means the test is right-tailed.
The hypothesis test for a population mean is a well established process: Write down the null and alternative hypotheses in terms of the population mean [latex]\mu[/latex]. Include appropriate units with the values of the mean. Use the form of the alternative hypothesis to determine if the test is left-tailed, right-tailed, or two-tailed.
where μ denotes the mean distance between the holes. Step 2. The sample is small and the population standard deviation is unknown. Thus the test statistic is. T = x¯ −μ0 s/ n−−√. and has the Student t -distribution with n − 1 = 4 − 1 = 3 degrees of freedom. Step 3. From the data we compute x¯ = 0.02075 and s = 0.00171.
There are two formulas for the test statistic in testing hypotheses about a population mean with large samples. Both test statistics follow the standard normal distribution. The population standard deviation is used if it is known, otherwise the sample standard deviation is used. The same five-step procedure is used with either test statistic.
The P-value is 0.0015. Step 4: State a conclusion. Here the logic is the same as for other hypothesis tests. We use the P-value to make a decision. The P-value helps us determine if the difference we see between the data and the hypothesized value of µ is statistically significant or due to chance.
Solution: The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results. We work through those steps below: State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.
In this "Hypothesis Test for a Population Mean," we looked at the four steps of a hypothesis test as they relate to a claim about a population mean. Step 1: Determine the hypotheses. The hypotheses are claims about the population mean, µ. The null hypothesis is a hypothesis that the mean equals a specific value, µ 0.
It is important to note that it is possible to observe any sample mean when the true population mean is true (in this example equal to 191), but some sample means are very unlikely. ... (Step 2) for the hypothesis test. The formula for the test statistic is given below. Test Statistic for Testing H 0: p = p 0. if min(np 0, n(1-p 0))> 5.
Table 8.3: One-sided hypothesis testing for the mean: H0: μ ≤ μ0, H1: μ > μ0. Note that the tests mentioned in Table 8.3 remain valid if we replace the null hypothesis by μ = μ0. The reason for this is that in choosing the threshold c, we assumed the worst case scenario, i.e, μ = μ0 .
One-Sample Z Test Hypotheses. Null hypothesis (H 0): The population mean equals a hypothesized value (µ = µ 0). Alternative hypothesis (H A): The population mean DOES NOT equal a hypothesized value (µ ≠ µ 0). When the p-value is less or equal to your significance level (e.g., 0.05), reject the null hypothesis. The difference between your ...
10) The mean GPA at a certain university is 2.80 with a population standard deviation of 0.3. A random sample of 16 business students from this university had a mean of 2.91. Test to determine whether the mean GPA for business students is greater than the university mean at the 0.10 level of significance. Show all steps. 1) H o
The hypothesis testing formula for some important test statistics are given below: z = \(\frac{\overline{x}-\mu}{\frac{\sigma}{\sqrt{n}}}\). \(\overline{x}\) is the sample mean, \(\mu\) is the population mean, \(\sigma\) is the population standard deviation and n is the size of the sample. ... It is also used to compare the sample mean and ...
Step 1: Determine the hypotheses. The hypotheses for a difference in two population means are similar to those for a difference in two population proportions. The null hypothesis, H 0, is again a statement of "no effect" or "no difference.". H 0: μ 1 - μ 2 = 0, which is the same as H 0: μ 1 = μ 2. The alternative hypothesis, H a ...
The formula for the test statistic (TS) of a population mean is: x ¯ − μ s ⋅ n. x ¯ − μ is the difference between the sample mean ( x ¯) and the claimed population mean ( μ ). s is the sample standard deviation. n is the sample size. In our example: The claimed ( H 0) population mean ( μ) was 55.
Hypothesis Test about the Population Mean (μ) when the Population Standard Deviation (σ) is Known. We are going to examine two equivalent ways to perform a hypothesis test: the classical approach and the p-value approach. The classical approach is based on standard deviations. This method compares the test statistic (Z-score) to a critical ...
Hypothesis Testing Formula. Z = ( x̅ - μ0 ) / (σ /√n) Here, x̅ is the sample mean, μ0 is the population mean, σ is the standard deviation, n is the sample size. How Hypothesis Testing Works? An analyst performs hypothesis testing on a statistical sample to present evidence of the plausibility of the null hypothesis.
The standardizing formula cannot be solved as it is because we do not have μ, the population mean. However, if we substitute in the hypothesized value of the mean, μ 0 in the formula as above, we can compute a Z value. This is the test statistic for a test of hypothesis for a mean and is presented in Figure 9.3.
Table of contents. Step 1: State your null and alternate hypothesis. Step 2: Collect data. Step 3: Perform a statistical test. Step 4: Decide whether to reject or fail to reject your null hypothesis. Step 5: Present your findings. Other interesting articles. Frequently asked questions about hypothesis testing.
3. Find the test statistic. Find the test statistic and the corresponding p-value. Often we are analyzing a population mean or proportion and the general formula to find the test statistic is: (sample statistic - population parameter) / (standard deviation of statistic) 4. Reject or fail to reject the null hypothesis.
T-Tests, Null = 0. When a t-value equals 0, it indicates that your sample data match the null hypothesis exactly. For a 1-sample t-test, when the sample mean equals the hypothesized mean, the numerator is zero, which causes the entire t-value ratio to equal zero.
Hypothesis Testing. Hypothesis testing is more than just a statistical tool; it's a method for making data-driven decisions. In finance, this could mean anything from evaluating a new investment strategy to testing the impact of economic policies. Understanding Hypotheses
hypothesis test for a population mean given statistics calculator. Select if the population standard deviation, σ σ, is known or unknown. Then fill in the standard deviation, the sample mean, x¯ x ¯, the sample size, n n, the hypothesized population mean μ0 μ 0, and indicate if the test is left tailed, <, right tailed, >, or two tailed ...