Sampling data in a distribution and running a Normality test with XLSTAT

Dataset for Normality tests XLS248 KB

Tutorial video
  • Pro Core statistical software

  • System configuration

    • Windows:
      • Versions: 9x/Me/NT/2000/XP/Vista/Win 7
      • Excel: 97 and later
      • Processor: 32 or 64 bits
      • Hard disk: 150 Mb
    • Mac OS X:
      • OS: OS X
      • Excel: X, 2004 and 2011
      • Hard disk: 150Mb.

Benefits

  • Easy and user-friendly
    Easy and user-friendly XLSTAT is flawlessly integrated with Microsoft Excel which is the most popular spreadsheet worldwide. This integration makes it one of the simplest available tools to work with as it utilizes the same philosophy as Microsoft Excel. The program is accessible in a dedicated XLSTAT tab. The analyses are grouped into functional menus. The dialog boxes are user-friendly and setting up an analysis is straightforward.
  • Data and results shared seamlessly
    Data and results shared seamlessly One of the greatest advantages of XLSTAT is the way you can share data and results seamlessly. As the results are stored in Microsoft Excel, anyone can access them. There is no need for the receiver to have an XLSTAT license or any additional viewer which makes your team-work easier and more affordable. In addition, results are easily integrable into other Microsoft Office software such as PowerPoint, so that you can create striking presentation in minutes.
  • Modular
    Modular XLSTAT is a modular product. XLSTAT-Pro is a core statistical module of XLSTAT which includes all the mainstream functionalities in statistics and multivariate analysis. More advanced features contained in add-on modules can be added for specific applications. This way you can adapt the software to your needs making the software more cost-efficient.
  • Didactic
    Didactic The results of XLSTAT are organized by analysis and are easy to navigate. Moreover useful information is provided along with the results to assist you in your interpretation.
  • Affordable
    Affordable XLSTAT is a complete and modular analytical solution that can suit any analytical business needs. It is very reasonably priced so that the return of your investment is almost immediate. Any XLSTAT license comes with top level support and assistance.
  • Accessible - Available in many languages
    Accessible - Available in many languages We have ensured XLSTAT is accessible to everyone by making the program available in many languages, including Chinese, English, French, German, Italian, Japanese, Polish, Portuguese and Spanish.
  • Automatable and customizable
    Automatable and customizable Most of the statistical functions available in XLSTAT can be called directly from the Visual Basic window of Microsoft Excel. They can be modified and integrated to more code to fit to the specificity of your domain. Adding tables and plots as well as modifying existing outputs becomes easy. Furthermore, XLSTAT includes some special tools on the dialog boxes to generate automatically the VBA code in order to reproduce your analysis using the VBA editor or to simply load pre-set settings. This effortless automation of routine analysis will be a huge time saver on your part.

Goal of this tutorial

In this tutorial we first show how to generate a sample from a Normal distribution, then a sample from a uniform distribution. Then we show you how to run normality tests on both samples.

Dataset for sampling a distribution and running a Normality test

An Excel sheet with both the data and the results can be downloaded by clicking here.

We want to generate two samples, the first one sampled in a Normal N(2,4) distribution (mean = 2, variance = 4), the second one in a Uniform distribution, between -1.5 and 5 (mean = 2 and variance = 49/12 =4.08). To do that, we use the "Distribution sampling" tool available in the "Preparing data" section.

Setting up the sampling of data in a distribution

After opening XLSTAT, select the XLSTAT / Preparing data / Distribution sampling command, or click on the corresponding button of the Preparing data toolbar (see below).

barnorm.gif

Once you've clicked on the button, the dialog box appears.

Select the distribution to use, and the corresponding parameters.

Then enter the size of the sample to generate.

The dialog box displayed below corresponds to the generation of a 1000 cases normal N(2,2) sample.

norm1.gif

The computations begin once you have clicked on the OK button, and the sample is displayed.

A second sample is then generated using a Uniform distribution between -1.5 and 5.

Setting up the Normality test

We then want to tests the normality of the two samples. Select the XLSTAT / Describing data / Normality tests, or click on the corresponding button of the Describing data toolbar.

barnorm2.gif

Once you've clicked on the button, the dialog box appears.

Select the two samples, and activate the Independent columns option to confirm that the two samples are independent.

The Q-Q plot option is activated to allow us to visually check the normality of the samples.

norm2.gif

The computations begin once you have clicked on the OK button, and the results are displayed on a new sheet.

Interpreting the results of the Normality test

The results are first displayed for the first sample and then for the second sample.

The first result displayed is the Q-Q plot for the first sample. The Q-Q plot allows to compare the cumulative distribution function (cdf) of the sample (abscissa) to the cumulative distribution function of normal distribution with the same mean and standard deviation (ordinates). In the case of sample following a normal distribution, we should observe an alignment with the first bisecting line. In the other cases some deviations from the bisecting line should be observed.

norm3.gif

We can see here that the empiric cdf is very close to the bissecting line. The Shapiro-Wilk and Jarque-Bera confirm that we cannot reject the normality assumption for the sample. We notice that with the Shapiro-Wilk test, the risk of being wrong when rejecting the null assumption is greater than with the Jarque-Bera test.

norm4.gif

The following results are for the second sample. Contrary to what we observed for the first sample, we notice here on the Q-Q plot that there are two strong deviations indicating that the the distribution is most probably not normal.

norm5.gif

This gap is confirmed by the normality tests (see below) which allow to assert with no hesitation that we need to reject the hypothesis that the sample might be normally distributed.

norm6.gif

Conclusion

As a conclusion, in this tutorial we have seen to generate two samples, one following a Normal distribution, the second following a Uniform distribution. We then confirmed on these samples the validity of the Shapiro-Wilk and Jarque-Bera tests: these tests have confirmed the normality assumption for the first sample, and allowed us to reject it for the second sample.