0% found this document useful (0 votes)
76 views26 pages

Week 10 Correlation and Regression Analysis Lec

This document discusses correlation and regression analysis techniques. It covers Pearson product-moment correlation, which measures the linear relationship between two variables. It also covers Spearman rank correlation, which is the nonparametric equivalent and calculates correlation based on the rank of values rather than the actual values. Examples are provided to demonstrate how to interpret correlation coefficients and determine if correlations are statistically significant.

Uploaded by

kimberly duero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views26 pages

Week 10 Correlation and Regression Analysis Lec

This document discusses correlation and regression analysis techniques. It covers Pearson product-moment correlation, which measures the linear relationship between two variables. It also covers Spearman rank correlation, which is the nonparametric equivalent and calculates correlation based on the rank of values rather than the actual values. Examples are provided to demonstrate how to interpret correlation coefficients and determine if correlations are statistically significant.

Uploaded by

kimberly duero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Correlation and

Regression Analysis
Pearson Product-Moment Correlation
Spearman Rank Correlation
Week 10
Linear Regression Analysis
Engr. Nora G. Yulo, MATM 111 Teacher
Correlation
Correlation is finding the relationship between two
quantitative variables without being able to infer causal
relationships. It is a statistical technique used to
determine the degree to which two variables are related.

Week 10
Scatter Diagram
 Rectangular coordinate
 Two quantitative variables
 One variable is called independent (X)
and the second is called dependent (Y)
 Points are not joined Y
* *
 No frequency table *

Week 10 X
Example:

Week 10
Correlation
Definition Situation
Positive correlation Both variables increases
Negative correlation One variable increases
while the other variable
decreases
No correlation One variable neither
increases or decreases
while the other variable
Week 10 increases
Relationships of Variables

Slanting upwards to Slanting upwards to


the right the left
- Direct Relationship - - Inverse Relationship -
Week 10
Pearson Product-Moment Correlation
In Statistics, correlation is the interdependence between two variable quantities.
Pearson product-moment correlation is the most widely used in statistics to measure the
degree of the relationship between the linear related variables. The Pearson r correlation
would require both variables to be normally distributed. Correlation refers to the
departure of two variables from independence. For example, in the stock market, if we
want to measure how two products are related to each other, Pearson r correlation is used
to measure the degree of relationship between the two products.

The Pearson r correlation coefficient is defined by using the formula:

𝑵 ∑ 𝑿𝒀 − ( ∑ 𝑿 )( ∑ 𝒀 )
𝒓=
Week 10 √[ 𝑵 ( ∑ 𝑿 ) − ( ∑ 𝑿 ) ] [ 𝑵 ( ∑ 𝒀 ) − ( ∑ 𝒀 ) ]
𝟐 𝟐 𝟐 𝟐
Spearman Rank Correlation
Spearman rank correlation (or Spearman’s rho) is a nonparametric test that is used to
measure the degree of association between the two two variables. It is often denoted by (rho) or
as . Spearman rank correlation is the counterpart of Pearson Product-Moment Correlation in
parametric statistics. It is calculated by converting each variable to ranks and calculating the
Pearson Product-Moment Correlation between the two sets of ranks. For small sample sizes,
the observed correlation coeffcieint is compared to what would result if the ranks of the X-
values and Y-values were random permutations of the integeres 1 to n (sample size). The
following formula is used to calculate the Spearman rank correlation:

𝟔∑ 𝑫 𝟐
𝝆 𝒐𝒓 𝒓 𝒔 =𝟏−
Week 10 𝑵 ( 𝑵 − 𝟏)𝟐
Week

Pearson Product-Moment Correlation 10


The following summarizes the correlation coefficient and strength of
relationships:
If the value of r is . . . then it means . . .

0.00 no correlation, no relationship

slight correlation, negligible relationship When r is:


Low positive/negative correlation
+, direct
moderate positive/negative correlation
-, inverse
high positive/negative correlation

very high positive/negative correlation correlation


perfect correlation, perfect relationship
Week

Pearson Product-Moment Correlation 10


The following summarizes the correlation coefficient and strength of
relationships:
If the value of r is then it means . . .
... From the given example, Identify if there is a
0.00 no correlation, no relationship positive correlation or a negative correlation
slight correlation, negligible  As sleep increases, memory increases.
relationship  As salary decreases, spending also decreases.
Low positive/negative correlation  As hourly pay increases, employee morale
increases.
moderate positive/negative correlation  The higher the number of absences, the lower the
high positive/negative correlation grades
 As hours of sleep decrease, levels of stress increase
very high positive/negative correlation  r= 0.15
perfect correlation, perfect  r= -.36
relationship
Pearson Product-Moment Correlation
Week

How do we use Pearson product-moment correlation? Let us


10
discuss the steps through an example.
Example: Consider the following data on the amount of fats and calories in five type of
Hamburger.
FAT GRAMS AND CALORIES BY TYPE OF HAMBURGER

Type of hamburger Grams of fat (x) Calories (y)


Hamburger 10 270
Cheeseburger 14 320
Quarter Pounder 21 430
Quarter Pounder with 30 530
Cheese
Big Mac 28 530

Does it appear there is a relationship between grams of fat and calories (Show a scatter diagram)? Compute the
coefficient of correlation. Determine at the 0.05 siginificance level whether the correlation in the population is greater
than zero.
Pearson Product-Moment Correlation
Week

Type of Grams of Calories (y)


10
hamburger fat (x)
Hamburger 10 270
Cheeseburger 14 320
Quarter 21 430
Pounder
Quarter 30 530
Pounder with
Cheese
Big Mac 28 530

Does it appear there is a relationship between grams of fat and calories ? Compute the coefficient of correlation.
Determine at the 0.05 siginificance level whether the correlation in the population is greater than zero.
Pearson Product-Moment Correlation
Week

Type of Grams of Calories (y)


10
hamburger fat (x)
Hamburger 10 270
Cheeseburger 14 320
Quarter 21 430
Pounder
Quarter 30 530
Pounder with
Cheese
Big Mac 28 530

Does it appear there is a relationship between grams of fat and calories ? Compute the coefficient of correlation.
Determine at the 0.05 siginificance level whether the correlation in the population is greater than zero.
Week

Pearson Product-Moment Correlation 10

Here are the steps in performing Pearson Product-Moment Correlation:


Step 1: State the hypothesis.
(There is no correlation between and
.)
(There is a correlation between and
.)

Step 2: Calculate the degrees of freedom (d.f. = N – 2) and determine the critical value of t.
(Use the t-table.)
d.f. = = and .
Week

Pearson Product-Moment Correlation 10


Step 3: Calculate the t value using the formula where t is the t test for correlation coefficient, r is the
correlation coefficient and N is the number of paired samples. Then, determine the statistical decision for
hypothesis testing.
(NOTE: If do not reject . If reject . )

Solution:
Since the computed t-value of ______________ is greater than the tabular value __________ at level of significance of 0.05,
we would need to reject the null hypothesis.

Step 4: State the conclusion.

Since the null hypothesis is _______________________, we can conclude that there is evidence that shows significant
association between ______________________________________________________________
Week

Pearson Product-Moment Correlation 10


How do we use Pearson product-moment correlation? Let us
discuss the steps through an example.
Example: The owner of a chain of fruit shake stores would like to study the
correlation between atmospheric temperature and sales during the summer season.
A random sample of 12 days is selected with the results given as follows:
Day 1 2 3 4 5 6 7 8 9 10 11 12
Temperature 79 76 78 84 90 83 93 94 97 85 88 82

Total Sales (Units) 147 143 147 168 206 155 192 211 209 187 200 150

Does it appear there is a relationship between atmospheric temperature and sales?


Compute the coefficient of correlation. Determine at the 0.05 siginificance level whether the
correlation in the population is greater than zero.
Week

Pearson Product-Moment Correlation 10

Here are the steps in performing Pearson Product-Moment Correlation:


Step 1: State the hypothesis.
(There is no correlation between atmospheric temperature and
total sales of fruit shake.)
(There is a correlation between atmospheric temperature and
total sales of fruit shake.)

Step 2: Calculate the degrees of freedom (d.f. = N – 2) and determine the critical value of t.
(Use the CRITICAL VALUE FOR CORRELATION CORFFICIENT)
d.f. = 12 – 2 = 10 and 0.576.
Week
Pearson Product-Moment Correlation 10
Step 3: Determine the Day X Y XY
1 79 147 6 241 21 609 11 613
value of r (Pearson-
2 76 143 5 776 20 449 10 868
moment correlation 3 78 147 6 084 21 609 11 466
coefficient). 4 84 168 7 056 28 224 14 112
5 90 206 8 100 42 436 18 540
6 83 155 6 889 24 025 12 865
7 93 192 8 649 36 864 17 856
8 94 211 8 836 44 521 19 834
9 97 209 9 409 43 681 20 273
10 85 187 7 225 34 969 15 895
11 88 200 7 744 40 000 17 600
12 82 150 6 724 22 500 12 300
Total 1 029 2 115 88 733 380 887 183 222
Week

Pearson Product-Moment Correlation 10

Step 3: Compute for the value of r (Pearson-moment correlation coefficient).

The coefficient of correlation, r = 0.93, between the atmospheric temperature and total
0.93 sales indicates a very high, direct correlation (very dependable relationship) – that is
an increased in atmospheric temperature is highly associated with the increased in
total sales of fruit shake.
Week

Pearson Product-Moment Correlation 10

Step 3: Calculate the t value using the formula where t is the t test for correlation coefficient, r is the correlation
coefficient and N is the number of paired samples. Then, determine the statistical decision for hypothesis testing.
(NOTE: If do not reject . If reject . )

Solution:
Since the computed t-value of 8.00 is greater than the tabular value of 0.576 at level of significance of 0.05, we
would need to reject the null hypothesis.

Step 4: State the conclusion.

Since the null hypothesis is rejected, we can conclude that there is evidence that shows significant association
between the atmospheric temperature and the total sales of fruit shake.
Regression Analysis
Regression: technique concerned with predicting some variables by
knowing others
The process of predicting variable Y using variable X

Regression
- Uses a variable (x) to predict some outcome variable (y)
- Tells you how values in y change as a function of changes in values of x
- Linear means “straight line”
- Regression tells us how to draw the straight line described by the
correlation
Week 10
Regression
- It calculates the “best-fit” line for a certain set of data.
- The regression line makes the sum of the squares of the residuals smaller
than for any other line.
- Regression minimizes residuals.

Week 10
Regression
In deriving the linear regression equation, compute for the b and a. To
obtain the values of the slope (b) and the intercept (a) of the linear regression
equation, we have:

b= a=
(Slope) (Intercept)

Week 10
Linear Regression Equation (LRE)

ŷ  a  bX

Week 10
- End of discussion -
Is there anything that you would like to be
clarified? Would you like to add some insights in this
discussion? If there’s none, prepare yourselves for an
offline task.

Week 10

You might also like