Descriptive Statistics
Includes: n, mean, median, SD / variance, SEM, CV, skewness / kurtosis, Q1 / Q3, IQR, min / max / range, Shapiro–Wilk (optional).
Purpose: Compute a compact set of summary statistics for one or multiple variables, optionally adding a normality check.
Overview
The Descriptive Statistics tool summarizes each selected dataset (each column / group) with common measures of location, spread, and shape.
Typical use cases:
- Quick summary of multiple variables (mean, SD, quartiles, etc.)
- Comparing groups before running hypothesis tests
- Finding potential outliers via box-and-whiskers visualization
- Checking normality via Shapiro–Wilk (when enabled)
Dialog: input and options
Input tab
You can define datasets in two ways (same conventions as other Assumptions tools):
A) Group by Column
- Select a rectangular range where each column is one variable.
- The first row is treated as a column name.
- Non-numeric / empty cells are ignored per column.
B) Group by ID Use this for a “long” format:
| GroupID | Value |
|---|---|
| A | 12.3 |
| A | 11.7 |
| B | 9.8 |
| ... | ... |
- Group ID: range containing group labels
- Data: numeric values
- Output is produced per group label.

Options tab
You can select which statistics to output and whether to include:
- Box and Whiskers Plot
- Shapiro–Wilk Test

What it does
For each dataset \(x_1, x_2, \dots, x_n\) (after cleaning), BESHStatNG computes the selected statistics below.
Implementation
The calculations are implemented in DescriptiveStat.compute() and supporting routines in src/BaseStat/StatFunc.vb.
Mathematical definitions
Sample size
Mean
Median
BESHStatNG uses the standard median of the sorted data:
- if \(n\) is odd: the middle value
- if \(n\) is even: the average of the two middle values
Variance and standard deviation
BESHStatNG reports the sample variance and sample standard deviation:
Standard error of the mean (SEM)
Coefficient of variation (CV)
CV when mean is near zero
If \(\bar{x}\) is close to zero, CV can become very large or unstable. BESHStatNG does not compute CV when \(\bar{x}=0\).
Minimum, maximum, range
Quartiles and IQR
BESHStatNG computes quartiles using the CDF method (SAS Method 5):
- Sort the data \(x_{(1)} \le \dots \le x_{(n)}\).
- For \(p \in \{0.25, 0.75\}\), compute the rank \(r = p\,n\).
If \(r\) is an integer, the quartile is the mean of the values at ranks \(r\) and \(r+1\):
If \(r\) is not an integer, let \(k=\mathrm{ceil}(r)\) (the smallest integer \(\ge r\)), and take:
Then:
R and SAS comparison for quartiles
BESHStatNG computes \(Q_1\) and \(Q_3\) using SAS percentile definition 5 (often referred to as CDF method / PCTLDEF=5: empirical distribution function with averaging at discontinuities).
This rule is equivalent to R quantile(x, probs = c(0.25, 0.5, 0.75), type = 2) (the averaged inverse empirical CDF).
Defaults differ: R’s default is type = 7 (linear interpolation with \(h = 1 + (n-1)p\)), so quartiles may not match unless you set type = 2.
In SAS, many procedures (for example PROC UNIVARIATE) default to PCTLDEF=5, but you can change the definition via PCTLDEF= (or QNTLDEF= in procedures that use that option).
Skewness and kurtosis
BESHStatNG uses the moment (population) definitions based on central moments divided by \(n\):
Skewness
Kurtosis (Pearson kurtosis)
Kurtosis scale
This is Pearson kurtosis (normal distribution has kurtosis \(=3\)). It is not “excess kurtosis” (which would be kurtosis \(-3\)).
Shapiro–Wilk normality test (optional)
When enabled, BESHStatNG reports:
- Shapiro–Wilk \(W\) statistic
- Two-sided p-value
The test is run only when \(n>3\) and \(n<5000\) (see DescriptiveStat.compute()).
R comparison
R provides shapiro.test(x) (valid for sample sizes up to 5000). BESHStatNG uses an internal implementation and reports the same outputs: \(W\) and a two-sided p-value.
Box and Whiskers plot (optional)
When enabled, BESHStatNG generates a boxplot and an extra small summary table containing:
- \(Q_1\), median, \(Q_3\)
- number of small outliers and big outliers
Outliers are detected using Tukey’s 1.5×IQR rule (implemented in src/Graphics/BoxPlot.vb).
Lower threshold:
Upper threshold:
A value is counted as a small outlier (lower tail) if:
A value is counted as a big outlier (upper tail) if:
Naming
In the output table, Outliers s means small (lower) outliers and Outliers big means upper outliers.
Example (using 001Normality.csv)
You can reproduce the screenshots using the example dataset:
Steps
- Open
001Normality.csvin Excel. - Select the two columns Age and %Fat (including the header row).
- Ribbon → BESH Stat NG → Analyse → Assumptions → Descriptive Statistics
- Choose Group by Column and select the data range.
- Enable:
- the desired statistics
- Box and Whiskers Plot
- Shapiro–Wilk Test
- Output to New Worksheet → Compute.
Interpretation (based on the example output)
- Both variables are summarized (mean, median, SD, quartiles, etc.).
- The boxplot highlights potential outliers in %Fat (two lower-tail outliers are flagged in the “Outliers s” column).
- Shapiro–Wilk p-values below 0.05 suggest evidence against normality for those variables in this small sample (interpret alongside plots and context).
