Data Analysis for Planning: Statistics, Hypothesis Testing, AHP and Multi-Criteria Analysis
2. Descriptive statistics
Descriptive statistics summarise a data set without claiming more. The mean is Σx/n, the median is the middle value of the ordered data (the average of the two middle values if n is even) and the mode is the most frequent value. Spread is measured by the range, the variance and the standard deviation (SD). For a population, σ² = Σ(x − μ)²/N; for a sample, s² = Σ(x − x̄)²/(n − 1), the divisor n − 1 correcting the bias of a sample, which sits closer to its own mean than to the population mean. SD is the square root of the variance and has the units of the data.
Worked example. Household sizes 2, 4, 4, 4, 5, 5, 7, 9 (n = 8). Mean = 40/8 = 5; median = (4 + 5)/2 = 4.5; mode = 4. Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16, sum 32. Population variance = 32/8 = 4, so σ = 2; sample variance = 32/7 = 4.57, s = 2.14. Coefficient of variation CV = SD/mean × 100 = 2/5 × 100 = 40 % (population SD). Splitting the ordered data into halves 2, 4, 4, 4 and 5, 5, 7, 9 gives quartiles Q1 = 4 and Q3 = 6 (the medians of the halves), so the interquartile range IQR = Q3 − Q1 = 2. Quartile conventions differ between software, so a question must state its method.
| Measure | Use | Note |
|---|---|---|
| Mean | Typical value of symmetric interval or ratio data | Pulled toward outliers and the long tail |
| Median | Typical value of skewed data such as income and land price | Robust to extremes; works for ordinal data |
| Mode | Most common category; the only centre for nominal data | May be absent or several |
| CV | Compare spread of variables with different units or sizes | Unit-free; ratio data only |
| IQR | Spread that ignores outliers | Basis of box plots |
Shape. In a right-skewed (positively skewed) distribution a long tail stretches toward high values and mean > median > mode; a left-skewed one reverses the order. Pearson’s measure is Sk = 3(mean − median)/SD, and for moderately skewed data the empirical relation mode ≈ 3 × median − 2 × mean holds. Kurtosis describes tail heaviness; a normal distribution has kurtosis 3 (excess kurtosis 0). Incomes, plot sizes, land prices and travel times are usually right-skewed, so planners report medians and often take logarithms before analysis.
3. Tests of normality
The normal distribution is symmetric and bell-shaped, with mean = median = mode, skewness 0 and kurtosis 3. About 68 %, 95 % and 99.7 % of values lie within 1, 2 and 3 SD of the mean, and a value is standardised by z = (x − μ)/σ. Many procedures (t-tests, ANOVA, the confidence limits of a regression) assume that the data, or the regression residuals, are approximately normal, so a planner checks this first.
| Method | Idea | How to read it |
|---|---|---|
| Histogram, box plot | Compare the shape with a bell | One symmetric peak, few outliers |
| Normal Q–Q plot | Plot sample quantiles against the quantiles a normal would give | Points on a straight line mean normal; a bow means skew; an S-curve means heavy or light tails |
| Skewness and kurtosis | A normal has skewness 0 and kurtosis 3; the Jarque–Bera test combines both | Large departures from 0 and 3 signal non-normality |
| Shapiro–Wilk test | Statistic W is near 1 when data are normal; powerful for small and moderate samples | p < α: reject normality |
| Kolmogorov–Smirnov test | Statistic D is the largest gap between the empirical CDF and the normal CDF | p < α: reject; if the mean and SD are estimated from the data, use the Lilliefors correction |
If the data are not normal there are three exits: transform them (logarithm for right skew, square root for counts), switch to a non-parametric test (Mann–Whitney for two groups, Kruskal–Wallis for several, Spearman for correlation), or lean on the central limit theorem, which makes the sample mean nearly normal for a large n whatever the shape of the data.
4. Linear and multiple regression
Simple linear regression fits ŷ = a + bx by least squares, minimising Σ(y − ŷ)². The slope is b = Sxy/Sxx = Σ(x − x̄)(y − ȳ)/Σ(x − x̄)² and the intercept a = ȳ − b·x̄, so the line passes through (x̄, ȳ). Total variation splits as SST = SSR + SSE (total = explained + residual), and R² = SSR/SST = 1 − SSE/SST is the share of variation explained; in simple regression R² = r². The standard error of the estimate is s = √(SSE/(n − 2)). To test the slope, t = b/SE(b) with SE(b) = s/√Sxx and n − 2 degrees of freedom; the F-test uses F = MSR/MSE = (SSR/1)/(SSE/(n − 2)), and in simple regression F = t².
Worked example. x = number of bus routes serving a ward (1, 2, 3, 4, 5) and y = daily ridership in thousands (2, 4, 5, 4, 5). x̄ = 3, ȳ = 4; Sxy = 6, Sxx = 10, so b = 0.6 and a = 4 − 0.6 × 3 = 2.2, giving ŷ = 2.2 + 0.6x. SST = 6, SSR = b·Sxy = 3.6, SSE = 2.4, hence R² = 3.6/6 = 0.6. MSE = 2.4/3 = 0.8, SE(b) = √(0.8/10) = 0.283, t = 0.6/0.283 = 2.12 and F = 3.6/0.8 = 4.5 = t². Prediction at x = 4 is 4.6.
Multiple regression is ŷ = b0 + b1x1 + … + bkxk. Each coefficient bj is the expected change in y for one unit of xj holding the other variables constant. The overall F-test (H0: all slopes are zero) uses F = (SSR/k)/(SSE/(n − k − 1)); each coefficient has its own t-test with n − k − 1 degrees of freedom. R² never falls when a variable is added, so use adjusted R² = 1 − (1 − R²)(n − 1)/(n − k − 1), which penalises useless predictors. A category with m levels enters as m − 1 dummy variables.
- Multicollinearity: strongly correlated predictors make coefficients unstable and their signs odd; check the variance inflation factor (VIF).
- Residual assumptions: linear form, independent errors, constant variance (homoscedasticity), roughly normal residuals. Spatial data often break independence through spatial autocorrelation.
5. Hypothesis testing, errors and confidence intervals
A test states a null hypothesis H0 (no effect, no difference, μ = μ0) and an alternative H1, fixes a significance level α (commonly 0.05), computes a test statistic, and compares it with a critical value or converts it to a p-value: the probability, assuming H0 is true, of data at least as extreme as those observed. If p ≤ α, reject H0. A one-tailed test looks for change in a stated direction only; a two-tailed test looks both ways and splits α between the tails.
| Decision | H0 actually true | H0 actually false |
|---|---|---|
| Reject H0 | Type I error, probability α | Correct; probability 1 − β is the power |
| Do not reject H0 | Correct; probability 1 − α | Type II error, probability β |
For a fixed sample size, lowering α raises β, so the two errors trade off. Power rises with a larger sample, a bigger true effect and less variability, so a larger n reduces β without raising α. Planning choice: if a false alarm is costly (building an unneeded flyover), guard against Type I; if missing a real hazard is costly (ignoring a genuine rise in accidents), guard against Type II.
One-sample t-test: t = (x̄ − μ0)/(s/√n) with n − 1 degrees of freedom. Example: n = 36, x̄ = 52, s = 12, H0: μ = 50 gives t = 2/(12/6) = 1.0, far below the usual critical value near 2, so H0 stands. A confidence interval for the mean is x̄ ± t·s/√n; with the large-sample value t ≈ 1.96 as an approximation, 52 ± 1.96 × 2 = 48.08 to 55.92 (the exact t for 35 degrees of freedom, about 2.03, widens it slightly). Because 50 lies inside, a two-sided 5 % test does not reject it: the interval and the test agree. A two-sample t-test compares two group means; a paired t-test compares before and after at the same sites.
6. ANOVA and chi-square
One-way ANOVA tests whether the means of k groups are all equal (H0) by splitting total variation: SST = SSB + SSW, between groups plus within groups. With N observations in all, the degrees of freedom are k − 1 and N − k; MSB = SSB/(k − 1), MSW = SSW/(N − k) and F = MSB/MSW. A large F means the group means differ by more than chance within-group scatter would explain. Running many pairwise t-tests instead inflates the Type I error. The assumptions are independent observations, roughly normal groups and equal variances.
| Source | SS | df | MS | F |
|---|---|---|---|---|
| Between zones | 54 | 2 | 27 | 6.75 |
| Within zones | 24 | 6 | 4 | — |
| Total | 78 | 8 | — | — |
Here the zone means are 6, 9 and 12 and the grand mean is 9. SSB = 3[(6 − 9)² + 0 + (12 − 9)²] = 54; each zone has SS = 4 + 0 + 4 = 8, so SSW = 24. A significant F says only that at least one mean differs; a post-hoc test such as Tukey’s says which. Two-way ANOVA adds a second factor and an interaction term.
Chi-square works on counts of categories. The statistic is χ² = Σ(O − E)²/E. For goodness of fit, df = categories − 1 (less one for each parameter estimated). For a test of independence in a table, E = (row total × column total)/grand total and df = (r − 1)(c − 1); expected counts should be about 5 or more.
Worked example. Mode used by 100 commuters, by income. Low income: 30 bus, 10 car (row total 40). High income: 20 bus, 40 car (row total 60). Column totals are 50 and 50. Expected: 20, 20 for low income and 30, 30 for high income. χ² = 100/20 + 100/20 + 100/30 + 100/30 = 5 + 5 + 3.33 + 3.33 = 16.67 with df = 1. The 5 % critical value for 1 df is 3.84, so independence is rejected: mode choice depends on income.
7. Decision problem structuring: AHP and multi-criteria analysis
Multi-criteria analysis (MCA) helps choose among alternatives judged against several conflicting criteria, such as cost, accessibility, environmental impact and public acceptance. The steps are: define the goal, list alternatives and criteria, weight the criteria, score each alternative on each criterion, aggregate, rank, and test the ranking by sensitivity analysis. Methods are compensatory (weighted sum, where a high score on one criterion can offset a low one) or outranking (ELECTRE, PROMETHEE), and TOPSIS ranks by closeness to an ideal solution.
Analytical Hierarchy Process (Saaty) structures the problem as a hierarchy: goal, criteria, sub-criteria, alternatives. At each level elements are compared in pairs on a 1 to 9 scale: 1 equal, 3 moderate, 5 strong, 7 very strong, 9 extreme importance, with 2, 4, 6, 8 between. The result is a square matrix A with aii = 1 and the reciprocal property aji = 1/aij. The priority vector (weights) is the principal eigenvector, approximated by normalising each column to sum 1 and averaging each row.
Worked example. Cost vs accessibility = 3, cost vs environment = 5, accessibility vs environment = 3. A = [[1, 3, 5], [1/3, 1, 3], [1/5, 1/3, 1]]. Column sums are 1.533, 4.333, 9. Row averages of the normalised matrix give weights 0.633 (cost), 0.260 (accessibility), 0.106 (environment). Multiplying A by the weights and dividing by them gives λmax = 3.039.
Consistency. A perfectly consistent judge obeys aik = aij × ajk (if cost is 3 times access and access is 2 times environment, cost must be 6 times environment). Then λmax = n. In general CI = (λmax − n)/(n − 1) and CR = CI/RI, where RI is the random index of the same order: 0.58 for n = 3, 0.90 for n = 4, 1.12 for n = 5. Here CI = 0.039/2 = 0.019 and CR = 0.019/0.58 = 0.033. CR ≤ 0.10 is acceptable; above it the judgements should be revisited. CR tests the coherence of the judgements, not whether the final ranking is right.
| Site | Cost (0.5) | Access (0.3) | Environment (0.2) | Total score |
|---|---|---|---|---|
| Site A | 80 | 60 | 40 | 66 |
| Site B | 60 | 90 | 70 | 71 |
| Site C | 70 | 70 | 80 | 72 |
Key takeaways
- Primary data are collected first-hand; secondary data are reused. The scale (nominal, ordinal, interval, ratio) decides which statistics are legitimate, and codes and Celsius readings are not ratio numbers.
- Variance divides by N for a population and n − 1 for a sample; CV = SD/mean × 100. The mean is dragged toward the tail, so for right-skewed planning data report the median.
- In Shapiro–Wilk and Kolmogorov–Smirnov, H0 is normality: reject when p < α. A large p is not proof; read the Q–Q plot with it.
- Regression: b = Sxy/Sxx, a = ȳ − b·x̄, R² = SSR/SST, t = b/SE(b), F = MSR/MSE (= t² when simple). In multiple regression each coefficient holds the others constant; use adjusted R².
- Type I (reject a true H0) has probability α; Type II has probability β; power is 1 − β. p is the chance of data this extreme if H0 is true, not the chance H0 is true. ANOVA F = MSB/MSW; chi-square = Σ(O − E)²/E with df = (r − 1)(c − 1).
- AHP: 1 to 9 reciprocal pairwise matrix, weights from the principal eigenvector, CI = (λmax − n)/(n − 1), CR = CI/RI with CR ≤ 0.10 acceptable. Weighted-sum and overlay methods are compensatory: normalise, weight, add, rank.
Practice questions (20)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
Which of the following planning variables is measured on a ratio scale?
Show answer
Answer: B — Monthly household income in rupees
Income has a true zero, so “twice the income” is meaningful: a ratio scale. Temperature in °C is interval (its zero is a convention), the land-use code is nominal, and a 1 to 5 rating is ordinal because the gaps between points are not guaranteed equal.A municipality uses its own property-tax assessment register to study the age and use of the building stock. The data are best described as
Show answer
Answer: B — secondary data from administrative records
The register was created to levy tax, not for this study, so for the planner it is secondary data, specifically administrative data collected as a by-product of service delivery. It is not Census data, and it covers only properties that are on the register, so unregistered buildings are missed.A household survey gives mean income ₹42,000 and median income ₹31,000. Which measure better represents the typical household, and why?
Show answer
Answer: C — The median, because a few very high incomes pull the mean upward in a right-skewed distribution
Mean above median signals a right (positive) skew: a few rich households stretch the upper tail and drag the mean toward it. The median is unaffected by extremes and is the better “typical” value. The mean is the less robust measure, so the claim that it is unaffected by extremes is false.In a normal Q–Q plot of regression residuals (sample quantiles on the vertical axis, normal quantiles on the horizontal axis), the points follow the straight reference line in the middle but bend away from it at both ends, the left end falling below the line and the right end rising above it. This indicates residuals with
Show answer
Answer: A — heavier tails than a normal distribution, with more extreme values than expected
When both ends fall away from the line in opposite directions the sample has more extreme values than a normal would give: heavy tails. A one-sided curve (a bow) would signal skew, and the opposite pattern, left end above the line and right end below it, would signal light tails. Good agreement in the middle alone does not establish normality.A Shapiro–Wilk test on 25 observed plot prices returns p = 0.003. At α = 0.05 the correct conclusion is
Show answer
Answer: D — normality is rejected, so consider a transformation or a non-parametric test
The null hypothesis of Shapiro–Wilk is that the data are normal. p = 0.003 is below 0.05, so the null is rejected and the prices are not normal; a log transform or a rank-based test is the usual response. A small p never supports normality; that error is the tempting reading.In a multiple regression of monthly rent (₹) on floor area (m²) and distance from the CBD (km), the coefficient on distance is −250. The correct interpretation is that
Show answer
Answer: A — each extra kilometre lowers the expected rent by ₹250, holding floor area constant
A partial regression coefficient is the expected change in y per unit of that predictor with all other predictors held constant. A correlation lies between −1 and +1, so −250 cannot be one, and a share of variation cannot exceed 100 %. The “without adjustment” reading describes the slope of a simple regression on distance alone; the coefficient here is defined only with floor area held constant (the ceteris paribus condition), so it need not equal the raw effect.In a simple linear regression fitted to 12 observations, the t statistic for the slope is 3.0. The F statistic for the regression, with (1, 10) degrees of freedom, is
Show answer
Answer: D — 9.0
With one predictor the F statistic equals the square of the slope’s t statistic: F = 3.0² = 9.0, and the degrees of freedom match (1 and n − 2 = 10). Taking the square root (1.73) or repeating 3.0 are the common slips; F and t carry the same information in simple regression.A sample of 36 trips has mean duration 52 minutes and standard deviation 12 minutes. For H0: μ = 50 minutes, the one-sample t statistic is
Show answer
Answer: C — 1.0
t = (x̄ − μ0)/(s/√n) = (52 − 50)/(12/6) = 2/2 = 1.0. Omitting the √n gives 2/12 = 0.17; dividing by √n = 6 alone, ignoring s, gives 0.33; and using s/n = 12/36 instead of s/√n gives 6.0. A t of 1.0 is well below the critical value near 2, so H0 is not rejected.A planner lowers the significance level of a test from 0.05 to 0.01 without collecting more data. The most likely consequences are
Show answer
Answer: B — a lower chance of a false positive, but a higher chance β of missing a real effect
Type I probability equals α, so it falls from 5 % to 1 %. With the same data, a stricter rejection threshold makes real effects harder to detect, so β rises and power (1 − β) falls. Only a larger sample can reduce both errors together; β depends on α, the effect size, the variability and n.In an AHP exercise a decision-maker judges cost to be 3 times as important as access, and access to be 2 times as important as environmental impact. For these judgements to be perfectly consistent, cost versus environmental impact must be entered as
Show answer
Answer: D — 6, the product of the two judgements
Consistency requires transitivity of ratios: a(cost, env) = a(cost, access) × a(access, env) = 3 × 2 = 6. Adding judgements (5) is the tempting error and treats ratios as differences. The reciprocal 1/6 would be the entry for environment versus cost, not cost versus environment.Three sites are scored out of 100 on cost, access and environment with weights 0.4, 0.4 and 0.2. Site P scores 90, 40, 60; site Q scores 60, 70, 70; site R scores 50, 80, 80. The weighted-sum ranking, best first, is
Show answer
Answer: A — R, then Q, then P
P = 0.4 × 90 + 0.4 × 40 + 0.2 × 60 = 36 + 16 + 12 = 64; Q = 24 + 28 + 14 = 66; R = 20 + 32 + 16 = 68. So R > Q > P. P has the best cost score, which is why it tempts, but its weak access score lowers the total: the method is compensatory and every criterion counts through its weight.Which of the following statements about scales of measurement are correct?
Show answer
Answer: A — The mean is meaningful for interval and ratio data; B — A ratio scale has a true zero, so statements such as “twice as much” are meaningful; C — The mode can be computed for nominal data such as land-use class
Interval and ratio data support the mean; only ratio data have a true zero, which gives ratios meaning; and the mode needs nothing more than category counts, so it works for nominal data. The median needs an order, which nominal categories do not have, so it applies from the ordinal scale upward.Which of the following statements about tests of normality are correct?
Show answer
Answer: A — The Kolmogorov–Smirnov statistic is the largest gap between the empirical and the theoretical cumulative distribution; B — In the Shapiro–Wilk test the null hypothesis is that the data come from a normal distribution; D — For a normal distribution the mean, median and mode coincide and the skewness is zero
K–S measures the maximum distance between the two cumulative curves, Shapiro–Wilk takes normality as its null, and a normal curve is symmetric, so mean, median and mode coincide with zero skewness. A large p-value shows only a lack of evidence against normality, never proof of it, particularly in small samples where the tests are weak.Which of the following statements about hypothesis testing are correct?
Show answer
Answer: A — A Type I error is the rejection of a null hypothesis that is actually true; B — The power of a test is 1 − β, the probability of detecting a real effect; C — If a 95 % confidence interval for a mean excludes the hypothesised value, a two-sided test at α = 0.05 rejects it
Type I is rejecting a true null, power is 1 − β, and a 95 % interval and a two-sided 5 % test are two views of the same evidence, so excluding the value means rejection. The p-value is computed assuming the null is true; it is the probability of data this extreme under the null, not the probability of the null itself.Which of the following statements about AHP and weighted multi-criteria analysis are correct?
Show answer
Answer: A — A consistency ratio of 0.10 or less is conventionally accepted; B — In the pairwise matrix, aji = 1/aij and the diagonal entries are 1; C — A weighted sum is compensatory: a high score on one criterion can offset a low score on another
CR ≤ 0.10 is the conventional limit, the matrix is reciprocal with ones on the diagonal, and a weighted sum lets strength in one criterion offset weakness in another. CR measures only the internal coherence of the pairwise judgements; consistent judgements can still be wrong or biased, so it says nothing about whether the ranking is correct.The household sizes in a sample of 8 dwellings are 2, 4, 4, 4, 5, 5, 7 and 9. The sample variance (divisor n − 1), correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 4.57
Mean = 40/8 = 5. Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16, sum = 32. Sample variance = 32/(8 − 1) = 32/7 = 4.57. Check: dividing by 8 would give the population variance 4.00, which is the common slip.Ridership y (thousand per day) against the number of bus routes x serving a ward gives, for x = 1, 2, 3, 4, 5, the values y = 2, 4, 5, 4, 5. Using the least-squares line, the predicted ridership at x = 6, correct to one decimal place, is ____.
Numerical answer — type the value.
Show answer
Answer: 5.8
x̄ = 3, ȳ = 4. Sxy = (−2)(−2) + (−1)(0) + 0(1) + (1)(0) + (2)(1) = 6; Sxx = 4 + 1 + 0 + 1 + 4 = 10. b = 0.6, a = 4 − 0.6 × 3 = 2.2. At x = 6: ŷ = 2.2 + 0.6 × 6 = 5.8. This lies outside the fitted range of x, so it is an extrapolation and should be treated cautiously.Commute times (minutes) of households in three zones are: zone 1: 4, 6, 8; zone 2: 7, 9, 11; zone 3: 10, 12, 14. The F ratio of a one-way ANOVA comparing the zone means, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 6.75
Zone means 6, 9, 12; grand mean 9. SSB = 3[(6 − 9)² + 0 + (12 − 9)²] = 54, df = 2, MSB = 27. Each zone has SS = 4 + 0 + 4 = 8, so SSW = 24, df = 9 − 3 = 6, MSW = 4. F = 27/4 = 6.75. Check: SST = 78 = 54 + 24.Of 40 low-income commuters, 30 use the bus and 10 use a car; of 60 high-income commuters, 20 use the bus and 40 use a car. For a chi-square test of independence between income group and mode, the Pearson χ² statistic (no continuity correction), correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 16.67
Column totals: bus 50, car 50; grand total 100. Expected: low-income bus = 40 × 50/100 = 20, low-income car = 20; high-income bus = 60 × 50/100 = 30, high-income car = 30. Every cell deviates by 10, so χ² = 100/20 + 100/20 + 100/30 + 100/30 = 5 + 5 + 3.33 + 3.33 = 16.67, with df = 1.For a pairwise comparison matrix of 4 criteria the principal eigenvalue is λmax = 4.31. The random index for n = 4 is 0.90. The consistency ratio, correct to two decimal places, is ____.
Numerical answer — type the value.
Show answer
Answer: 0.11
CI = (λmax − n)/(n − 1) = (4.31 − 4)/3 = 0.1033. CR = CI/RI = 0.1033/0.90 = 0.1148, which rounds to 0.11. This exceeds the 0.10 limit, so the judgements are too inconsistent and should be revisited.