How to Use the Shapiro-Wilk Test Calculator
This calculator allows you to test whether the dataset is normally distributed by performing the Shapiro-Wilk Test. You can enter raw data manually or upload an Excel or CSV file containing the data you want to analyze.
However, before performing the test, you need to specify the significance level (α) in order to get the correct decision. By default, the calculator specifies α = 0.05, which you can change to match your preferred significance level.
Option 1: Enter Data
Select the “Enter Data” option when you havea single set of numerical observations, either store on a text document, excel, google sheets, or any other textual formut. It allows you to copy-paste the values into the input field.
To perform the Shapiro-Wilk Test using this option:
- Enter your preferred significance level, α.
- Select Enter Data under Data Input.
- Enter or paste the observations into the Data Values field. Separate the values using commas, spaces, tabs, or new lines.
- Click Calculate
Tip. Your dataset must contain at least three numerical observations for the test to work.
Option 2: Upload Excel or CSV
This option is designed to allow you to perform the Shapiro-Wilk test without having to copy-paste values. With this option, you simply need to:
- Enter your preferred significance level, α.
- Select Upload Excel / CSV under Data Input.
- Click Choose File and upload your dataset.
- Review the data preview and select the appropriate worksheet if the Excel file contains multiple sheets.
- Choose how you want to analyze the data:
- Test selected numeric columns: Select one or more numerical variables to test for normality.
- Test separately within groups: Select the grouping variable and the numerical variable or variables you want to test. The calculator will perform a separate normality test for each group.
- Click Calculate
In both cases, the calculator returns the Shapiro-Wilk W statistic, p-value, sample size, and hypothesis-testing decision. It also provides an APA-style report that you can copy and paste into your research report or assignment.
Note. If you select multiple variables or groups from an uploaded dataset, the calculator summarizes their normality test results in a table.
What Is the Shapiro-Wilk Test?
The Shapiro-Wilk test is a statistical hypothesis test used to determine whether a sample comes from a normally distributed population. It was developed by Samuel Shapiro and Martin Wilk in 1965 and is widely used to assess the assumption of normality in statistical analysis.
In statistics, a normal distribution is a continuous probability distribution that is symmetric around its mean and has a bell-shaped curve.
For example, suppose a researcher wants to determine whether students’ examination scores follow a normal distribution. The researcher can use the Shapiro–Wilk test to examine whether the observed scores provide sufficient evidence of a departure from normality.
The test produces a W statistic and a corresponding p-value. A statistically significant result indicates that the sample provides evidence against the assumption of normality. However, a non-significant result means that the test did not detect sufficient evidence to conclude that the population distribution differs from normality.
When Should You Use the Shapiro-Wilk Test?
The Shapiro–Wilk test is commonly used to determine whether a sample comes from a normally distributed population. It is particularly useful for small samples, often those containing fewer than 50 observations, although it can also be used with larger datasets.
The test requires at least three observations. Most statistical software supports sample sizes of up to 5,000 because the commonly used p-value approximation has been validated within this range.
However, this calculator allows you to analyze more than 5,000 observations. For such samples, it calculates the W statistic but does not provide a p-value.
It is also important to consider the sample size when interpreting the results. For small samples, the test may fail to detect departures from normality, while for large samples, even minor departures may produce statistically significant results.
Another commonly used normality test is the Kolmogorov–Smirnov test, which compares the observed distribution with a specified theoretical distribution. However, it is not necessarily better than the Shapiro–Wilk test simply because the sample contains more than 50 observations.
Shapiro-Wilk Test Formula
In most cases, you will not be required to calculate the Shapiro-Wilk test manually. Your main task will be to perform the test and determine whether the data is normally distributed or not. However, it is useful to understand how the W statistic is obtained.
The Shapiro-Wilk Test formula is:
Where:
- W = Shapiro-Wilk test statistic
- x₍ᵢ₎ = Observations arranged in ascending order
- aᵢ = Coefficients obtained from the expected order statistics of a normal distribution
- xᵢ = Individual observation
- x̄ = Sample mean
- n = Sample size
The numerator part of the formula measures the extent to which the ordered observations follow the expected normal distribution pattern. However, the denominator represents the sum of squared deviations from the sample mean, which you can quickly compute using the sum of squares calculator.
While the denominator is easier to compute manually, the numerator of the Shapiro-Wilk test requires computing the expected order statistics, which can be complicated to compute manually. Therefore, you should always use online tools such as the Shapiro-Wilk test calculator on this page and focus on interpreting results rather than understanding how to compute the W-statistic manually.
Assumptions
Before performing the Shapiro-Wilk test, make sure your data meet the following requirements:
- Numerical observations: The variable should contain quantitative measurements.
- Independent observations: Each observation should be independent of the others.
- Sample size: The test requires at least three valid observations.
- Variability: The observations must not all have the same value.
Note that normality is not an assumption you must satisfy before performing the Shapiro-Wilk test. Instead, it is the hypothesis you are testing.
Hypotheses
Like other statistical hypothesis tests, the Shapiro-Wilk test involves a null hypothesis and an alternative hypothesis.
The hypotheses are:
- Null hypothesis (H₀): The population follows a normal distribution.
- Alternative hypothesis (H₁): The population does not follow a normal distribution.
To determine whether there is sufficient evidence to reject the null hypothesis, we compare the calculated p-value with the significance level (α) and make the decision as follows:
- If the p-value is less than the significance level (p < α), we reject the null hypothesis. This means that there is sufficient evidence to conclude that the data deviates from normality.
- However, if the p-value is greater than or equal to the significance level (p ≥ α), we fail to reject the null hypothesis. This implies that at the chosen significance level, there is insufficient evidence to conclude that the data deviates from normality.
Therefore, when performing normality test using the Shapiro-Wilk test, we want a p value greater than or equal to the significance level to assume that the data is approximately normally distributed. However, in real-world scenarios, data rarely satisfies formal normality tests such as the Shapiro-Wilk test. This makes it highly useful to examine graphical approaches like histograms and Q-Q plots to determine if the data is approximately normal, even when a statistical test flags a significant deviation.
How to Perform a Shapiro–Wilk Test Using the Calculator: An Example
To demonstrate how to perform the Shapiro–Wilk test using this calculator, consider the following example.
Example. A cognitive psychologist conducted a study to examine the reaction times of adults performing a computerized attention task. The researcher recorded the reaction times, in milliseconds, of 15 randomly selected participants.The following observations were obtained:
208, 214, 220, 225, 229, 231, 235, 240, 246, 249, 254, 261, 266, 272, 350
Required:
Using the Shapiro–Wilk test at the 5% significance level, determine whether the reaction times follow a normal distribution.
Solution
Step 1: State the Null and Alternative Hypotheses
The hypotheses are:
- H₀: The population distribution of reaction times is normal.
- H₁: The population distribution of reaction times is not normal.
Step 2: Specify the Significance Level
The question specifies a 5% significance level. Therefore, α = 0.05.
Step 3: Select the Appropriate Statistical Test
Since we want to determine whether the population distribution of reaction times is normal, we will use the Shapiro–Wilk test.
Step 4: Calculate the Test Statistic and P-Value
To perform the test using the Shapiro–Wilk Test Calculator:
- Select Enter Data under Data Input.
- Enter the 15 reaction times provided in the question.
- Set the significance level to 0.05.
- Click Calculate to obtain the results.
The calculator returns the following results:
| Statistic | Result |
|---|---|
| Shapiro–Wilk W | 0.818339 |
| Sample size (n) | 15 |
| p-value | 0.006383 |
| Significance level (α) | 0.05 |
Step 5: Make the Statistical Decision
Since the calculated p-value (0.006383) is less than the significance level (0.05), we reject the null hypothesis.
Step 6: State the Conclusion
At the 5% significance level, there is sufficient statistical evidence to conclude that the population distribution of reaction times differs from a normal distribution.
The reaction time of 350 milliseconds is considerably higher than the other observations and may have contributed to the significant result. The researcher should examine this observation to determine whether it represents a genuine measurement or a recording error.
APA-Style Report
The Shapiro–Wilk test indicated that the reaction times departed significantly from normality, W(15) = .818, p = .006.
What to Do If the Shapiro-Wilk Test Is Significant
A significant Shapiro-Wilk test suggests that the population distribution differs from normality. However, this does not necessarily mean that you cannot use a parametric statistical test.
Before choosing an alternative method, consider the sample size and the extent of the departure from normality.
For example, parametric tests such as the t-test can be reasonably robust to moderate departures from normality, particularly when the sample size is large enough and the observations are independent.
Therefore, when the Shapiro–Wilk test is significant, you should:
- Examine the distribution using a histogram or Q–Q plot to determine whether it is skewed or contains extreme observations.
- Check whether any unusual values result from data-entry errors or genuine measurements.
- Consider the sample size and whether the departure from normality is substantial enough to affect the intended statistical analysis.
- Use an appropriate transformation, robust method, or nonparametric test if the assumptions of your intended procedure are not reasonably satisfied.
You can use the Histogram Maker to examine the shape of your data or the Skewness Calculator to measure the degree of asymmetry.
Note. Do not remove valid observations simply to obtain a non-significant Shapiro–Wilk result. Also, avoid choosing between parametric and nonparametric tests based only on the normality-test p-value.
Shapiro-Wilk Test vs. Kolmogorov-Smirnov Test
Both the Shapiro-Wilk and Kolmogorov-Smirnov tests can be used when assessing whether observed data follow a theoretical distribution. However, the two tests work differently.
The Shapiro-Wilk test examines normality by comparing the ordered observations with the values expected from a normal distribution. On the other hand, the Kolmogorov-Smirnov test compares the empirical cumulative distribution of the sample with a specified theoretical distribution.
Still unsure which to use? Use the Shapiro-Wilk test for most datasets (up to n = 5,000) because it has greater statistical power to detect non-normality than other tests. However, for extremely large samples (n > 5,000), you can switch to the Kolmogorov-Smirnov test.
Frequently Asked Questions
A Shapiro-Wilk test calculator is an online statistical tool used to determine whether a sample comes from a normally distributed population. This calculator accepts raw observations or uploaded datasets and returns the W statistic, p-value, hypothesis decision, and APA-style report.
No. The Shapiro-Wilk test requires individual observations because the calculation depends on their ordered values. Therefore, you cannot calculate W using only the sample mean, standard deviation, and sample size.
Yes, but the p-value approximation may be inaccurate for samples larger than 5,000. For this reason, the calculator reports the W statistic without a p-value or hypothesis-testing decision for larger samples.
Yes. The Shapiro–Wilk test is widely used for assessing normality in small samples. However, when the sample size is very small, the test may not have enough statistical power to detect departures from normality. For this reason, a non-significant result should not be taken as proof that the population distribution is normal.
