0% found this document useful (0 votes)
6 views31 pages

Regression and Correlation Analysis Guide

The document discusses regression and correlation, explaining how regression measures the dependency between variables and provides equations for prediction. It covers simple and multiple regression, scatter diagrams, and the calculation of regression equations with examples. Additionally, it introduces correlation as a method to determine the relationship between two quantitative variables, detailing how to compute the correlation coefficient and its interpretation.

Uploaded by

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

Regression and Correlation Analysis Guide

The document discusses regression and correlation, explaining how regression measures the dependency between variables and provides equations for prediction. It covers simple and multiple regression, scatter diagrams, and the calculation of regression equations with examples. Additionally, it introduces correlation as a method to determine the relationship between two quantitative variables, detailing how to compute the correlation coefficient and its interpretation.

Uploaded by

uulhaq613
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

REGRESSION AND

CORRELATION
MR ATTA UR REHMAN
DEPARTMENT OF STATISTICS (UOP)

Attaur rehman 5/29/2024 1


Regression
• Measure of dependency between two variables’
• It investigates the dependence of one variable, conventionally called dependent
variable , on one or more other variables called independent variables, and provides
an equation to be used for estimating or predicting the average value of the
dependent variable from the known values of the independent variable.
• The dependent variable assumed to be a random variable whereas the independent
variables are assumed to have fixed values, i.e the are chosen non randomly.
• When we study the dependence of a variable on a single independent variable, it is
called simple or two variable regression.
Attaur rehman 5/29/2024 2
• when the dependence of a variable on two or more than two independent
variables is studies, it is called multiple regression.
• Furthermore, when the dependence is represented by a straight line equation, the
regression is said to be linear, otherwise it is said to be curvilinear.

Attaur rehman 5/29/2024 3


SCATTER DIAGRAM
• A scatter diagram, also known as a scatter plot, is a graphical representation of data points
in a two-dimensional space. It is commonly used in statistics to visualize the relationship
between two variables.

0 Attaur rehman
x 5/29/2024 4
Simple linear regression model
• The linear relationship between the dependent variable Yi and the value of the regressor X
is
Yi = a +ßXi+€I (for population).
Yi= a + bx + ei (sample data).
Where Xi’s are fixed or predetermined values,
the Yi ’s are observations randomly drawn from a population,
€ are the error components, a and ß are the population parameters, a is the intercept and the
slop ß is called regression coefficient, which may be positive or negative depending upon the
direction of the relationship between X and Y.
Attaur rehman 5/29/2024 5
• Where a, b and e the estimated of alfha, ß and €. The estimated regression is
generally written as ŷ = a+bXi
Where a = Ῡ - bx̄
𝑛∑𝑥𝑦−∑𝑥∑𝑦
b=
𝑛∑𝑥 2 −∑ 𝑥 2

Attaur rehman 5/29/2024 6


A sample of 6 persons was selected the value of their age ( x variable) and their weight
is demonstrated in the following table. Find the regression equation and what is the
predicted weight when age is 8.5 years? what is the predicted weight when age is 7.5
years?
AGE(X) 7 6 8 5 6 9

Weight(y) 12 8 12 10 11 13

Attaur rehman 5/29/2024 7


Question: A microbiologist studied the effect of temperature (cº) on the growth rate
(µ) Temperature (X) 20 25 30 35 40

Growth rate (y) 0.5 0.8 1.2 1.5 1.8

Calculate the linear regression equation and predict the growth rate at 32 cº.
Question: A researcher investigated the relationship between antibiotic concentration
(µg/ml) and bacteria survival (%).

Attaur rehman 5/29/2024 8


• Question: A researcher investigated the relationship between antibiotic concentration
(µg/ml) and bacteria survival (%).

antibiotic 5 10 15 20 25
concentrati
on (µg/ml)
bacteria 80 60 40 20 10
survival (%).

• Calculate the linear regression model and predict the bacteria survival (%) at 18 (µg/ml).

Attaur rehman 5/29/2024 9


• Questions: A researcher collected data on the relationship between hours studied (x) and
exam scores (y). The data is

hours studied 2 4 6 8 9
(x)

exam scores (y) 40 50 60 70 75

• Calculate the regression equation and predict the exam scores at 11 hours studies (x).
Solution: the estimated regression line of y on x is ŷ = a+bXi

Attaur rehman 5/29/2024 10


hours studied (x) exam scores (y) XY X^2

2 40 80 4

4 50 200 16

6 60 360 36

8 70 560 64

9 75 675 81

Total 29 295 1875 201

Attaur rehman 5/29/2024 11


Now
∑𝑥𝑖 29
x̄ = = = 5.8
𝑛 5

∑𝑦𝑖 295
Ῡ= = = 59
𝑛 5
𝑛∑𝑥𝑦−∑𝑥∑𝑦 5(1875)−(29)(295)
b= =b= =5
𝑛∑𝑥 2 −∑ 𝑥 2 5(201)− 29 2

a = Ῡ - bx̄ = 59 – (5)(5.8) = 30
Hence the desired estimated regression line of y on x is ŷ = 30+5Xi.
If studied hours x = 11 then ŷ = 30+5(11) =85 score.
Attaur rehman 5/29/2024 12
Standard deviation of regression
• The observed values of (X,Y) do not all fall on the regression line but they scatter
away from it. The degree of scatter (or dispersion) of the observed values about the
regression line is measured by what is called the standard deviation of regression or
the standard error of estimate of Y on X.
• For population data, the standard deviation that measured the variation of
observation s about the true regression line ŷ = a+bXi, is denoted by σy.x and is
defined by

σy.x =
2
∑[𝑌 − (𝑎+ß𝑥)]
• 𝑁
Where N is the population size.
Attaur rehman 5/29/2024 13
Continues….
• For sample data, we estimate σy.x by sy.x which is defined as
2
∑[𝑌 −ŷ]
sy.x = where ŷ = a + bx, the
𝑛 −2
estimated regression line.

Attaur rehman 5/29/2024 14


• Question: using the following data and compute the standard deviation of
regression:
X 5 6 8 10 12 13 15 16 17

Y 16 19 23 28 36 41 44 45 50

Attaur rehman 5/29/2024 15


• The calculations needed to find the values of ŷ and the standard error sy.x are given
in the table below:

X Y Ŷ=1.47 + 2.831X Y-Ŷ (Y-Ŷ)^2


5 16 15.625 0.375 0.140625
6 19 18.456 0.544 0.295936
8 23 24.118 -1.118 1.249924
10 28 29.780 -1.780 3.1684
12 36 35.442 0.558 0.311
13 41 38.273 2.727 7.43
15 44 43.935 0.065 0.0042
16 45 46.766 -1.766 3.1187
17 50 49.597 0.008 0.1624
TOTAL 102 302 - 0.008 15.44
Attaur rehman 5/29/2024 16
2
∑[𝑌 −ŷ] 15.44
• sy.x = 𝑛 −2
=
9−2
= 1.46

Attaur rehman 5/29/2024 17


Correlation
• Finding the relationship between two quantitative variables without being
able to infer causal relationships
• Correlation is a statistical technique used to determine the degree to which
two variables are related

Attaur rehman 5/29/2024 18


Scatter diagram
• Rectangular coordinate.
• Two quantitative variables.
• One variable is called independent (X) and the second is called dependent (Y).
• Points are not joined.
• No frequency table.

Attaur rehman 5/29/2024 19


Example

Attaur rehman 5/29/2024 20


Scatter diagram of weight and systolic blood pressure

Attaur rehman 5/29/2024 21


Simple correlation coefficient
• It is also called Pearson's correlation or product moment correlation
coefficient.
• It measures the nature and strength between two variables of the quantitative
type.
• The value of r for sample and p for population data and ranges between ( -1)
and ( +1) .

Attaur rehman 5/29/2024 22


Examples
• Some times 2 continuous variables are measured in the same person e.g.
height and weight.
• Or in 2 groups e.g. comparison of tallness in parents with tallness of
children.
• It looks for strength of association.
• If 2 quantities ‘X’ and ’Y’ tend to change with each other they are said to be
correlated.

Attaur rehman 5/29/2024 23


• The sign of r denotes the nature of association
• while the value of r denotes the strength of association.
• The value of r denotes the strength of the association as illustrated by the
following diagram.

Attaur rehman 5/29/2024 24


• If r = Zero this means no association or correlation between the two
variables.
• If 0 < r < 0.25 = weak correlation.
• If 0.25 ≤ r < 0.75 = intermediate correlation.
• If 0.75 ≤ r < 1 = strong correlation.
• If 1 = r = perfect correlation.

Attaur rehman 5/29/2024 25


How to compute the simple correlation
coefficient (r)
Measured by Karl Pearson method .

Attaur rehman 5/29/2024 26


• Question:

Attaur rehman 5/29/2024 27


Solution:

Attaur rehman 5/29/2024 28


• р = + 0.759 strong positive correlation
Attaur rehman 5/29/2024 29
Correlation and Regression

• Correlation describes the strength of a linear relationship between two


variables.
• Linear means “straight line”
• Regression tells us how to draw the straight line described by the correlation.

Attaur rehman 5/29/2024 30


THANK YOU

Attaur rehman 5/29/2024 31

You might also like