ANOVA ANOVA Table and Prediction intervals (note: the actual calculations/formulas are shown below, but on homework and exams ou need onl read !xcel "rintouts to answer most #uestions about re$ression% &te" ': ecide which variable is x and which is
y
←
the variable that depends on the other variable; or, the variable that you are trying to predict
x
←
the variable variable whose values affect the the other variable; or, the variable whose values values help predict the the other variable.
Example:
Does # un units sold depend on on price?
↑
↑
y
x
Or, the problem might be stated as: se this data to predict the the # units sold at a given price
↑
↑
y
x
&te" ): Obtain data: i ! " : n
x x! x" x : xn
y! y" y : yn
i ! " * (
x !$ "$ $ *$ ($
%% $ %& $ %' $ %( $ %" $
Example:
← ( values )or each variable so, n + (
&te" *: Obtain the five sums x x! x" x : xn
y! y" y : yn
∑ x
i
∑ y
x) x!" x"" x" : xn"
x x!y! x"y" xy : xnyn i
∑ x y i
) y!" y"" y" : yn"
∑ xi"
i
∑ y
" i
Example: x !$ "$ $ *$ ($
%%$ %&$ %'$ %($ %"$
x %,%$$ !%,-$$ "%,!$$ &,$$$ *-,$$$
x) !$$ *$$ %$$ !,-$$ ",($$
) %&$,!$$ %-$,*$$ %*$,%$$ %$",($$ &*-,*$$
!($
*,&!$
!*",-$$
(,($$
*,-$,$$
&te" +: ind the estimated coefficients (note: the actual calculations are shown, but ou onl need to read !xcel "rintouts for homework and the next exam%
ormulas:
∑ x y i
b'
i
−
-
∑ x b.
-
"
i
n −
( ∑ x )( ∑ y ) i
!
i
( ∑ x )
"
i
n
y − b! x
!*",-$$ −
Example:
!
b! +
! (
(,($$ −
b$ - y − b! x -
0!($/0*,&!$/ ! (
*,&!$ (
0!($/
"
− 0−!.'/
!($/
− !,'$$ !,$$$
- '01
- ',.'*
(
&te" 2: ind &ums of uares and s ) 0note: the actual calculations are shown, but ou onl need to read !xcel "rintouts for homework and the next exam / !xam"le: !
(∑ y )
"
!
0*,&!$/" + ,$&$
114
+ 03!.'/03!'$$/
+ ",&%$
- &&T &&3
11E
+ ,$&$ 5 ",&%$
+
sε"
-
sε
+
&&!
s
−
- b' (numerator of b '%
&&3
)
" I
+ *,-$,$$ 3
-
s
∑ y
112
&&T
-
SSE n−" s
" ε
n
i
!%$ (−" -#.####
(
!%$
- -. - '.%(&""*
&te" 4: 5reate ANOVA table (note: the actual calculations are shown, but ou onl need to read !xcel "rintouts for homework and the next exam% &ource 4egression Error 2otal
d0f0 ! n3" n3!
&& 114 11E 112
6& 614 + 1147d.) 61E + 11E70n3"/
614761E
d0f0 ! *
&& "&%$ !%$ $&$
6& "&%$7!+ "&%$ *(.-!!%$7 + -.
Example: &ource 4egression Error 2otal
n+(, so n3" +
and n3! + *
&te" 1: 5onduct and t tests0 0 Note: these tests give exactly the same conclusions for Simple Linear Regression; but they differ for Multiple Linear Regression; the test is explained in !hapter "# $ page %#&/ (note: the actual calculations are shown, but ou onl need to read !xcel "rintouts for homework and the next exam%
8$: β! + $ 8!: β! ≠ $ 3statistic +
Example: 1uppose α + .$( MSR
3statistic +
MSE
9ritical 0table/ value + α 0! ,n3"/ t3statistic +
b! s b!
MSR MSE
+
"&%$ -#.####
+ *(.-!-
9ritical + .$( 0! ,/ + !$.!
0d.). + n 3"/
t3statistic +
b! s b!
+
− !.'
."(!--!
+ 3
-.'((!! s
where sb! +
∑ xi − "
ε
!
n
(∑ x ) i
"
sb! +
'.%(&""* !$$$
+ ."(!--!
± tα7" + ± t.$"( 0d.). + n3" + / + ± .!&" denominator in )ormula )or b! 9onclusion: 4eect 8$; there is a
signi)icant relationship between y and x<
&te" 7: 5alculate r ) (note: the actual calculations are shown, but ou onl need to read !xcel "rintouts for homework and the next exam%
r "
+
SSR SS'
=nterpretation: r " is the proportion 0or >/ o) the variation in the y variable that is caused by the changing values o) the x variable.
Example:
r "
+
"&%$
+ .%& 0or, %.&>/
#$&$
the y variable
=nterpretation: %.& > o) the variation in the # o) units sold can be attributed the changing values o) price. the x variable
&te" 8: 9se the re$ression e#uation for "rediction and/or estimation (Prediction and confidence intervals do re#uire a little more than ust readin$ the !xcel "rintout0 ;ou need is the sum of s#uares of the x deviations that a""ears in the denominator of the fraction under the s#uare root si$n use !xcel to calculate this value < then "lu$ it in to the "rediction or confidence interval formula%
or a given< 0i.e., particular/ value o) x 0call it xg/, the estimated y value )or this x value is )ound by simply putting xg into the estimated regression euation: @ y
+
estimated y 0when x + xg/
+ b$ A b!xg
5onfidence =nterval )or the average o) all y values whenever x + xg:
@ y
±
t
α
7 " s ε
! n
+
0 x g − x / "
∑ x
" i
− !n ( ∑ x i )
"
d.). + n3" Bote:
∑ x
"
i
! ( ∑ xi ) is the denominator o) the calculation )or b! − N "
Example: to estimate the average sales, )or all times in the )uture when the price is set at xg + C( using a %(> con)idence interval:
@ y
+ b$ A b!xg + !$! 5 !.'0(/ + %(.(
%(> con)idence → α + .$( =nterval + %(.(
±
→ tα7" + t.$"( 0n3" + d.)./ + .!&"
0#.!&"/0'.%(&"/
tα7"
sε
! (
+
0#( − #$/
"
!$$$
+ %(.(
± !".$!!'(
denominator o) b!
Prediction =nterval )or a single y value when x + xg:
@ y
±
t
α
7 " s ε
d.). + n3"
!+
! n
+
0 x g − x / "
∑ x
" i
− !n ( ∑ xi )
"
the extra !< under the suare root sign is the only di))erence )rom the con)idence interval )ormula
Example: to estimate the sales )or a particular wee in which the price is set at xg + C( using a %(> prediction interval:
@ y
+ b$ A b!xg + !$! 5 !.'0(/ + %(.( 0same as )or con). interval/
%(> con)idence → α + .$(
=nterval + %(.(
±
→ tα7" + t.$"( 0n3" + d.)./ + .!&"
0#.!&"/0'.%(&"/ ! +
tα7"
sε
! (
+
0#( − #$/ !$$$
denominator o) b!
"
+ %(.(
± "&.$"'*"