Lesson 1
Mean, Median and Mode for Grouped Data
For grouped data, the mean, median and mode are found with class midpoints, cumulative frequencies and interpolation formulas. In the worked example (50 students; classes 0-10, 10-20, 20-30, 30-40, 40-50 with frequencies 5, 8, 15, 16, 6), mean = 27, median = 28 and mode ≈ 30.91.
Mean
- Individual scores are not known, so each class is represented by its midpoint x = (lower + upper)/2.
- Midpoints: 5, 15, 25, 35, 45.
- Multiply each midpoint by its frequency: f*x = 25, 120, 375, 560, 270. Each product is the total score of that class.
- Sum f*x = 1350 and sum f = 50.
- Mean = sum(f*x) / sum(f) = 1350/50 = 27.
Median
- Cumulative frequencies (running totals): 5, 13, 28, 44, 50.
- Find N/2 = 50/2 = 25.
- The median class is the first class whose CF is greater than or equal to N/2: here 20-30 (CF = 28).
- Median = L + ((N/2 - CF) / f) * h, where L is the lower boundary of the median class, CF is the cumulative frequency of the class before it, f is the median class frequency and h is the class width.
- Median = 20 + ((25 - 13)/15) * 10 = 20 + 8 = 28.
Mode
- The mode is the most frequent value; for grouped data, the modal class is the class with the highest frequency: 30-40 (f = 16).
- Mode = L + ((f1 - f0) / (2f1 - f0 - f2)) * h, where f1 is the modal class frequency, f0 the frequency of the class before and f2 the frequency of the class after.
- Mode = 30 + ((16 - 15)/(32 - 15 - 6)) * 10 = 30 + 10/11 ≈ 30.91.
Key terms
- Class midpoint
- (lower boundary + upper boundary)/2, used to represent a whole class.
- Cumulative frequency
- The running total of frequencies up to and including a class.
- Median class
- The first class whose cumulative frequency is at least N/2.
- Modal class
- The class with the highest frequency.
- Class width (h)
- Upper boundary minus lower boundary of a class.
Lesson 2
Standard Deviation and Coefficient of Variation
The coefficient of variation (CV) is the ratio of the standard deviation to the mean, usually expressed as a percentage. Because its units cancel, it is unitless and well suited to comparing the relative variability of two or more data sets. Computing it requires first finding the mean and the standard deviation.
Standard deviation
- Measures the dispersion of data around the mean.
- Sample: s = sqrt( Σ(x - x̄)^2 / (n - 1) ).
- Population: σ = sqrt( Σ(x - μ)^2 / N ).
- Squaring the differences makes them positive, so the order of subtraction does not matter.
Coefficient of variation
- Sample: CV = (s / x̄) × 100%.
- Population: CV = (σ / μ) × 100%.
- CV = 20% means the standard deviation is 20% of the mean.
- Units cancel (e.g. feet/feet), so CV is unitless and good for comparing data sets.
Worked example: two tests
- Test A: 79, 84, 86, 81, 89. Sum 419, mean 83.8, s ≈ 3.962.
- CV_A = 3.962 / 83.8 × 100% ≈ 4.73%.
- Test B: 63, 72, 92, 84, 78. Sum 389, mean 77.8, s ≈ 11.995.
- CV_B = 11.995 / 77.8 × 100% ≈ 15.4%.
- Test B shows more relative variation than Test A.
Key terms
- Standard deviation
- Square root of the average squared deviation from the mean. Divide by n-1 for a sample and by N for a population.
- Coefficient of variation
- Standard deviation divided by the mean, often times 100%.
- Sample mean (x̄)
- Sum of the sample values divided by n.
- Unitless
- Having no units because they cancel, which allows comparison across data sets.
Lesson 3
Karl Pearson's Coefficient of Skewness
Karl Pearson's coefficient of skewness is Sk_P = (Mean - Mode) / Standard deviation. For a continuous frequency distribution, you find the mean with the step-deviation method, the mode with the interpolation formula, and the standard deviation with the step-deviation formula. The sign of the result shows the direction of skew.
Formula
- Sk_P = (Mean - Mode) / SD.
- Positive value: mean > mode, so the distribution is right (positively) skewed.
- Negative value: mean < mode, so the distribution is left (negatively) skewed.
- Zero: the distribution is symmetric.
Mean (step-deviation method)
- Find the class midpoints m, choose an assumed mean A, and compute d = (m - A)/i.
- Mean = A + (Σfd / N) × i, where N = Σf.
- Example: A = 35, Σfd = 167, N = 141, i = 10, so Mean = 35 + 11.84 = 46.84.
Mode (continuous series)
- The modal class is the class with the highest frequency.
- Mode = L1 + (f1 - f0) / (2f1 - f0 - f2) × i.
- f1 = modal class frequency, f0 = frequency of the class before it, f2 = frequency of the class after it, L1 = lower limit of the modal class.
- Example: 40 + (35 - 21)/(70 - 21 - 30) × 10 = 40 + 14/19 × 10 ≈ 47.37.
Standard deviation and result
- SD = sqrt( Σfd^2/N - (Σfd/N)^2 ) × i.
- fd^2 means fd × d, not (fd)^2.
- Example: sqrt(609/141 - (167/141)^2) × 10 ≈ sqrt(4.32 - 1.40) × 10 ≈ 17.08.
- Sk_P = (46.84 - 47.37)/17.08 ≈ -0.03, a slight negative skew.
Key terms
- Skewness
- Lack of symmetry in a distribution.
- Karl Pearson's coefficient
- (Mean - Mode)/SD.
- Modal class
- The class with the highest frequency.
- Assumed mean
- A convenient value A used to simplify deviation calculations.
- Step deviation
- d = (m - A)/i, where i is the class width.
Lesson 4
Probability Rules, Conditional Probability and Bayes' Theorem
When events B1, ..., Bn are mutually exclusive, cover the whole sample space and each has non-zero probability, the total probability rule gives P(A) = Σ P(Bi) P(A|Bi). Bayes' theorem reverses the conditioning: P(Bi|A) = P(Bi) P(A|Bi) / P(A). Use total probability to find the overall chance of an outcome, and Bayes' theorem to find which source an observed outcome came from.
Conditions and probability rules
- B1, ..., Bn are mutually exclusive, their union is the sample space, and each P(Bi) > 0.
- The prior probabilities P(Bi) add up to 1, so if all but one is known, the missing one is 1 minus the sum of the others.
- Conditional probability P(A|B) is the probability of A given that B has occurred.
Total probability
- P(A) = P(B1)P(A|B1) + P(B2)P(A|B2) + ... + P(Bn)P(A|Bn).
- Vendor example: A, B and C supply 30%, 40% and 30% of bolts, with defect rates 2%, 3% and 5%.
- P(D) = 0.3(0.02) + 0.4(0.03) + 0.3(0.05) = 0.006 + 0.012 + 0.015 = 0.033.
- Promotion example: X, Y and Z have chances 4/9, 2/9 and 3/9, and would introduce a new subject with probabilities 0.35, 0.52 and 0.80.
- P(N) = (1.4 + 1.04 + 2.4)/9 = 4.84/9 ≈ 0.538.
Bayes' theorem
- P(Bi|A) = P(Bi)P(A|Bi) / Σ P(Bj)P(A|Bj).
- It is used when P(A|B) is known but the inverse P(B|A) is wanted.
- Vendor example: P(A|D) = 0.006/0.033 = 6/33, P(B|D) = 12/33, P(C|D) = 15/33, and these posteriors sum to 1.
Worked examples
- Boxes: box 1 has 1W, 2R, 3B; box 2 has 2W, 3R, 1B; box 3 has 3W, 1R, 2B. Each box is chosen with probability 1/3.
- P(1 red and 1 white) from each box: 2/15, 6/15 and 3/15. So P(box 1 | R and W) = 2/(2 + 6 + 3) = 2/11.
- Bridge: P(wrong design) = 0.1 and P(inferior material) = 0.9. P(collapse | design) = 0.95 and P(collapse | material) = 0.45.
- P(design | collapse) = 0.095/(0.095 + 0.405) = 0.19.
Key terms
- Conditional probability
- P(A|B), the probability of A given that B has occurred.
- Mutually exclusive
- Events that cannot occur together.
- Total probability theorem
- P(A) = Σ P(Bi)P(A|Bi) over a partition of the sample space.
- Bayes' theorem
- P(Bi|A) = P(Bi)P(A|Bi)/P(A), giving the inverse (posterior) probability.
- Prior / posterior
- The probability of a source before / after the outcome is observed.
Lesson 5
Binomial, Poisson and Normal Distribution Problems
Binomial problems use P(X=x) = nCx p^x q^(n-x), with p from the question (coin: 1/2, percentages: divide by 100), q = 1 - p, and n the number of trials. Phrases like 'at least', 'at most' and 'exactly' decide which values of x to add. Poisson suits large n and very small p, with mean m = np and P(X=r) = e^(-m) m^r / r!.
Binomial setup
- Formula: P(X=x) = nCx p^x q^(n-x)
- Coin questions: p = q = 1/2
- Percent data: 20% defective gives p = 20/100 = 0.2
- q = 1 - p (e.g. q = 0.8)
- n = number of times the action is performed (tosses, items drawn)
- 'How many' questions: multiply the probability by the total N
Combination shortcuts
- nC0 = nCn = 1; nC1 = n
- nCr: multiply r terms counting down from n, then divide by r! (10C3 = 10*9*8/(3*2*1) = 120)
- nCr = nC(n-r), so 10C7 = 10C3 and 5C4 = 5C1 = 5
At least / at most / exactly
- At least k: P(X>=k), add P(k)+P(k+1)+...+P(n)
- At most k: P(X<=k), add P(0)+P(1)+...+P(k)
- More than k: start from k+1
- Exactly k: use P(X=k) only
Worked examples
- Coin tossed 5 times: P(3 heads) = 5C3 (1/2)^5 = 10/32 = 5/16 = 0.3125
- P(at least 4 heads) = [5C4 + 5C5](1/2)^5 = 6/32 = 3/16 = 0.1875
- 20% defective bolts, 4 drawn: P(1 defective) = 4C1(0.2)(0.8)^3
- P(at most 2 defective) = P(0) + P(1) + P(2)
Poisson distribution
- Use it when the question says Poisson, or when n is large and p is very small (e.g. p = 0.005), or when e^(-m) values are given
- Mean = variance = m = np; 'average' also means the mean
- P(X=r) = e^(-m) m^r / r!
- Example: p = 0.005, sample of 200, so m = 200*0.005 = 1; P(exactly 3) = e^(-1)/3!
Key terms
- Binomial distribution
- Distribution of the number of successes in n independent trials: P(X=x) = nCx p^x q^(n-x).
- p and q
- Probability of success and of failure on one trial, with p + q = 1.
- n
- Number of trials, i.e. how many times the action is performed.
- Poisson distribution
- P(X=r) = e^(-m) m^r / r!, used for rare events where n is large and p is small.
- m (Poisson mean)
- m = np; it equals both the mean and the variance of the Poisson distribution.
Lesson 6
Pearson and Spearman Rank Correlation with Regression Lines
Karl Pearson's coefficient of correlation r measures the linear relationship between x and y. For individual series it can be computed with four methods: actual mean, assumed mean, actual data, and variance-covariance. Grouped series (intervals with frequencies) use a single assumed-mean formula with frequencies and step deviations.
Topics in correlation
- Karl Pearson's coefficient: the lengthy topic, with 5 formulas
- Spearman's rank correlation method
- Concurrent deviation method
- Individual series: x and y given with no frequencies; grouped series: class intervals with frequencies
Individual series methods
- Actual mean: r = Σ(x-x̄)(y-ȳ) / [√Σ(x-x̄)^2 · √Σ(y-ȳ)^2]
- Assumed mean: dx = x - A, dy = y - A; r = [nΣdxdy - Σdx·Σdy] / [√(nΣdx^2 - (Σdx)^2) · √(nΣdy^2 - (Σdy)^2)]
- Actual data: r = [nΣxy - Σx·Σy] / [√(nΣx^2 - (Σx)^2) · √(nΣy^2 - (Σy)^2)]
- Variance-covariance: r = Cov(x,y) / √(Var x · Var y) = Cov / (σx·σy), where Cov = Σ(x-x̄)(y-ȳ)/n
- Some books write x for x - x̄; the formula is the same
- Σdx^2 (sum of a column of squares) is not the same as (Σdx)^2 (square of the sum)
Choosing a method
- Use the actual mean when x̄ and ȳ are whole numbers
- Use an assumed mean when the means are decimals; the answer is the same either way
- Product moment correlation is Pearson's r
- When covariance and variances are given, use the variance-covariance formula directly
Grouped series
- Find the mid values of the intervals, then d = (mid - A)/class width (step deviation)
- Use the same assumed-mean formula with f: [NΣfdxdy - Σfdx·Σfdy] / [√(NΣfdx^2 - (Σfdx)^2) · √(NΣfdy^2 - (Σfdy)^2)]
- Build a correlation table: in each cell, multiply dx * dy * f
- Add frequencies along rows and columns to get the marginal f for x and for y
Key terms
- Karl Pearson's r
- Coefficient measuring the linear correlation between x and y.
- Assumed mean
- A chosen value A used to compute deviations d = x - A.
- Covariance
- Σ(x-x̄)(y-ȳ)/n.
- Spearman's rank correlation
- A correlation method based on ranks rather than raw values.
- Grouped series
- Data given as class intervals with frequencies.
Lesson 7
Index Numbers and Fisher's Ideal Index
Weighted index numbers compare current prices (p1) with base-year prices (p0) using quantities as weights. The three key ones are Laspeyres (base-year quantities), Paasche (current-year quantities) and Fisher's ideal index, which is the geometric mean of the two.
Formulas
- Laspeyres: P01 = Σp1q0 / Σp0q0 × 100 (everything is 0 except p1)
- Paasche: P01 = Σp1q1 / Σp0q1 × 100 (everything is 1 except p0)
- Fisher: P01 = √[(Σp1q0/Σp0q0) × (Σp1q1/Σp0q1)] × 100 = √(L × P)
Procedure
- Label base-year price p0 and quantity q0, and current-year price p1 and quantity q1
- Make four columns: p1q0, p0q0, p1q1, p0q1, and total each one
- Substitute the totals into the formulas
- Recheck the products, because an error carries into Fisher's index too
Worked example
- Σp1q0 = 505, Σp0q0 = 425, Σp1q1 = 530, Σp0q1 = 470
- Laspeyres = 505/425 × 100 = 118.82
- Paasche = 530/470 × 100 = 112.77
- Fisher = √(1.1882 × 1.1277) × 100 ≈ 115.75 (the board result of 115.96 comes from rounding 1.1882 to 1.19 and 1.1277 to 1.13 before multiplying)
Key terms
- Laspeyres index
- Price index weighted by base-year quantities q0.
- Paasche index
- Price index weighted by current-year quantities q1.
- Fisher's ideal index
- The square root of Laspeyres × Paasche, times 100.
- p0, q0, p1, q1
- Base-year price and quantity, and current-year price and quantity.
Lesson 8
Time Series Trend: Moving Average and Least Squares
The trend of a time series can be measured by the moving average method or the least squares method. A moving average replaces each value with the average of a fixed number of consecutive values, with an extra centring step when the period is even. The least squares method fits a straight line Y = a + bX by solving the normal equations, with X measured as deviations from a chosen origin year.
Moving average: odd period (e.g. 3-yearly)
- Find moving totals of 3 consecutive values: (y1+y2+y3), (y2+y3+y4), and so on.
- Write each total against the middle year of its group.
- Trend value (moving average) = moving total / 3.
- No trend values exist for the first and last year, so data is lost at both ends.
Moving average: even period (e.g. 4-yearly)
- Find 4-year moving totals. Each total falls between two years, not on a year.
- Centre the totals: add each pair of adjacent 4-year totals to get 2-period moving totals of 4 years (8 terms in effect).
- Trend value = centred total / 8. Each value is now placed against an actual year.
- Alternatively, average the two neighbouring 4-year moving averages.
Least squares method (straight-line trend)
- Trend equation: Y = a + bX.
- Take X as the deviation from an origin year: X = year - origin, e.g. year - 1978. Choose the middle year as origin if none is given.
- Normal equations: ΣY = na + bΣX and ΣXY = aΣX + bΣX^2.
- If the origin is the middle year (odd n), ΣX = 0, so a = ΣY/n and b = ΣXY/ΣX^2.
- If ΣX ≠ 0, solve the two normal equations simultaneously, for example by elimination.
- Trend values: substitute each X into Y = a + bX, e.g. Y = 2.40 + 2.17X.
Key terms
- Time series
- Data recorded over successive time periods.
- Trend (secular trend)
- The long-term general movement of a time series.
- Moving average
- The average of a fixed number of consecutive values, moved forward one period at a time.
- Centring
- Averaging adjacent even-period moving averages so the trend values line up with actual time periods.
- Normal equations
- The equations whose solution gives a and b of the least squares line.
- Origin year
- The year taken as X = 0 when coding time.
Lesson 9
Decision Trees and EMV
A decision tree is a diagram of a decision problem: squares mark decision points and circles mark chance events (states of nature). The best act is found by computing the expected monetary value (EMV) of each branch and choosing the largest.
Drawing a decision tree
- Start with a square (decision node D). Draw one branch for each available act.
- At the end of an act with uncertain outcomes, draw a circle (chance node). Draw one branch per state of nature.
- Write the probability on each state branch, e.g. S1 (0.25).
- Write the payoff (profit, or a loss shown as negative) at the end of each branch.
- An act with a certain outcome needs no chance node (probability = 1).
- A later decision, e.g. whether to invest again after a success, gets another square.
EMV and the best act
- EMV of an act = Σ (payoff × probability) over its states.
- Choose the act with the highest EMV when payoffs are profits.
- Table example: A2 had the highest EMV of 34.6, so A2 is the best act.
Word problems: converting to profits
- Profit = gross income - cost.
- Research R1: cost 10,000, P(success) = 0.9, gross income 26,000. Profit on success is 16,000; loss on failure is -10,000. EMV = 0.9(16,000) + 0.1(-10,000) = 13,400.
- Research R2: cost 6,000, P(success) = 0.6, gross income 24,000. Profit is 18,000 or -6,000. EMV = 10,800 - 2,400 = 8,400.
- Royalty: pay 5,000, gross income 20,000, so a certain profit of 15,000.
- Continue current process: a certain profit of 12,000.
- The best act is the royalty, with an EMV of 15,000.
Sequential decisions
- Example: take investment A first, then stop, or take B if A succeeds (and vice versa).
- After a failure, the only option is to stop. After a success, add a new decision square: stop or take the other investment.
- Use any profit 'over cost' directly as the payoff.
Key terms
- Decision node
- A square, where the decision maker chooses between acts.
- Chance node
- A circle, from which the states of nature branch with their probabilities.
- State of nature
- An uncertain outcome outside the decision maker's control.
- Conditional payoff
- The profit or loss of an act under a particular state of nature.
- EMV
- Expected monetary value: the probability-weighted sum of payoffs.
