# Guide: Normality Test

A Normality Test is a statistical procedure that helps you determine if a given set of data follows a normal distribution or not. This is an important aspect of statistical analysis, quality control, and even machine learning models. Why? Many statistical techniques, such as t-tests, ANOVAs, and regression models, assume that the underlying data is normally distributed. If this assumption is violated, the results may be unreliable, leading to inaccurate conclusions and misguided decisions.

The concept of a “normal distribution” might sound complex, but it’s essentially the famous “bell curve” that many of us learned about in school. In a normal distribution, the majority of the data points cluster around the mean, and the frequencies taper off symmetrically towards both ends, forming a bell-like shape. As illustrated above, the first graph represents a normal distribution, where the data is symmetrically distributed around the mean. The second graph, on the other hand, represents a non-normal (exponential in this case) distribution. You can see that the majority of data points are skewed towards one side.

Understanding whether your data follows a normal distribution is crucial in fields like manufacturing, logistics, and especially in methodologies like Lean Six Sigma, where data-driven decision-making is key. This guide aims to provide you with a comprehensive understanding of Normality Tests, from the theory behind them to practical ways of performing these tests using various software tools.

Now that you have a basic understanding of what a Normality Test is and why it’s important, let’s delve into the different methods for testing normality.

## Why Normality Matters

Understanding the distribution of your data is not just an academic exercise; it has direct implications for how you interpret data and make decisions in various settings. Below are some key areas where the concept of normality plays a critical role:

### 1. Statistical Assumptions

Many statistical tests, such as t-tests, ANOVAs, and linear regression models, are based on the assumption that the data is normally distributed. If the data doesn’t meet this criterion, these tests can produce misleading results, which in turn may lead to incorrect conclusions.

### 2. Quality Control in Lean Six Sigma

In methodologies like Lean Six Sigma, ensuring that processes are stable and predictable is crucial. Understanding the distribution of data related to these processes can help you identify variations, anomalies, or trends that need to be addressed. For example, if a manufacturing process is assumed to be normally distributed, you can set control limits and identify outliers more reliably.

### 3. Predictive Modeling

Machine learning and predictive analytics models also often assume that the errors are normally distributed. Knowing the distribution of your data can help you choose the right model or make necessary adjustments to improve the model’s performance.

### Graphical Example: Control Charts

Control charts are a staple in quality control and Lean Six Sigma projects. These charts often assume that the process data follows a normal distribution. Below is a simple control chart illustrating how data points are distributed around the control limits, with the assumption of normality.

You might also be interested in our Contol Chart Tool By understanding the normality of your process data, you can set these control limits with a higher degree of confidence. This makes your quality control efforts more effective and reliable.

The control chart is a practical example of why understanding data normality is essential, particularly in methodologies like Lean Six Sigma where data-driven decision-making is vital.

## Common Methods for Testing Normality

Understanding the distribution of your dataset is a cornerstone of statistical analysis and is particularly important in methodologies like Lean Six Sigma. Testing for normality can be broadly categorized into two methods: Parametric Tests and Graphical Methods. Let’s delve into each in more detail:

#### Parametric Tests

Parametric tests are statistical tests that make certain assumptions about the parameters of the population distribution from which the samples are drawn. Here are the most commonly used parametric tests for checking normality:

1. Shapiro-Wilk Test

• When to Use: This test is most accurate when used on small sample sizes (n < 50).
• How It Works: The test calculates a  statistic that represents a ratio: the squared sum of the differences between the observed and expected values of a normally distributed variable, divided by the sample variance. A  statistic close to 1 indicates that the data is normally distributed.
• Limitations: The test is sensitive to sample size. As the sample size increases, the test may show that the data is not normal even if the deviation from normality is trivial.
2. Kolmogorov-Smirnov Test

• When to Use: This test is better suited for larger sample sizes.
• How It Works: It compares the empirical distribution function of the sample with the distribution expected if the sample were drawn from a normal population. The maximum difference between these two distributions is the  statistic.
• Limitations: It is less powerful for identifying deviations from normality at the tails of the distribution.
3. Anderson-Darling Test

• When to Use: This test is a modified version of the Kolmogorov-Smirnov test and is used when more weight needs to be given to the tails.
• How It Works: It squares the differences between observed and expected values and gives more weight to the tails of the distribution.
• Limitations: Like the Shapiro-Wilk test, it is sensitive to sample size.
4. Lilliefors Test

• When to Use: This is an adaptation of the Kolmogorov-Smirnov test for small sample sizes.
• How It Works: It operates similarly to the Kolmogorov-Smirnov test but corrects for the bias caused by the estimation of parameters from the sample data itself.
• Limitations: It’s less commonly used and not as powerful as the Shapiro-Wilk test for very small sample sizes. #### Graphical Methods

Graphical methods provide a visual approach to understanding the distribution of your data. Here are some commonly used graphical methods:

1. QQ-Plot (Quantile-Quantile Plot)

• A plot of the quantiles of the sample data against the quantiles of a standard normal distribution. A 45-degree line is often added as a reference. If the data points fall along this line, it suggests that the sample data is normally distributed. 1. P-P Plot (Probability-Probability Plot)

• Similar to a QQ-Plot but plots the cumulative probabilities of the sample data against a standard normal distribution. Useful when you are interested in the fit of different types of distributions, not just the normal. 1. Histogram

• A bar graph that shows the frequency of data points in different ranges. If the data is normally distributed, the histogram will resemble a bell curve. 1. Box Plot

• Provides a visual representation of the data’s spread, skewness, and potential outliers. A symmetric box indicates normality, while skewness or outliers suggest non-normality. These are the most common methods for testing normality, each with its own advantages and limitations. Choosing the right method depends on your specific needs, the size of your dataset, and the importance of the tails in your analysis.

## Step-by-Step Guide to Performing a Normality Test

After understanding the importance of normality and the methods available for testing it, the next step is to actually perform these tests. This section will guide you through conducting normality tests using popular software tools such as Minitab, SPSS, and R.

### Using Software Tools

Software tools offer a convenient and efficient way to perform normality tests, particularly when dealing with large datasets. Below we’ll walk you through how to use each of these tools for this purpose.

#### Minitab

##### Introduction to Minitab as a Statistical Software

Minitab is a widely-used statistical software package that offers a range of data analysis capabilities. It is particularly popular in industries like manufacturing and services where Lean Six Sigma methodologies are employed.

##### Steps for Conducting a Normality Test in Minitab
2. Navigate to the Test: Go to Stat > Basic Statistics > Normality Test.
3. Select Variables: Choose the variable(s) you want to test for normality.
4. Run the Test: Click OK to run the test. Minitab will generate an output with the results.
##### Interpretation of Minitab Output
• P-value: A P-value less than 0.05 generally indicates that the data is not normally distributed.
• Test Statistic: Look for the  statistic in the case of a Shapiro-Wilk test.
• Graphical Output: Minitab also provides QQ-Plots and histograms for visual inspection.
##### SPSS
###### How to Use SPSS for Normality Tests

SPSS is another comprehensive statistical software package used in various fields such as social sciences, healthcare, and market research.

2. Go to Test Option: Navigate to Analyze > Descriptive Statistics > Explore.
3. Select Variables: Add the variables you want to test.
4. Run: Click OK to run the test and review the output for the Shapiro-Wilk or Kolmogorov-Smirnov statistics and P-values.

#### R

##### Using R for Normality Tests

R is a free and open-source software environment that is highly extensible and offers numerous packages for statistical analysis.

1. Load Data: Use functions like read.csv() to load your data into R.
2. Perform Test: Use functions such as shapiro.test() for the Shapiro-Wilk test or ks.test() for the Kolmogorov-Smirnov test.
3. Interpret Output: A P-value less than 0.05 typically indicates non-normality.

### Using Python

Python, with its rich ecosystem of data science libraries, offers a powerful environment for conducting normality tests. Below, we’ll explore two examples: the Shapiro-Wilk test and generating a QQ-Plot.

#### Example 1: Shapiro-Wilk Test

##### Python Code Snippet for Performing Shapiro-Wilk Test

You can use the scipy.stats library to perform the Shapiro-Wilk test. First, you’ll need to import the library and then apply the shapiro() function to your dataset.

Here’s how you can do it:

				
from scipy import stats

# Sample data
data = [your_data_here]

# Perform Shapiro-Wilk test
shapiro_result = stats.shapiro(data)

# Output the result
print("Shapiro-Wilk Statistic:", shapiro_result)
print("P-value:", shapiro_result)



##### Interpretation of Results

The output will consist of two values:

• Shapiro-Wilk Statistic: A value close to 1 indicates that the data is normally distributed.

• P-value:

• A P-value less than 0.05 generally indicates that the data is not normally distributed.
• A P-value greater than or equal to 0.05 suggests that the data is normally distributed.

#### Example 2: QQ-Plot

##### Python Code Snippet for Generating a QQ-Plot

You can use the statsmodels library to generate a QQ-Plot. The qqplot() function is used for this purpose.

Here’s a sample code snippet:

				
import statsmodels.api as sm
import matplotlib.pyplot as plt

data = [your_data_here]

# Create QQ-Plot
fig, ax = plt.subplots(figsize=(10, 6))
sm.qqplot(data, line='45', ax=ax)
plt.title('QQ-Plot')
plt.show()



##### Graphical Interpretation
• Points Along the 45-Degree Line: If the points fall along this line, it suggests that the data is normally distributed.

• Points Deviating from the Line: If the points significantly deviate from the 45-degree line, especially at the tails, then the data is not normally distributed.

By using Python, you can easily perform normality tests and visualize the distribution of your dataset. The examples above provide you with the code snippets and interpretation guidelines to get you started.

Once you’re familiar with the basics of normality testing, you may encounter situations that require a more nuanced approach. This section delves into advanced topics such as dealing with non-normal data, data transformation techniques, non-parametric test alternatives, and the impact of sample size on test power.

### Dealing with Non-Normal Data

Not all data sets are normally distributed, and that’s okay. The question is, what do you do when your data is not normal?

• Check the Importance: First, consider how crucial the normality assumption is for your specific analysis or project. In some cases, slight deviations from normality may not significantly impact your results.

• Use Robust Methods: Some statistical methods are robust to deviations from normality. These methods can often be used as a direct replacement for their non-robust counterparts.

### Data Transformation Techniques

If normality is essential for your analysis, you might consider transforming your data to fit a normal distribution better. Common transformation techniques include:

• Log Transformation: Useful for reducing right skewness.

• Square Root Transformation: Effective for count data.

• Box-Cox Transformation: A more generalized form that encompasses many other types of transformations.

				
# Example using Python for Box-Cox Transformation
from scipy import stats

# Perform the transformation
transformed_data, lambda_value = stats.boxcox(original_data)




## Non-Parametric Tests as Alternatives

Non-parametric tests don’t assume any specific distribution and can be a useful alternative when dealing with non-normal data. Examples include:

• Mann-Whitney U Test: An alternative to the independent samples t-test.

• Wilcoxon Signed-Rank Test: An alternative to the paired samples t-test.

• Kruskal-Wallis Test: An alternative to the one-way ANOVA.

### Power and Sample Size

#### How Sample Size Affects the Power of a Normality Test

• Small Sample Sizes: Normality tests are generally less reliable with small sample sizes. They may not detect non-normality even when it exists.

• Large Sample Sizes: On the other hand, with large sample sizes, the tests can detect even trivial deviations from normality, which might not be practically significant.

## Case Studies

Understanding the theoretical aspects of normality tests is crucial, but real-world applications provide valuable insights into their practical relevance. In this section, we will look at some case studies that demonstrate the importance and usage of normality tests in different scenarios and industries.

### Real-World Example of Applying a Normality Test in a Lean Six Sigma Project

In a Lean Six Sigma project focused on reducing the defect rate in an automotive assembly line, a team used normality tests as a part of the Measure phase. The objective was to understand if the distribution of defects over time followed a normal distribution.

1. Data Collection: Data was collected on the number of defects observed each day for a month.

2. Normality Test: A Shapiro-Wilk test was conducted using Minitab to test the normality of the defect rates.

3. Outcome: The P-value was greater than 0.05, indicating that the defect rates were normally distributed.

4. Implication: The result allowed the team to proceed with parametric tests in the Analyze phase, like t-tests and ANOVAs, to identify the root causes of the defects confidently.

## Other Industries

### Application of Normality Tests in Various Industries like FMCG, Automotive, and Logistics

• FMCG (Fast-Moving Consumer Goods): In quality control of product weights, normality tests are often used to ensure that deviations are random and not skewed in any particular direction.

• Automotive: In crash test analyses, normality tests are applied to understand the distribution of impact forces, which helps in designing safer vehicles.

• Logistics: For optimizing delivery times, companies often use normality tests to understand the distribution of delays, thereby helping them improve their time estimates and overall efficiency.

## Conclusion

This comprehensive guide aimed to serve as a one-stop resource on the extensive topic of understanding and conducting normality tests, a cornerstone in statistical analyses and continuous improvement methodologies like Lean Six Sigma. Starting with the foundational principles, the guide navigated through various methods to test for normality, including parametric tests like Shapiro-Wilk and graphical methods such as QQ-Plots. Special attention was given to the practical application of these tests using popular software tools like Minitab, SPSS, R, and Python, providing step-by-step procedures and code snippets.

The guide also ventured into advanced topics, offering insights into handling non-normal data through transformations and non-parametric tests. The power dynamics influenced by sample size, often overlooked, were highlighted to ensure a more nuanced understanding. Real-world case studies from industries like automotive, FMCG, and logistics were included to bridge the gap between theory and practice.

Whether you’re a seasoned professional or a beginner in the realm of data analysis and continuous improvement, this guide aspires to equip you with the essential skills and knowledge to perform normality tests confidently and interpret their results effectively. Your journey towards mastering this critical aspect of data analysis begins here.

## References

A: Normality tests are essential for determining whether your data follows a normal distribution, a foundational assumption in many statistical analyses. If your data is not normally distributed, using techniques that assume normality may lead to incorrect or misleading results. Normality tests help you validate this assumption before proceeding with further analyses.

A: Yes, you can. There are non-parametric tests designed to analyze non-normal data. These tests do not assume any specific distribution and are often used as alternatives to their parametric counterparts. Additionally, you can transform your data to make it more normal-like and then apply parametric tests.

A: Normality tests are generally less reliable for small sample sizes. With fewer data points, it’s difficult to accurately determine the distribution of the dataset. Therefore, caution should be exercised when interpreting the results of a normality test on small samples.

A: Both QQ-Plots and P-P Plots are graphical methods for assessing the distribution of a dataset. A QQ-Plot compares the quantiles of the sample data against a theoretical distribution, while a P-P Plot compares the cumulative probabilities. QQ-Plots are more sensitive to deviations in the tails, whereas P-P Plots focus on deviations across all data points.

A: Yes, software tools like Minitab and Python libraries offer functionalities to automate normality testing. In Minitab, you can use macros to run the test on multiple datasets, while in Python, you can use loops and functions to perform the tests programmatically. This is particularly useful when dealing with large datasets or running repetitive analyses.

## Author #### Daniel Croft

Daniel Croft is a seasoned continuous improvement manager with a Black Belt in Lean Six Sigma. With over 10 years of real-world application experience across diverse sectors, Daniel has a passion for optimizing processes and fostering a culture of efficiency. He's not just a practitioner but also an avid learner, constantly seeking to expand his knowledge. Outside of his professional life, Daniel has a keen Investing, statistics and knowledge-sharing, which led him to create the website learnleansigma.com, a platform dedicated to Lean Six Sigma and process improvement insights.

## Free Lean Six Sigma Templates

Improve your Lean Six Sigma projects with our free templates. They're designed to make implementation and management easier, helping you achieve better results.