By the end of this chapter, you will be able to:
These skills will help you make informed decisions based on data, a valuable ability in many technical and business fields.
Correlation and regression analysis are fundamental quantitative techniques used by accountancy professionals to examine relationships between variables. In Kenya’s dynamic business environment, these tools enable accountants to forecast financial performance, assess risks, and support data-driven decision-making. This chapter focuses on applying correlation and regression to analyze financial data, improving the accuracy of budgeting, auditing, and investment appraisals.
Correlation and regression are statistical methods that describe the relationship between two or more variables. Correlation measures the strength and direction of a linear relationship, while regression models the dependency of one variable on another, allowing prediction. These techniques are essential for accountants analyzing trends such as sales and expenses, or credit risk factors.
Correlation quantifies the degree to which two variables move together. The Pearson correlation coefficient (\(r\)) is commonly used for measuring linear correlation between variables \(X\) and \(Y\). It ranges from -1 to +1, where +1 indicates perfect positive correlation, -1 perfect negative correlation, and 0 no linear correlation.
The Pearson correlation coefficient is calculated as:
$$ r = \frac{n\sum xy - \sum x \sum y}{\sqrt{(n\sum x^2 - (\sum x)^2)(n\sum y^2 - (\sum y)^2)}} $$
Example 1: A SACCO wants to assess the correlation between members’ monthly savings (in Ksh) and loan amounts issued (in Ksh) for 5 members.
Given:
\(X =\) Savings = [2000, 3000, 2500, 4000, 3500]
\(Y =\) Loan amounts = [5000, 7000, 6000, 8000, 7500]
\(n = 5\)
Calculate \( \sum x, \sum y, \sum xy, \sum x^2, \sum y^2 \):
\(\sum x = 2000 + 3000 + 2500 + 4000 + 3500 = 15000\)
\(\sum y = 5000 + 7000 + 6000 + 8000 + 7500 = 33500\)
\(\sum xy = (2000 \times 5000) + (3000 \times 7000) + (2500 \times 6000) + (4000 \times 8000) + (3500 \times 7500) = 10,000,000 + 21,000,000 + 15,000,000 + 32,000,000 + 26,250,000 = 104,250,000\)
\(\sum x^2 = 2000^2 + 3000^2 + 2500^2 + 4000^2 + 3500^2 = 4,000,000 + 9,000,000 + 6,250,000 + 16,000,000 + 12,250,000 = 47,500,000\)
\(\sum y^2 = 5000^2 + 7000^2 + 6000^2 + 8000^2 + 7500^2 = 25,000,000 + 49,000,000 + 36,000,000 + 64,000,000 + 56,250,000 = 230,250,000\)
Substitute into formula:
$$ r = \frac{5 \times 104,250,000 - 15000 \times 33500}{\sqrt{(5 \times 47,500,000 - 15000^2)(5 \times 230,250,000 - 33500^2)}} $$
Calculate numerator:
$$ 5 \times 104,250,000 = 521,250,000 $$
$$ 15000 \times 33500 = 502,500,000 $$
$$ Numerator = 521,250,000 - 502,500,000 = 18,750,000 $$
Calculate denominator parts:
$$ 5 \times 47,500,000 = 237,500,000 $$
$$ 15000^2 = 225,000,000 $$
$$ 5 \times 230,250,000 = 1,151,250,000 $$
$$ 33500^2 = 1,122,250,000 $$
Calculate:
$$ \sqrt{(237,500,000 - 225,000,000)(1,151,250,000 - 1,122,250,000)} = \sqrt{12,500,000 \times 29,000,000} $$
$$ = \sqrt{362,500,000,000,000} = 19,040,785.44 $$
Calculate \(r\):
$$ r = \frac{18,750,000}{19,040,785.44} = 0.985 $$
Answer: The correlation coefficient \(r = 0.985\), indicating a very strong positive correlation between savings and loan amounts.
Example 2: A retail business tracks monthly advertising expenditure (Ksh) and sales revenue (Ksh) for 6 months:
\(X =\) Advertising = [10000, 15000, 12000, 18000, 20000, 16000]
\(Y =\) Sales = [50000, 65000, 58000, 72000, 80000, 69000]
\(n=6\)
Calculate sums and then \(r\):
\(\sum x = 10000 + 15000 + 12000 + 18000 + 20000 + 16000 = 91000\)
\(\sum y = 50000 + 65000 + 58000 + 72000 + 80000 + 69000 = 394000\)
\(\sum xy = (10000 \times 50000) + (15000 \times 65000) + (12000 \times 58000) + (18000 \times 72000) + (20000 \times 80000) + (16000 \times 69000) = 500,000,000 + 975,000,000 + 696,000,000 + 1,296,000,000 + 1,600,000,000 + 1,104,000,000 = 6,171,000,000\)
\(\sum x^2 = 10000^2 + 15000^2 + 12000^2 + 18000^2 + 20000^2 + 16000^2 = 100,000,000 + 225,000,000 + 144,000,000 + 324,000,000 + 400,000,000 + 256,000,000 = 1,449,000,000\)
\(\sum y^2 = 50000^2 + 65000^2 + 58000^2 + 72000^2 + 80000^2 + 69000^2 = 2,500,000,000 + 4,225,000,000 + 3,364,000,000 + 5,184,000,000 + 6,400,000,000 + 4,761,000,000 = 26,434,000,000\)
Substitute into formula:
$$ r = \frac{6 \times 6,171,000,000 - 91,000 \times 394,000}{\sqrt{(6 \times 1,449,000,000 - 91,000^2)(6 \times 26,434,000,000 - 394,000^2)}} $$
Calculate numerator:
$$ 6 \times 6,171,000,000 = 37,026,000,000 $$
$$ 91,000 \times 394,000 = 35,854,000,000 $$
$$ Numerator = 37,026,000,000 - 35,854,000,000 = 1,172,000,000 $$
Calculate denominator parts:
$$ 6 \times 1,449,000,000 = 8,694,000,000 $$
$$ 91,000^2 = 8,281,000,000 $$
$$ 6 \times 26,434,000,000 = 158,604,000,000 $$
$$ 394,000^2 = 155,236,000,000 $$
Calculate:
$$ \sqrt{(8,694,000,000 - 8,281,000,000)(158,604,000,000 - 155,236,000,000)} = \sqrt{413,000,000 \times 3,368,000,000} $$
$$ = \sqrt{1,390,184,000,000,000,000} = 1,179,007,627 $$
Calculate \(r\):
$$ r = \frac{1,172,000,000}{1,179,007,627} = 0.994 $$
Answer: The correlation coefficient \(r = 0.994\), showing an extremely strong positive linear relationship between advertising expenditure and sales revenue.
Example 3: A hotel manager wants to find the correlation between room occupancy rate (%) and daily revenue (Ksh) over 7 days:
\(X =\) Occupancy (%) = [60, 70, 55, 80, 75, 65, 85]
\(Y =\) Revenue (Ksh) = [120000, 140000, 110000, 160000, 150000, 130000, 170000]
\(n=7\)
Calculate sums and apply formula:
\(\sum x = 60 + 70 + 55 + 80 + 75 + 65 + 85 = 490\)
\(\sum y = 120000 + 140000 + 110000 + 160000 + 150000 + 130000 + 170000 = 980000\)
\(\sum xy = (60 \times 120000) + (70 \times 140000) + (55 \times 110000) + (80 \times 160000) + (75 \times 150000) + (65 \times 130000) + (85 \times 170000) = 7,200,000 + 9,800,000 + 6,050,000 + 12,800,000 + 11,250,000 + 8,450,000 + 14,450,000 = 69,000,000\)
\(\sum x^2 = 60^2 + 70^2 + 55^2 + 80^2 + 75^2 + 65^2 + 85^2 = 3600 + 4900 + 3025 + 6400 + 5625 + 4225 + 7225 = 34,000\)
\(\sum y^2 = 120000^2 + 140000^2 + 110000^2 + 160000^2 + 150000^2 + 130000^2 + 170000^2 = 1.44 \times 10^{10} + 1.96 \times 10^{10} + 1.21 \times 10^{10} + 2.56 \times 10^{10} + 2.25 \times 10^{10} + 1.69 \times 10^{10} + 2.89 \times 10^{10} = 1.25 \times 10^{11}\)
Substitute:
$$ r = \frac{7 \times 69,000,000 - 490 \times 980,000}{\sqrt{(7 \times 34,000 - 490^2)(7 \times 1.25 \times 10^{11} - 980,000^2)}} $$
Calculate numerator:
$$ 7 \times 69,000,000 = 483,000,000 $$
$$ 490 \times 980,000 = 480,200,000 $$
$$ Numerator = 483,000,000 - 480,200,000 = 2,800,000 $$
Calculate denominator parts:
$$ 7 \times 34,000 = 238,000 $$
$$ 490^2 = 240,100 $$
$$ 7 \times 1.25 \times 10^{11} = 8.75 \times 10^{11} $$
$$ 980,000^2 = 9.604 \times 10^{11} $$
Calculate:
$$ \sqrt{(238,000 - 240,100)(8.75 \times 10^{11} - 9.604 \times 10^{11})} $$
Note: \(238,000 - 240,100 = -2,100\) (negative), indicating calculation inconsistency or data problem. This suggests a weak or no linear correlation. For practical purposes, correlation here is close to zero or undefined.
Answer: The calculation indicates no significant linear correlation between occupancy rate and revenue in this data set.
Regression analysis estimates the relationship between a dependent variable \(Y\) and an independent variable \(X\). The simple linear regression equation predicts \(Y\) from \(X\) as:
$$ \hat{Y} = a + bX $$
Where:
\(b = \frac{n\sum xy - \sum x \sum y}{n\sum x^2 - (\sum x)^2}\) (slope)
\(a = \frac{\sum y - b \sum x}{n}\) (intercept)
Regression is widely used by accountants to forecast sales, expenses, or profits based on historical data.
Example 1: A bank wants to predict loan default amounts (\(Y\)) based on monthly income (\(X\)) for 5 clients:
\(X =\) Income (Ksh) = [30,000, 40,000, 35,000, 50,000, 45,000]
\(Y =\) Default amount (Ksh) = [3,000, 4,500, 3,500, 6,000, 5,000]
\(n=5\)
Calculate sums:
\(\sum x = 30,000 + 40,000 + 35,000 + 50,000 + 45,000 = 200,000\)
\(\sum y = 3,000 + 4,500 + 3,500 + 6,000 + 5,000 = 22,000\)
\(\sum xy = (30,000 \times 3,000) + (40,000 \times 4,500) + (35,000 \times 3,500) + (50,000 \times 6,000) + (45,000 \times 5,000) = 90,000,000 + 180,000,000 + 122,500,000 + 300,000,000 + 225,000,000 = 917,500,000\)
\(\sum x^2 = 30,000^2 + 40,000^2 + 35,000^2 + 50,000^2 + 45,000^2 = 900,000,000 + 1,600,000,000 + 1,225,000,000 + 2,500,000,000 + 2,025,000,000 = 8,250,000,000\)
Calculate slope \(b\):
$$ b = \frac{5 \times 917,500,000 - 200,000 \times 22,000}{5 \times 8,250,000,000 - (200,000)^2} $$
Calculate numerator:
$$ 5 \times 917,500,000 = 4,587,500,000 $$
$$ 200,000 \times 22,000 = 4,400,000,000 $$
$$ Numerator = 4,587,500,000 - 4,400,000,000 = 187,500,000 $$
Calculate denominator:
$$ 5 \times 8,250,000,000 = 41,250,000,000 $$
$$ (200,000)^2 = 40,000,000,000 $$
$$ Denominator = 41,250,000,000 - 40,000,000,000 = 1,250,000,000 $$
Calculate slope:
$$ b = \frac{187,500,000}{1,250,000,000} = 0.15 $$
Calculate intercept \(a\):
$$ a = \frac{22,000 - 0.15 \times 200,000}{5} = \frac{22,000 - 30,000}{5} = \frac{-8,000}{5} = -1,600 $$
Regression equation:
$$ \hat{Y} = -1,600 + 0.15 X $$
Answer: The regression equation is \(\hat{Y} = -1,600 + 0.15 X\), meaning default amount increases by Ksh 0.15 for every Ksh 1 increase in income.
Example 2: A retail shop wants to predict monthly sales (\(Y\)) based on advertising cost (\(X\)) over 6 months:
\(X =\) Advertising (Ksh) = [10,000, 15,000, 12,000, 18,000, 20,000, 16,000]
\(Y =\) Sales (Ksh) = [50,000, 65,000, 58,000, 72,000, 80,000, 69,000]
\(n=6\)
Calculate sums:
\(\sum x = 10,000 + 15,000 + 12,000 + 18,000 + 20,000 + 16,000 = 91,000\)
\(\sum y = 50,000 + 65,000 + 58,000 + 72,000 + 80,000 + 69,000 = 394,000\)
\(\sum xy = (10,000 \times 50,000) + (15,000 \times 65,000) + (12,000 \times 58,000) + (18,000 \times 72,000) + (20,000 \times 80,000) + (16,000 \times 69,000) = 500,000,000 + 975,000,000 + 696,000,000 + 1,296,000,000 + 1,600,000,000 + 1,104,000,000 = 6,171,000,000\)
\(\sum x^2 = 10,000^2 + 15,000^2 + 12,000^2 + 18,000^2 + 20,000^2 + 16,000^2 = 100,000,000 + 225,000,000 + 144,000,000 + 324,000,000 + 400,000,000 + 256,000,000 = 1,449,000,000\)
Calculate slope \(b\):
$$ b = \frac{6 \times 6,171,000,000 - 91,000 \times 394,000}{6 \times 1,449,000,000 - (91,000)^2} $$
Calculate numerator:
$$ 6 \times 6,171,000,000 = 37,026,000,000 $$
$$ 91,000 \times 394,000 = 35,854,000,000 $$
$$ Numerator = 37,026,000,000 - 35,854,000,000 = 1,172,000,000 $$
Calculate denominator:
$$ 6 \times 1,449,000,000 = 8,694,000,000 $$
$$ 91,000^2 = 8,281,000,000 $$
$$ Denominator = 8,694,000,000 - 8,281,000,000 = 413,000,000 $$
Calculate slope:
$$ b = \frac{1,172,000,000}{413,000,000} = 2.84 $$
Calculate intercept \(a\):
$$ a = \frac{394,000 - 2.84 \times 91,000}{6} = \frac{394,000 - 258,440}{6} = \frac{135,560}{6} = 22,593.33 $$
Regression equation:
$$ \hat{Y} = 22,593.33 + 2.84 X $$
Answer: The regression equation is \(\hat{Y} = 22,593.33 + 2.84 X\), meaning sales increase by Ksh 2.84 for every Ksh 1 increase in advertising.
Example 3: A county government office studies the relationship between the number of staff trained (\(X\)) and the improvement in audit scores (\(Y\)) over 7 months:
\(X =\) Staff trained = [5, 8, 6, 10, 9, 7, 11]
\(Y =\) Audit score improvement = [3, 5, 4, 6, 5, 4, 7]
\(n=7\)
Calculate sums:
\(\sum x = 5 + 8 + 6 + 10 + 9 + 7 + 11 = 56\)
\(\sum y = 3 + 5 + 4 + 6 + 5 + 4 + 7 = 34\)
\(\sum xy = (5 \times 3) + (8 \times 5) + (6 \times 4) + (10 \times 6) + (9 \times 5) + (7 \times 4) + (11 \times 7) = 15 + 40 + 24 + 60 + 45 + 28 + 77 = 289\)
\(\sum x^2 = 5^2 + 8^2 + 6^2 + 10^2 + 9^2 + 7^2 + 11^2 = 25 + 64 + 36 + 100 + 81 + 49 + 121 = 476\)
Calculate slope \(b\):
$$ b = \frac{7 \times 289 - 56 \times 34}{7 \times 476 - 56^2} $$
Calculate numerator:
$$ 7 \times 289 = 2,023 $$
$$ 56 \times 34 = 1,904 $$
$$ Numerator = 2,023 - 1,904 = 119 $$
Calculate denominator:
$$ 7 \times 476 = 3,332 $$
$$ 56^2 = 3,136 $$
$$ Denominator = 3,332 - 3,136 = 196 $$
Calculate slope:
$$ b = \frac{119}{196} = 0.61 $$
Calculate intercept \(a\):
$$ a = \frac{34 - 0.61 \times 56}{7} = \frac{34 - 34.16}{7} = \frac{-0.16}{7} = -0.023 $$
Regression equation:
$$ \hat{Y} = -0.023 + 0.61 X $$
Answer: The regression equation is \(\hat{Y} = -0.023 + 0.61 X\), indicating audit score improvement increases by 0.61 points for each additional staff trained.
Understanding the numeric values in correlation and regression is crucial for accountants interpreting data.
Values between 0.3 and 0.7 (or -0.3 and -0.7) indicate moderate correlation.
Regression slope \(b\) shows how much \(Y\) changes for a unit change in \(X\).
Example 1: Given \(r = 0.85\) between company advertising and sales, interpret the relationship.
Answer: The correlation is strong and positive, meaning increased advertising generally leads to increased sales.
Example 2: Regression equation \(\hat{Y} = 5000 + 3X\) for sales prediction, interpret parameters.
Answer: The intercept 5000 means predicted sales are Ksh 5000 when advertising is zero. The slope 3 means sales increase by Ksh 3 for every Ksh 1 spent on advertising.
Example 3: Coefficient of determination \(r^2 = 0.64\) for a regression model.
Answer: 64% of the variation in the dependent variable \(Y\) is explained by changes in \(X\), indicating a good fit.
Correlation and regression rely on assumptions that must be checked to ensure valid conclusions in accounting analysis.
Limitations include:
Example 1: A SACCO finds \(r = 0.9\) between savings and loan amounts but notices one member with extremely high savings.
Answer: The outlier member may inflate \(r\); excluding this value and recalculating correlation is recommended.
Example 2: A regression model predicts expenses from sales but residuals increase as sales increase.
Answer: This violates homoscedasticity; transformations or weighted regression may be needed.
Example 3: Two financial ratios are correlated, but changes in economic policy may affect their relationship.
Answer: External factors can cause spurious correlation; cautious interpretation is necessary.
Calculate the Pearson correlation coefficient for the following data on monthly sales (Ksh) and advertising expenditure (Ksh):
Sales: [120,000; 150,000; 130,000; 160,000; 170,000]
Advertising: [10,000; 12,000; 11,000; 15,000; 16,000] (5 marks)
Using the data below, determine the regression equation to predict monthly expenses (Ksh) based on monthly revenue (Ksh):
Revenue: [200,000; 250,000; 220,000; 270,000; 300,000]
Expenses: [80,000; 90,000; 85,000; 95,000; 100,000] (7 marks)
Interpret the meaning of a correlation coefficient of -0.65 in the context of credit risk and loan default amounts. (3 marks)
A county government office records the number of trainings (X) and the increase in employee productivity score (Y):
X: [3, 5, 4, 6, 7]
Y: [20, 30, 25, 35, 40]
Calculate the regression slope and intercept. (7 marks)
Explain why correlation does not imply causation, giving an example from financial data analysis. (3 marks)
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter explored the fundamental concepts of correlation and regression, beginning with the clear explanation of their meanings and the key terms involved. It then examined the differences and similarities between correlation and regression analysis, highlighting their distinct purposes and interrelated nature. Various methods for calculating correlation coefficients were presented, enabling the measurement of the strength and direction of relationships between variables. The chapter also discussed how to interpret correlation reports effectively to draw meaningful conclusions. Moving on to regression analysis, different techniques for calculating regression equations were introduced, focusing on predicting values based on variable relationships. Finally, the practical applications of regression analysis were covered, demonstrating its usefulness in forecasting and decision-making within quantitative contexts. This comprehensive coverage equips learners with the skills to analyze and interpret relationships between variables confidently.
Given the following data on monthly sales (in Ksh thousands) and advertising expenditure (in Ksh thousands) for a company, calculate the Pearson correlation coefficient between sales and advertising:
Sales: 120, 150, 170, 200, 220
Advertising: 30, 35, 40, 50, 55 (5 marks)
Calculate the Spearman rank correlation coefficient for the following data on client satisfaction ranks and product quality ranks:
Client satisfaction ranks: 1, 2, 3, 4, 5
Product quality ranks: 2, 1, 4, 3, 5 (5 marks)
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.