Statistical Methods for Business Analytics

Chapter 12
Categorical and Non-Parametric Methods

Diploma in Business Analytics
Statistical Methods for Business Analytics   •   Diploma

Categorical and Non-Parametric Methods

Introduction

Business analysts frequently work with data that are not measured on a continuous numerical scale. A customer may be classified as retained or churned, a product may be rated as poor, fair, good or excellent, and a transaction may be assigned to a region, channel or customer segment. Even when numerical values are available, assumptions required by parametric methods—such as approximate normality, equal variances and interval-level measurement—may not be credible.

Categorical and non-parametric methods provide practical alternatives. Categorical methods analyse counts or proportions in categories, while non-parametric methods analyse ranks, signs or other distribution-free features. They are particularly useful in marketing, operations, human resources, finance, healthcare analytics and customer intelligence.

The central principle is that the method must match the measurement scale and the research question. A chi-square test is appropriate for relationships between categorical variables, whereas a Mann–Whitney test is designed for comparing two independent groups using ranked observations. Neither method should be selected merely because it is convenient.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Distinguish nominal, ordinal, interval and ratio data in business applications.
  2. Construct and interpret contingency tables and conditional percentages.
  3. Apply goodness-of-fit, test of independence and test of homogeneity chi-square procedures.
  4. Select and apply common non-parametric tests, including the sign, Wilcoxon signed-rank, Mann–Whitney U, Kruskal–Wallis and Spearman rank-correlation procedures.
  5. Check assumptions, calculate effect sizes and communicate findings responsibly.
  6. Recognise limitations, ethical risks and appropriate uses of statistical software and AI tools.

1. Measurement Scales and Method Selection

A variable’s measurement scale determines which summaries and tests are defensible.

ScaleMeaningExamplesSuitable summaries
NominalCategories have no inherent orderRegion, payment method, departmentCounts, percentages, mode
OrdinalCategories have an order, but spacing is not known to be equalSatisfaction rating, credit-risk bandCounts, median, percentiles, ranks
IntervalOrdered numerical values with equal differences but no meaningful zeroTemperature in °C, some index scoresMean, standard deviation, correlation
RatioEqual intervals and a meaningful zeroRevenue, waiting time, units soldAll common numerical summaries

A five-point satisfaction item is ordinarily ordinal. It is common to calculate its mean, but this treats the difference between “strongly disagree” and “disagree” as equal to the difference between “agree” and “strongly agree.” That assumption may be acceptable for a carefully designed multi-item scale, but it should not be automatic for a single item.

Parametric tests can sometimes be robust to non-normality, particularly with large, balanced samples. Conversely, non-parametric tests are not assumption-free. They still require appropriate sampling, independence or pairing, and a clearly defined outcome. “Non-parametric” means that the procedure does not require a particular population distribution such as normality; it does not mean that every assumption disappears.

2. Contingency Tables

A contingency table cross-classifies observations according to two categorical variables. Rows represent categories of one variable and columns represent categories of another. The cell value is the observed frequency, written as Oij, where i identifies a row and j identifies a column.

Consider a retailer investigating whether purchase channel is associated with repeat purchase.

ChannelRepeatNot repeatRow total
Online9664160
Store7288160
Column total168152320

A row percentage answers: “Within this channel, what proportion repeated?” Online repeat purchase is 96 ÷ 160 = 60%, while store repeat purchase is 72 ÷ 160 = 45%. A column percentage answers a different question: “Among repeat purchasers, what proportion used each channel?” The analyst must label percentages clearly because row, column and overall percentages are not interchangeable.

The conditional distribution of one variable may be compared across categories of another. A visible difference in percentages is descriptive evidence, not by itself proof of a population association. Inferential testing is needed to assess whether the observed difference could plausibly result from sampling variation.

Expected Frequencies

The chi-square test compares observed cell counts with counts expected under a null hypothesis of independence. For cell (i, j), the expected frequency is:

Eij = (Ri × Cj) / N

where Ri is the total for row i, Cj is the total for column j, and N is the grand total. The formula assumes that the row and column totals are fixed or treated as known margins under the null model.

For the online-repeat cell above, the expected count is (160 × 168) ÷ 320 = 84. The observed count is 96, which is higher than expected under independence.

3. Chi-Square Procedures

3.1 Chi-Square Test of Independence

The test of independence examines whether two categorical variables are statistically associated in a population.

  • Null hypothesis H0: the variables are independent.
  • Alternative hypothesis H1: the variables are associated.

The Pearson chi-square statistic is:

χ² = ∑i=1r ∑j=1c ((Oij − Eij)² / Eij)

Here, r is the number of rows, c is the number of columns, Oij is the observed count and Eij is the expected count. The statistic is non-negative and becomes larger when observed counts differ substantially from expected counts.

The degrees of freedom are:

df = (r − 1)(c − 1)

For the 2 × 2 retailer table, df = (2 − 1)(2 − 1) = 1. The p-value is obtained from a chi-square distribution with the relevant degrees of freedom. If p ≤ α, where α is the chosen significance level, the analyst rejects independence. If p > α, the analyst does not reject independence. A non-significant result does not prove that the variables are independent; it indicates insufficient evidence of association in the available sample.

#### Worked Example

For the retailer table, the expected counts are:

  • Online, repeat: (160 × 168) ÷ 320 = 84
  • Online, not repeat: (160 × 152) ÷ 320 = 76
  • Store, repeat: 84
  • Store, not repeat: 76

Therefore:

χ² = (96−84)²/84 + (64−76)²/76 + (72−84)²/84 + (88−76)²/76 ≈ 7.58

With df = 1, the p-value is approximately 0.006. At the 5% level, the evidence supports an association between channel and repeat purchase. The result does not establish that channel causes repeat purchasing. Other variables, such as customer type, product category or campaign exposure, may explain part of the association.

3.2 Goodness-of-Fit Test

A goodness-of-fit test compares observed counts for one categorical variable with a specified theoretical or business distribution. For example, a company may expect equal numbers of support requests across four weekdays, or a bank may compare observed customer risk categories with a policy benchmark.

The hypotheses are:

  • H0: the population category proportions equal the specified proportions.
  • H1: at least one population proportion differs.

The statistic is the same Pearson form, but expected counts are calculated as Ei = Npi, where pi is the hypothesised proportion for category i. The degrees of freedom are df = k − 1 when no parameters are estimated from the data, where k is the number of categories.

3.3 Test of Homogeneity

A test of homogeneity compares the distribution of a categorical variable across two or more populations or groups. For example, a human-resources analyst may compare the distribution of promotion outcomes across departments. Computationally, the test uses the same chi-square formula as the independence test. The distinction lies in the sampling design and wording of the conclusion: independence concerns relationships between variables in one population, while homogeneity concerns whether distributions are the same across groups.

3.4 Assumptions and Sparse Cells

Important conditions include:

  1. Observations should be independently sampled, unless a method specifically handles dependence.
  2. Each observation should contribute to one appropriate cell.
  3. Categories should be mutually exclusive and collectively adequate.
  4. Expected frequencies should not be too small.

Rules of thumb often require all expected counts to be at least 5, or at least most expected counts to be 5 or more with none extremely small. These are practical guidelines rather than universal laws. When expected counts are sparse, combine substantively similar categories, collect more data, use an exact method such as Fisher’s exact test for a small 2 × 2 table, or use a model designed for sparse data. Categories should never be combined solely to obtain a desired p-value.

3.5 Effect Size for Categorical Association

Statistical significance can result from a very large sample even when an association is practically small. Cramér’s V is a common effect-size measure:

V = √(χ² / (N × min(r − 1, c − 1)))

Here, N is the sample size and min(r−1,c−1) is the smaller of the two adjusted dimensions. V ranges from 0 to 1. Its interpretation depends on context, table size and professional standards; universal cut-offs should be used cautiously. For a 2 × 2 table, V equals the absolute phi coefficient.

For the retailer example, V = √(7.58/320) ≈ 0.154. The relationship is statistically detectable but modest in magnitude. Management should therefore consider expected financial benefit before redesigning the entire channel strategy.

4. Non-Parametric Methods

Non-parametric procedures are useful when data are ordinal, heavily skewed, affected by outliers, or measured from small samples where parametric assumptions are doubtful. Many procedures replace raw observations with ranks. The smallest observation receives the lowest rank, and tied observations receive average ranks.

Ranking removes some information about distances between observations. Consequently, a non-parametric test may be more robust but less powerful than a suitable parametric test when parametric assumptions genuinely hold. The choice should reflect the data-generating process, not a general belief that non-parametric tests are always safer.

4.1 Sign Test

The sign test evaluates a population median or the direction of paired differences. For paired observations, calculate each difference di = Xi,after − Xi,before, omit zero differences, and count positive and negative signs. Under the null hypothesis of no directional change, each non-zero difference has probability 0.5 of being positive. Thus the number of positive signs follows a binomial distribution with parameters n and 0.5.

The sign test is simple and resistant to outliers, but it ignores the size of each difference. It is suitable when only direction is trustworthy or when the distribution of differences is highly irregular.

4.2 Wilcoxon Signed-Rank Test

The Wilcoxon signed-rank test compares two paired or matched measurements. It uses both the direction and rank of the absolute differences.

Procedure:

  1. Calculate paired differences.
  2. Remove zero differences.
  3. Rank the absolute differences, assigning average ranks to ties.
  4. Restore the signs.
  5. Sum positive ranks, W^+, and negative ranks, W^-.
  6. Use the smaller rank sum or an equivalent test statistic, with an exact or large-sample p-value.

The test generally assumes that paired differences are independent across pairs and approximately symmetrically distributed if the interpretation concerns a shift in location. It tests a distributional shift, not automatically a difference in means. It is often used for before-and-after customer satisfaction, delivery time or employee productivity measurements.

4.3 Mann–Whitney U Test

The Mann–Whitney U test, also called the Wilcoxon rank-sum test, compares two independent groups. It is appropriate for ordinal outcomes or continuous outcomes that do not meet assumptions for a two-sample t-test.

All observations are ranked together. If group 1 has sample size n1 and rank sum R1, then:

U1 = n1 n2 + (n1(n1 + 1))/2 − R1

Similarly, U2 = n1n2 − U1. The smaller U is often reported. Here n2 is the size of group 2. Exact methods are preferred for small samples; large-sample approximations may include a continuity correction and tie adjustment.

A frequent but inaccurate interpretation is that the test always compares medians. That interpretation is justified when the two population distributions have similar shape and differ mainly in location. In general, the test assesses whether randomly selected observations from one group tend to be larger than randomly selected observations from the other group.

A useful probability-of-superiority interpretation is:

P(X > Y) + 0.5P(X = Y)

where X is a randomly selected observation from group 1 and Y from group 2. This quantity is estimated from ranks and is closely related to U divided by n1n2. It can be more interpretable than a p-value.

4.4 Kruskal–Wallis Test

The Kruskal–Wallis test extends the rank-based comparison to k independent groups. It is an alternative to one-way ANOVA when the outcome is ordinal, strongly skewed or unsuitable for a normal-theory analysis.

After ranking all N observations together, let Rj be the sum of ranks in group j, with size nj. The basic statistic is:

H = (12 / (N(N + 1))) ∑j=1k (Rj² / nj) − 3(N + 1)

For sufficiently large samples, H is compared with a chi-square distribution with k − 1 degrees of freedom. Ties require a correction, normally calculated by statistical software. The null hypothesis is that the groups have the same distribution. A significant result indicates that at least one group differs, but it does not identify which groups. Post hoc pairwise comparisons with multiplicity adjustment, such as Holm’s procedure, are then required.

4.5 Spearman Rank Correlation

Spearman’s rank correlation, denoted ρs, measures the strength and direction of a monotonic association between two variables. It is useful for ordinal data or numerical data with outliers and non-linear but monotonic relationships.

When there are no tied ranks, the shortcut formula is:

ρs = 1 − (6∑di² / (n(n² − 1)))

where di is the difference between the two ranks for observation i and n is the number of paired observations. With ties, rank the values and calculate the ordinary Pearson correlation between the ranks; software generally uses this approach.

The coefficient ranges from −1 to +1. A positive value indicates that higher values of one variable tend to accompany higher values of the other, while a negative value indicates the opposite. Spearman correlation detects monotonic association, not every form of dependence. It does not establish causation, and a value near zero does not rule out a non-monotonic relationship.

5. Choosing and Reporting a Procedure

A practical selection framework is:

Research questionOutcome and designCommon procedure
Does one categorical variable follow a specified distribution?One categorical variableGoodness-of-fit chi-square
Are two categorical variables associated?Two categorical variablesChi-square independence test
Do groups have the same categorical distribution?Categorical outcome across groupsChi-square homogeneity test
Did paired observations change in direction?Paired ordinal or non-normal outcomeSign test
Did paired observations shift in magnitude and direction?Paired ranked or continuous outcomeWilcoxon signed-rank
Do two independent groups differ?Ordinal or non-normal outcomeMann–Whitney U
Do three or more independent groups differ?Ordinal or non-normal outcomeKruskal–Wallis
Are two variables monotonically related?Paired ordinal or ranked dataSpearman correlation

A professional report should state the design, sample size, descriptive results, test statistic, degrees of freedom where relevant, p-value, effect size or confidence interval where available, and practical meaning. For example: “Repeat purchase was associated with channel, χ²(1) = 7.58, p = .006, Cramér’s V = .154. Repeat purchase was 60% online and 45% in-store; this association is statistically significant but modest.”

Avoid reporting only “p < .05.” A p-value is the probability of results at least as incompatible with the null hypothesis as those observed, assuming the null model and assumptions are appropriate. It is not the probability that the null hypothesis is true, nor does it measure business importance.

6. Illustrative Case: Subscription Churn and Service Experience

Background

A fictional subscription company wants to know whether customers who experienced a service outage are more likely to churn. The analytics team extracts 400 randomly selected customer records. The variables are outage experience (yes/no) and churn status (yes/no).

Problem

Management must decide whether to target outage-affected customers with retention offers. A simple percentage comparison is informative, but decision-makers also need evidence about sampling variation and the size of the relationship.

Analysis

The table is:

Outage experienceChurnedRetainedTotal
Yes5496150
No50200250
Total104296400

Churn is 54 ÷ 150 = 36% among outage-affected customers and 50 ÷ 250 = 20% among customers without an outage. The expected count for outage-and-churn under independence is (150 × 104) ÷ 400 = 39. The expected count for no-outage-and-churn is (250 × 104) ÷ 400 = 65. The Pearson statistic is approximately 13.13 with 1 degree of freedom, producing p < .001. Cramér’s V for this 2 × 2 table is approximately √(13.13/400) = 0.181.

Approach and Solution

The evidence indicates an association between outage experience and churn. The business response should not be a universal discount. The company could first contact affected customers, offer service recovery and examine whether outage duration, complaint handling and customer tenure modify the relationship. A logistic regression could subsequently adjust for confounding variables and estimate predicted churn probabilities.

Outcome

The analysis supports prioritising service recovery for outage-affected customers, but it does not prove that the outage alone caused churn. The sample may contain unmeasured differences, and retention offers should be evaluated through a properly designed experiment where feasible.

Learning Points

  1. Percentages make the pattern understandable; the test evaluates evidence beyond the sample.
  2. Effect size helps assess whether the association is operationally meaningful.
  3. Association is not causation.
  4. The statistical result should be connected to a proportionate managerial action.
  5. Follow-up modelling and experimentation may be needed for prediction and causal decisions.

7. Technology, Governance and Ethical Practice

Spreadsheet tools, statistical packages and business-intelligence platforms can calculate expected frequencies, exact p-values, tie corrections and effect sizes. Analysts should still verify the data structure, category coding, missing-value treatment and test settings. Software output does not replace statistical reasoning.

AI tools can assist with code generation, table formatting and plain-language explanations, but analysts must validate every formula and result. Sensitive customer or employee data should not be uploaded to an unapproved AI service. Reproducible scripts, documented data transformations and version-controlled outputs improve auditability.

Categorical analysis can create fairness risks. A significant relationship between a protected characteristic and a business outcome may reflect discrimination, unequal access, historical bias or legitimate operational differences; the test alone cannot determine which explanation is correct. Analysts should assess representativeness, protect confidentiality, avoid unnecessary small-cell disclosure and follow applicable privacy and equality regulations. Suppressing or merging categories to hide an unfavourable result is unethical and damages decision quality.

8. Limitations and Best Practices

Categorical and non-parametric methods have several limitations:

  • Categorisation can discard information and create arbitrary boundaries.
  • Large samples can make trivial effects statistically significant.
  • Small samples can produce unstable estimates and low power.
  • Multiple testing increases the chance of false-positive findings.
  • Ties and sparse cells require special treatment.
  • Rank tests may not answer a question about means.
  • Cross-sectional association cannot establish temporal order or causality.

Best practice is to define the question before analysing, inspect frequencies and missingness, visualise conditional distributions, check assumptions, select a method based on design and measurement scale, report effect sizes, adjust for multiple comparisons where appropriate, and communicate uncertainty. Pre-specification and sensitivity analysis are valuable when decisions are high stakes.

Chapter Summary

Categorical data are analysed through counts, proportions and contingency tables. Expected frequencies under independence are calculated from row totals, column totals and the grand total. Pearson’s chi-square statistic compares observed and expected counts, with degrees of freedom (r−1)(c−1) for a two-way table. Goodness-of-fit, independence and homogeneity tests use related calculations but answer different questions.

Non-parametric methods are useful for ordinal, ranked, skewed or outlier-prone data. The sign test uses directions, the Wilcoxon signed-rank test uses signed ranks for paired data, the Mann–Whitney U test compares two independent groups, the Kruskal–Wallis test compares three or more independent groups, and Spearman correlation measures monotonic association. These methods still have assumptions and should not be described as assumption-free.

Sound analysis combines appropriate design, transparent calculations, effect-size interpretation, responsible use of software and ethical attention to privacy and fairness. Statistical significance should inform—not replace—professional judgement, operational knowledge and, where possible, experimental evidence.

Key Terms

Measurement scale: The level at which a variable is measured, such as nominal, ordinal, interval or ratio.

Categorical variable: A variable whose values represent groups or categories.

Contingency table: A table that cross-classifies observations by two or more categorical variables.

Observed frequency: The actual count recorded in a table cell.

Expected frequency: The count predicted by a null hypothesis.

Chi-square statistic: A measure of the discrepancy between observed and expected frequencies.

Goodness-of-fit test: A chi-square procedure comparing observed category counts with specified proportions.

Test of independence: A test of whether two categorical variables are associated.

Test of homogeneity: A test of whether categorical distributions are equal across groups.

Degrees of freedom: The number of independent quantities that can vary in a statistical calculation.

Cramér’s V: An effect-size measure for association in a contingency table.

Non-parametric method: A method that does not require a specified population distribution such as normality.

Rank: The ordered position assigned to an observation.

Sign test: A paired-data test based on positive and negative differences.

Wilcoxon signed-rank test: A paired-data test using the ranks and signs of differences.

Mann–Whitney U test: A rank-based test comparing two independent groups.

Kruskal–Wallis test: A rank-based test comparing three or more independent groups.

Spearman rank correlation: A measure of monotonic association based on ranks.

Effect size: A measure of the magnitude or practical importance of a relationship or difference.

Review Questions

Short Answer Questions

  1. What is the difference between a nominal and an ordinal variable?
  2. How is an expected frequency calculated in a contingency table?
  3. What question does a chi-square test of independence address?
  4. When is the Wilcoxon signed-rank test preferable to the sign test?
  5. Why should a p-value not be treated as a measure of business importance?

Long Answer Questions

  1. Explain the construction and interpretation of a contingency table, including row percentages, column percentages and expected frequencies.
  2. Describe the assumptions, hypotheses and reporting requirements of a chi-square test of independence.
  3. Compare the Mann–Whitney U test and the Kruskal–Wallis test in terms of research question, design and interpretation.
  4. Explain why non-parametric methods are not completely assumption-free.
  5. Discuss how effect size, sample size and practical context should influence a managerial interpretation of statistical significance.

Analytical / Application Questions

  1. A retailer records purchase channel and loyalty membership for a random sample of customers. Design a contingency-table analysis, specify the hypotheses, identify the relevant test and explain what additional information should be reported beyond the p-value.
  2. A company measures employee satisfaction before and after a restructuring using a five-point ordinal scale. Explain how you would choose between the sign test and Wilcoxon signed-rank test, including assumptions and interpretation.
  3. A service firm compares customer waiting-time ratings across four branches. Explain how a Kruskal–Wallis analysis could be conducted, what a significant result would mean, and what follow-up analysis would be required.

Multiple Choice Questions with Answers

Question 1

Which measurement scale is most appropriate for a variable recording customer payment method?

A. Nominal

B. Ordinal

C. Interval

D. Ratio

Correct Answer: A. Nominal

Question 2

In a contingency table, the expected frequency for a cell is calculated as:

A. Observed frequency divided by the sample size

B. Row total multiplied by column total, divided by the grand total

C. Row total plus column total, divided by the grand total

D. Grand total divided by the number of cells

Correct Answer: B. Row total multiplied by column total, divided by the grand total

Question 3

For a contingency table with 3 rows and 4 columns, the chi-square test has how many degrees of freedom?

A. 5

B. 6

C. 7

D. 12

Correct Answer: B. 6

Question 4

What is the null hypothesis in a chi-square test of independence?

A. The two categorical variables are associated

B. The population means are equal

C. The two categorical variables are independent

D. The sample variances are equal

Correct Answer: C. The two categorical variables are independent

Question 5

Which procedure is designed for two paired measurements when differences can be ranked?

A. Mann–Whitney U test

B. Wilcoxon signed-rank test

C. Kruskal–Wallis test

D. Chi-square goodness-of-fit test

Correct Answer: B. Wilcoxon signed-rank test

Question 6

Which test compares three or more independent groups using ranks?

A. Sign test

B. Spearman correlation

C. Kruskal–Wallis test

D. Wilcoxon signed-rank test

Correct Answer: C. Kruskal–Wallis test

Question 7

A Mann–Whitney U test is most appropriate for comparing:

A. Two independent groups with ordinal outcomes

B. Two categorical variables in one sample

C. Three paired measurements

D. One sample with a specified category distribution

Correct Answer: A. Two independent groups with ordinal outcomes

Question 8

Spearman rank correlation primarily measures:

A. A difference in group proportions

B. A monotonic association between two variables

C. Equality of variances

D. The expected count in a contingency table

Correct Answer: B. A monotonic association between two variables

Question 9

For a 2 × 2 table with χ² = 8 and N = 200, Cramér’s V is approximately:

A. 0.02

B. 0.10

C. 0.20

D. 0.80

Correct Answer: C. 0.20

Question 10

Which conclusion is most appropriate when a chi-square test produces p > 0.05?

A. The variables are proven independent

B. The null hypothesis is proven true

C. There is insufficient evidence to reject independence at the 5% level

D. The sample must contain no association

Correct Answer: C. There is insufficient evidence to reject independence at the 5% level

Statistical Methods for Business Analytics
Chapter 12 of 15