Basic Statistics · Unit 8
Correlation and Regression Analysis
Exam-focused notes for Correlation and Regression Analysis (Basic Statistics, STA154): what the TU syllabus asks and how it has actually been tested, with 12 solved past questions from this unit.
What this unit covers
- Correlation coefficient definition and properties
- Karl Pearson correlation coefficient
- Spearman rank correlation coefficient
- Interpretation of correlation results
- Simple linear regression model
- Regression equation fitting
- Regression coefficient interpretation
- Estimation using regression equations
- Assumptions of linear regression
Karl Pearson correlation coefficient
Question
A web development team records the number of hours spent on debugging (X) and the number of resolved issues (Y) across 10 sprints.
$$\begin{array}{|c|cccccccccc|}\hline X & 15 & 20 & 25 & 30 & 35 & 40 & 45 & 50 & 55 & 60 \ \hline Y & 3 & 6 & 8 & 11 & 12 & 14 & 16 & 19 & 21 & 22 \ \hline \end{array}$$
a) Calculate the Pearson correlation coefficient to assess the relationship between debugging hours and issues resolved.
b) Derive the regression equation of issues resolved on hours spent debugging.
c) Predict the number of issues resolved for 38 hours of debugging.
[10+0+0+0]
X (hours) 15 20 25 30 35 40 45 50 55 60 --------------------------------- Y (issues) 3 6 8 11 12 14 16 19 21 22 $n = 10$ --- X Y XY X² Y² ------------------- 15 3 45 225 9 20 6 120 400 36 25 8 200 625 64 30 11 330 900 121 35 12 420 1225 144 40 14 560 1600 1...
Full solved answer →Question
A software company tracks the number of hours its employees spend on coding (X) and the corresponding number of bugs they encounter during testing (Y).
$$\begin{array}{|c|cccccccccc|}\hline \text{Hours (X)} & 20 & 25 & 30 & 35 & 40 & 45 & 50 & 55 & 60 & 65 \ \hline \text{Bugs (Y)} & 5 & 7 & 8 & 12 & 15 & 13 & 17 & 18 & 20 & 25 \ \hline \end{array}$$
(a) Calculate the Pearson correlation coefficient.
(b) Find the regression equation of Y on X.
(c) Predict the number of bugs encountered if an employee spends 48 hours coding.
[10+0]
X 20 25 30 35 40 45 50 55 60 65 ------------------------------------------- Y 5 7 8 12 15 13 17 18 20 25 $n = 10$, predict Y at $X = 48$. X Y XY X² Y² ------------------- 20 5 100 400 25 25 7 175 625 49 30 8 240 900 64 35 12 420 1225 144 40 15 600 1600 225 ...
Full solved answer →Properties of Correlation and Analysis
1. Range: The correlation coefficient always lies between $-1$ and $+1$, i.e., $-1 \le r \le +1$. 2. Independent of change of origin and scale: Correlation is unaffected by adding/subtracting a constant or multiplying/dividing by a positive constant. 3. Pur...
Full solved answer →Karl Pearson's Coefficient of Correlation
From the following data on marks of 10 students in the two subjects, calculate the Karl Pearson's coefficient of correlation $r$ and interpret the result.
$$\begin{array}{|c|cccccccccc|}\hline \text{Maths} & 55 & 70 & 40 & 30 & 90 & 80 & 60 & 80 & 90 & 80 \ \hline \text{Basic Statistics} & 65 & 40 & 30 & 50 & 60 & 70 & 50 & 50 & 60 & 70 \ \hline \end{array}$$
[5]
Marks of 10 students: Student Maths (x) Basic Statistics (y) --------- 1 55 65 2 70 40 3 40 30 4 30 50 5 90 60 6 80 70 7 60 50 8 80 50 9 90 60 10 80 70 $n = 10$ $$r = \frac{n\sum xy - \sum x \sum y}{\sqrt{[n\sum x^2 - (\sum x)^2][n\sum y^2 - (\sum y)^2]}}$$...
Full solved answer →Simple linear regression model
Regression Analysis: Blood Pressure and Age
Regression is a statistical technique used to model and analyze the relationship between a dependent variable and one or more independent variables. It enables estimation or prediction of the dependent variable's value from known values of the independent v...
Full solved answer →Pumpkin Weight Prediction Analysis
In Nepal, during the fall harvest season pumpkins are sold in large quantities at farm stands. Often instead of weighing the pumpkin prior to sale, the farm stand operators will just place the pumpkin in the appropriate circular cutout on the counter. When asked why this was done, one farmer replied, "I can tell the weight of the pumpkin from its circumference". To determine whether this was really true, a sample of 8 pumpkins' circumference and weights were measured:
| Circumference (cm) | 50 | 55 | 54 | 52 | 37 | 52 | 53 | 47 |
|---|---|---|---|---|---|---|---|---|
| Weight (gram × 100) | 12 | 20 | 15 | 17 | 50 | 10 | 15 | 14 |
i) Develop the estimating linear regression equation of weight of the pumpkin to the circumference.
ii) Estimate the weight of pumpkin if the circumference value is 40 cm. Can it be possible to predict the weight of a pumpkin if its circumference is 80 cm?
[10]
Circumference X (cm) Weight Y (×100 g) ------ 50 12 55 20 54 15 52 17 37 50 52 10 53 15 47 14 - n = 8 - Required: (i) regression of weight on circumference, (ii) estimate weight at X = 40, and comment on X = 80. Computation table: X Y XY X² ------------ 50 ...
Full solved answer →Regression Analysis: Experience and Performance
The following data gives the experience of Computer Operators in years and their performance as given by the number of good parts turned out per 100 pieces.
| Experience (X) | 16 | 12 | 18 | 4 | 3 | 10 | 5 | 12 |
|---|---|---|---|---|---|---|---|---|
| Performance (Y) | 87 | 88 | 89 | 68 | 78 | 80 | 75 | 83 |
i) Fit the regression equation of performance rating on experience.
ii) Estimate the probable performance of an operator with 8 years of experience and interpret the regression coefficient.
[10]
X (Experience, yrs) 16 12 18 4 3 10 5 12 --------------------------- Y (Performance) 87 88 89 68 78 80 75 83 n = 8, estimate required at X = 8. X Y XY X² -------------- 16 87 1392 256 12 88 1056 144 18 89 1602 324 4 68 272 16 3 78 234 9 10 80 800 100 5 75 3...
Full solved answer →Question
A big computer supplier in Kathmandu used to sell large number of computers in each year. His interest is to increase his sales volume in each year for which the supplier has started to take the help of advertisement and allocated some advertisement expenditure in his annual budget each year. The supplier wants to quantify the effect of advertise expenditure on sales of computers. The advertisement expenditure (in lakhs rupees) and their corresponding sales from the computers (in crores rupees) is tabulated as follows. (Assuming that the relationship between the advertisement expenditure and sales is linear.)
| Advertisement expenditure | 40 | 50 | 38 | 60 | 65 | 50 | 35 |
|---|---|---|---|---|---|---|---|
| Sales | 38 | 60 | 55 | 70 | 60 | 48 | 30 |
a.) Perform appropriate statistical analysis and quantify the effect of advertisement on sales obtained from the computer selling. Also interpret the results.
b.) Estimate the sales corresponding to advertising expenditure of Rs. 45 lakhs.
[5+5+0]
Advertisement Expenditure (X) Sales (Y) ------------- 40 38 50 60 38 55 60 70 65 60 50 48 35 30 $n = 7$ X Y XY X² Y² ------------------- 40 38 1520 1600 1444 50 60 3000 2500 3600 38 55 2090 1444 3025 60 70 4200 3600 4900 65 60 3900 4225 3600 50 48 2400 2500...
Full solved answer →Spearman rank correlation coefficient
Following data represent the preference of 10 students studying BIT towards two brands of computers namely DELL and HP. Apply Pearson's rank correlation coefficient and compute correlation coefficient. Also interpret your result.
| Computer | Student preference | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| DELL | 5 | 2 | 9 | 8 | 1 | 10 | 3 | 4 | 6 | 7 |
| HP | 10 | 5 | 1 | 3 | 8 | 6 | 2 | 7 | 9 | 4 |
[5]
Student 1 2 3 4 5 6 7 8 9 10 ----------------------------------------- DELL (X) 5 2 9 8 1 10 3 4 6 7 HP (Y) 10 5 1 3 8 6 2 7 9 4 Number of students $n = 10$. Both rows are already ranks (1 to 10, no ties). Step 1: Compute rank differences $d = X - Y$ and $d...
Full solved answer →Correlation coefficient definition and properties
Define correlation coefficient? Calculate the coefficient of correlation for the following ages (in years) of husbands and wives and interpret it.
| Husband's age X: | 23 | 27 | 28 | 28 | 29 | 30 | 31 | 33 | 35 | 36 |
|---|---|---|---|---|---|---|---|---|---|---|
| Wife's age Y: | 18 | 20 | 27 | 21 | 29 | 27 | 27 | 29 | 28 | 29 |
[5]
The correlation coefficient is a statistical measure that expresses the degree and direction of the linear relationship between two variables. It ranges from $-1$ to $+1$: - $+1$ = perfect positive correlation - $-1$ = perfect negative correlation - $0$ = n...
Full solved answer →The following are the two regression lines: 3X+2Y=26 & 6X+3Y=31. Compute the correlation coefficient between them and interpret the result. [5]
- Regression line A: $3X + 2Y = 26$ - Regression line B: $6X + 3Y = 31$ We must first decide which line is "Y on X" and which is "X on Y." The correct assignment is the one that gives a valid correlation coefficient, i.e. $r \le 1$, equivalently $b{yx} \cdo...
Full solved answer →Assumptions of linear regression
Simple Linear Regression Analysis
1. Linearity: The mean of the response $Y$ is a linear function of $X$. 2. Independence: The error terms (observations) are independent. 3. Homoscedasticity: Constant variance of errors across all values of $X$. 4. Normality: The error terms are normally di...
Full solved answer →Make Unit 8 stick
Practice STA154 with flashcards & quizzes