Chuong 6 - Hoi Quy Boi (SBE - 11e Ch15)
Chuong 6 - Hoi Quy Boi (SBE - 11e Ch15)
Chuong 6 - Hoi Quy Boi (SBE - 11e Ch15)
Williams
where:
b0, b1, b2, . . . , bp are the parameters, and
e is a random variable called the error term
Estimated Multiple
b0 , b1 , b2 , . . . , bp Regression Equation
provide estimates of yˆ b0 b1x1 b2x2 ... bpxp
b 0, b 1, b 2, . . . , b p Sample statistics are
b0 , b1 , b2 , . . . , bp
Least Squares
Criterion
min (yi yˆi )2
where
y = annual salary ($1000)
x1 = years of experience
x2 = score on programmer aptitude test
Least Squares
Input Data Output
x1 x2 Computer b0 =
y Package b1 =
for Solving
4 78 b2 =
Multiple
24
Regression R2 =
7 100
43 Problems etc.
. .
.
. .
© 2011 .
South-Western/Cengage Learning. All Rights Reserved 11
Solving for the Estimates of 0, 1, 2
SALARY
SALARY =
= 3.174
3.174 +
+ 1.404(EXPER)
1.404(EXPER) +
+ 0.251(SCORE)
0.251(SCORE)
b
b11 =
= 1.404
1.404
b
b22 =
= 0.251
0.251
SST = SSR +
SSE
i
( y y )2
= i
( ˆ
y y )2
+ i i
( y ˆ
y )2
where:
SST = total sum of squares
SSR = sum of squares due to regression
SSE = sum of squares due to error
R2 = SSR/SST
R2 = 500.3285/599.7855 = .83418
n 1
Ra2 2
1 (1 R )
n p 1
2 20 1
R 1 (1 .834179)
a .814671
20 2 1
The error is
The error is aa random
random variable
variable with
with mean
mean of
of zero.
zero.
The
The variance of ,, denoted
variance of by
denoted by 22,, is
is the
the same
same for
for all
all
values
values of
of the
the independent
independent variables.
variables.
The
The values of are
values of are independent.
independent.
The error is
The error is aa normally
normally distributed
distributed random
random variable
variable
reflecting
reflecting the
the deviation
deviation between
between thethe yy value
value and and the the
expected
expected value
value ofof yy given by 00 +
given by + 11xx11 +
+ 22xx22 + + pp
+ .. .. +
In
In simple
simple linear
linear regression,
regression, the
the FF and
and tt tests
tests provide
provide
the
the same
same conclusion.
conclusion.
In
In multiple
multiple regression,
regression, the
the FF and
and tt tests
tests have
have different
different
purposes.
purposes.
The
The FF test
test is
is used
used toto determine
determine whether
whether aa significant
significant
relationship
relationship exists
exists between
between the
the dependent
dependent variable
variable
and
and the
the set
set ofof all
all the
the independent
independent variables.
variables.
The
The FF test
test is
is referred
referred to
to as
as the
the test
test for
for overall
overall
significance.
significance.
If
If the
the FF test
test shows
shows an
an overall
overall significance,
significance, the
the tt test
test is
is
used
used toto determine
determine whether
whether each
each of
of the
the individual
individual
independent
independent variables
variables is
is significant.
significant.
A
A separate
separate tt test
test is
is conducted
conducted for
for each
each of
of the
the
independent
independent variables
variables in
in the
the model.
model.
We
We refer
refer to
to each
each of
of these
these tt tests
tests as
as aa test
test for
for individua
individu
significance.
significance.
Hypotheses H0: 1 = 2 = . . . = p = 0
Ha: One or more of the parameters
is not equal to zero.
Hypotheses H0: 1 = 2 = 0
Ha: One or both of the parameters
is not equal to zero.
Hypotheses H 0 : i 0
H a : i 0
bi
Test Statistics t
sbi
The
The term
term multicollinearity
multicollinearity refers
refers to
to the
the correlation
correlation
among
among the
the independent
independent variables.
variables.
When
When thethe independent
independent variables
variables are
are highly
highly correlated
correlated
(say,
(say, |r
|r || >
> .7),
.7), it
it is
is not
not possible
possible to
to determine
determine the
the
separate
separate effect
effect of
of any
any particular
particular independent
independent variable
variable
on
on the
the dependent
dependent variable.
variable.
If
If the
the estimated
estimated regression
regression equation
equation is
is to
to be
be used
used only
onl
for
for predictive
predictive purposes,
purposes, multicollinearity
multicollinearity is
is usually
usually
not
not aa serious
serious problem.
problem.
Every
Every attempt
attempt should
should be
be made
made toto avoid
avoid including
including
independent
independent variables
variables that
that are
are highly
highly correlated.
correlated.
The
The procedures
procedures for
for estimating
estimating the
the mean
mean value
value of
of yy
and
and predicting
predicting an
an individual
individual value
value of
of yy in
in multiple
multiple
regression
regression are
are similar
similar to
to those
those in
in simple
simple regression.
regression.
We
We substitute
substitute the
the given
given values
values of
of xx11,, xx22,, .. .. .. ,, xxpp into
into
the
the estimated
estimated regression
regression equation
equation andand use use the the
corresponding
corresponding value
value of
of yy as
as the
the point
point estimate.
estimate.
The
The formulas
formulas required
required to
to develop
develop interval
interval estimates
estimates
^
for
for the
the mean value ^
mean value of
of yy and
and for
for an
an individual
individual value
value
of
of yy are
are beyond
beyond the
the scope
scope of
of the
the textbook.
textbook.
Software
Software packages
packages for
for multiple
multiple regression
regression will
will often
often
provide
provide these
these interval
interval estimates.
estimates.
In
In many
many situations
situations we
we must
must work
work with
with qualitative
qualitative
independent
independent variables
variables such
such as
as gender
gender (male,
(male, female)
female)
method
method of
of payment
payment (cash,
(cash, check,
check, credit
credit card),
card), etc.
etc.
For
For example,
example, xx22 might
might represent
represent gender
gender where
where xx22 =
=00
indicates
indicates male
male and
and xx22 =
=11 indicates
indicates female.
female.
In
In this
this case,
case, xx22 is
is called
called aa dummy
dummy or
or indicator
indicator variable
variable
where:
y =^annual salary ($1000)
x1 = years of experience
x2 = score on programmer aptitude test
x3 = 0 if individual does not have a graduate degree
1 if individual does have a graduate degree
x3 is a dummy variable
Not significant
IfIf aa qualitative
qualitative variable
variable has
has kk levels,
levels, kk -- 11 dummy
dummy
variables
variables are are required,
required, with
with each
each dummy
dummy variable
variable
being
being coded
coded asas 00 or
or 1.
1.
For
For example,
example, aa variable
variable with
with levels
levels A,
A, B,
B, and
and C C could
could
be
be represented
represented byby xx11 and
and xx22 values
values of
of (0,
(0, 0)
0) for
for A,
A, (1,
(1, 0
for
for B,
B, and
and (0,1)
(0,1) for
for C.
C.
Care
Care must
must be
be taken
taken in
in defining
defining and
and interpreting
interpreting the
the
dummy
dummy variables.
variables.
Highest
Degree x1 x2
Bachelor’s 0 0
Master’s 1 0
Ph.D. 0 1
2
Residuals
Standard
0
0 10 20 30 40 50
-1
-2
Predicted Salary
Interpretation of E(y) as a
Probability in Logistic Regression
If the two values of y are coded as 0 or 1,
the value
of E(y) provides the probability that y = 1 given
a
particular
E(y) set of values
estimate of Pfor
(y x11|, xx12,,x2. ,.. ,,xxp )p.
b0 b1x1b2x2 bpxp
e
yˆ b0 b1x1b2x2 bpxp
1 e
Example: Simmons
Stores
Simmons’ catalogs are expensive and
Simmons
would like to send them to only those customers
who
have the highest probability of making a $200
Simmons’ management thinks that annual
purchase
spending
using the discount coupon included in the
at catalog.
Simmons Stores and whether a customer has
a
Simmons credit card are two variables that might
be
helpful in predicting whether a customer who
receives
the catalog will use the coupon to make a $200
© 2011 South-Western/Cengage Learning. All Rights Reserved 56
Logistic Regression
Example: Simmons
Stores
Simmons conducted a study by sending out
100
catalogs, 50 to customers who have a Simmons
credit
card and 50 to customers who do not have the
card.
At the end of the test period, Simmons noted for
each of
the 100 customers:
1) the amount the customer spent last year at
Simmons,
2) whether the customer had a Simmons credit
card, and
© 2011
3)South-Western/Cengage
whether the customer Learning.
madeAll Rights
a $200Reserved 57
purchase.
Logistic Regression
Odds 95% CI
Predictor Coef SE Coef Z p Ratio Lower Upper
Log-Likelihood = -60.487
est that all slopes are zero: G = 13.628, DF = 2, P-Value = 0.001
2.14640.3416x11.0987x2
e
yˆ 2.14640.3416x11.0987x2
1 e
Hypotheses H0: 1 = 2 = 0
Ha: One or both of the parameters
is not equal to zero.
Test Statistics z = bi/sb
i
Odds Ratio
odds1
Odds Ratio
odds0
Estimated Probabilities
Annual Spending
$1000 $2000 $3000 $4000 $5000 $6000 $7000
0.3305 0.4099 0.4943 0.5790 0.6593 0.7314 0.793
Credit Yes
Card 0.1413
No 0.1880 0.2457 0.3143 0.3921 0.4758 0.560
Computed
earlier
Comparing Odds
Suppose we want to compare the odds of
making a
$200 purchase for customers who spend $2000
annually
and have a Simmons credit card to the odds of
making a
$200 purchase .4099
estimatefor customers
of odds1 who spend $2000
.6946
annually 1- .4099
and do not have a Simmons .1880
credit card.
estimate of odds0 .2315
1- .1880
.6946
Estimate of odds ratio 3.00
.2315