stat-11, regression.pdf
DESCRIPTION
statistics 1. Regression chapter 11TRANSCRIPT
-
3/18/12
1
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Regression Analysis
Md. Tarikul Islam Jahangirnagar University, Bangladesh
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Recap-1/2
q So far we have seen
Recapping o Research, types of research, and research methodology
In core of all there is DATA
Basics of statistics o Data, types of data o Place of data in statistics with the definition and
characteristics of statistics
Data collection and sampling o What data to collect? From where? How? o Sampling methods
-
3/18/12
2
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Recap-2/2
q So far we have seen
Data presentation o Classification, tabulation, and graphs
Central Tendency o Mean, median, mode, harmonic mean, and geometric mean
Measures of variation o Range, average deviation, and standard deviation
Correlation o Scatter diagram, Pearsons r, and rank correlation
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
The Course: Topics No Topics
01 Basics of statistics and recap!
02 Collection of data
03 Presentation of data
04 Measures of central tendency
05 Measures of variation
06 Skewness, moments, and kurtosis
07 Correlation analysis
08 Regression analysis
09 Forecasting and time series analysis
10 Probability
11 Sampling
Content
s are su
bject to
change
-
3/18/12
3
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Find out a and b
15 = 5a + 25b . (I) 88 = 25a + 151b ..(ii)
a = ? b = ?
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Regression
q Regression
o Regression is the technique of predicting the behavior of one variable based on the another one (s); condition to that both variables are correlated
Estimating? Predicting the probable/most probable values for
one variable depending on another Value of one variable is known while that of another
one is unknown One variable is independent and based on that we
calculate the value of the dependent variable
-
3/18/12
4
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Correlation vs Regression
q Correlation vs Regression
o Correlation calculates the degree of relationship while regression calculates the nature of relationship
o Regression better shows the cause and effect relationship than correlation
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Variables
q Variables
o Again two variables but in real life can be more than two; two variables is called simple regression
o Variables Dependent and independent
X on Y and Y on X as examples
o If both variables are independent?
o Now as we have two variable we would have two regression lines too!
-
3/18/12
5
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Regression: Formulae
q Y on X o Y = a + bX
Normal Equations o Y = Na + bX o XY = a X + b X2
q X on Y o X = a + bY
Normal Equations o X = Na + bY o XY = a Y + b Y2
a and b are called parameters and they actually set the position of the line completely!
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
a and b in graph
q a and b in graph
-
3/18/12
6
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Regression: Formulae Explanation
q Formulae Explanation
o a and b can be calculated with the method of least squares With the given two equations in the previous slide Called normal equations
o What is least square method? A method assuming that the best-fit curve of a given
type is the curve that has the minimal sum of the deviations squared (least square error) from a given set of data
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
What are the relevant items?
q Relevant items
o X o Y o XY o X2 o Y2
-
3/18/12
7
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Problem solving: 1/3
q Given data
X Y
1 2
2 5
3 3
4 8
5 7
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Problem solving: 2/3
q We need to fill the shaded areas
X Y X2 Y2 XY
1 2
2 5
3 3
4 8
5 7
-
3/18/12
8
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Problem solving: 3/3
q Lets fill in
X Y X2 Y2 XY
1 2 1 4 2
2 5 4 25 10
3 3 9 9 9
4 8 16 64 32
5 7 25 49 35
X = 15 Y = 25 X2 = 55 Y2 = 151 XY = 88
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Regression solution
q With the formula for X on Y
o X on Y X = a + bY
o Normal Equations X = Na + bY XY = a Y + b Y2
15 = 5a + 25b . (I) 88 = 25a + 151b ..(ii) From (I) and (ii): a = 0.5, b = 0.5
So the regression is
X = 0.5 + 0.5 Y
-
3/18/12
9
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Use of the regression line
q Use of the regression line
o If the regression line is Y = 10 + 15X
o Then Explain the regression line Calculate the value of Y if X changes by 30 units
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Deviation from means
q Deviation from means
o Rather than working with X and Y directly we can work with the deviations from the means of X and Y
o Formula gets a bit change too How?
-
3/18/12
10
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Regression: Formulae-New
q Y on X o Y = a + bX changed to
Normal Equations o y = Na + bx o xy = a x + b x2
q X on Y o X = a + bY
Normal Equations o x = Na + by o xy = a y + b y2
Y !Y!
!=!byx(X!X)
!
!and!!!!byx
!=!xy"x2"
!!!!!where,!x!=!X!X,!
!!y =!Y !Y!
X!X!
!=!bxy(Y !Y)
!
!and!!!!bxy
!=!xy"y2"
!!!!!where,!x!=!X!X,!
!!y =!Y !Y!
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
steps in calculation
q steps in calculation
First mean of two series (X and Y),
Then o
o x2 and y2
o xy
X!
!!!and!!Y!
!!
x!=!X!X!
!!!and!y!=!Y !!Y!
!!
-
3/18/12
11
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Practice: given data
X Y 40 2.5
70 6
50 4
60 5
80 4
50 2.5
90 5.5
40 3
60 4.5
60 3
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Practice: filling in..
X Y x x2 y y2 xy
40 2.5
70 6
50 4
60 5
80 4
50 2.5
90 5.5
40 3
60 4.5
60 3
600 40
X!
Y!
= 600 10 = 60 = 40 10 = 4
-
3/18/12
12
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Practice: filling in..
X Y x x2 y y2 xy
40 2.5 -20 400 -1.5 2.25 30
70 6 +10 100 +2 4 20
50 4 -10 100 0 0 0
60 5 0 0 +1 1 0
80 4 +20 400 0 0 0
50 2.5 -10 100 -1.5 2.25 15
90 5.5 +30 900 +1.5 2.25 45
40 3 -20 400 -1 1 20
60 4.5 0 0 +0.5 .25 0
60 3 0 0 -1 1 0
600 40 0 2400 0 14 130
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Practice: calculations
q Practice: calculations
byx
!=!xy!x2!
!=!1302400
!=!0.054
Y !Y!
= !byx(X!X
!
)!=!Y !4!=!0.054!(X!60)!=!Y!=!0.76+0.054X
-
3/18/12
13
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
Practice @ home
q Do the math
o There are lots of math to do in this chapter o Go through them at home o Get any problem? Speak up in the class beforehand!
Jahangirnagar University Islam, M.T. http://sites.google.com/site/kjatbd/
qThank You!
qAny Question?!