Lecture 11
Lecture 11
Where,
e2
e1
EXAMPLE:
We have two quantitative variables the age and price of the onion. The age is
measured in years and is the predictor (x) while the price in hundreds dollars is the
response or dependent variable (y) for the problem. The observed data values are
given in the below table:
Scatter plot, [get a (rough) idea of direction, strength, linearity and also potential
presence of outliers in the (x ,y) relationship.]
As the dots are trending downward with small deviation of trend therefore we can
identify a strong negative relationship between the two under study variables i.e.
age of onion in years and the price of onion in hundred dollars.
Weissp-649, Example 14.6 (Ex Weiss14.59, 14.60 p-658, make scatter plot only
and comment on direction, strength, linearity)
Least Square Criterion p-648: The best fitting line corresponds to the intercept (
β 0 ¿and slope (β ¿¿ 1)¿such that the sum of squared residuals is minimum possible.
[Note in many cases intercept has no meaningful interpretation since x = 0 is not in
the data set for which regression is estimated].
Regression calculations:
Where,
S xy ∑ (x −x)( y − y)
β 1= = (Standard Formula)
S xx ∑ (x−x )2
Also,
n ∑ xy−∑ x ∑ y
β 1= (Shortcut Formula)
n ∑ x −¿ ¿ ¿
2
Also,
β 0= y −β1 x
Now,
1) Calculation of β by standard formula.
1
x=5.273
y=88 .64
Car Age (x) Price (y) (x-x ̅) (y-y ̅) (x-x ̅)(y-y ̅) (x-x ̅)2
1 5 85 -0.273 -3.636 0.992 0.074
2 4 103 -1.273 14.364 -18.281 1.620
3 6 70 0.727 -18.636 -13.554 0.529
4 5 82 -0.273 -6.636 1.810 0.074
5 5 89 -0.273 0.364 -0.099 0.074
6 5 98 -0.273 9.364 -2.554 0.074
7 6 66 0.727 -22.636 -16.463 0.529
8 6 95 0.727 6.364 4.628 0.529
9 2 169 -3.273 80.364 -263.008 10.711
10 7 70 1.727 -18.636 -32.190 2.983
11 7 48 1.727 -40.636 -70.190 2.983
Sums 58 975 0 0 -408.909 20.182
S xy ∑ (x −x)( y − y) −408.909
β 1= = = =−20.26
S xx ∑ (x−x )2 20.182
2) Calculation of β 1by short cut formula.
n ∑ xy−∑ x ∑ y
β 1=
n ∑ x −¿ ¿ ¿
2
You can observe that the value of β 1 computed from both method is same
therefore, you can use either method for the estimation of β 1
Check that n = 9,
∑ x =20682, ∑ y =3487.1, ∑ xy =9254378 , ∑ x2 =57414186 , ∑ y 2=1590653,
x=2298 , y=387.4556
S xx =∑ x −¿ ¿ ¿
2
( ∑ x )( ∑ y ) ( 20682 ) (3487.1 )
S xy =∑ xy − =9254378− =1241022.2
n 9
b 1=0.1255 , b0=99.007
b) Graph the regression equation and the data points. (We can use any two x values and find
corresponding ^y values from the estimated equation and use these points to plot the line).
c) Describe the apparent relationship between the two variables under consideration.
There appears to be (i) positive (ii) linear (iii) moderate relationship