Docsity

Statistical Analysis of Quadratic Regression Models and Logistic Regression, Exams of Statistics

Toggle sidebar
bg1
Chapter 11
Multiple Regression Analysis
The basic ideas are the same as in previous
chapters.
We have one response (dependent) variable, Y.
The response (Y) is a quantitative variable.
There are more than one predictors (independent
variables): X1, X2, …, Xp where p = number of
predictors in the model.
oThe predictors can be:
Quantitative (as before)
Categorical (new)
Interaction terms (product of predictors)
Powers of predictors (e.g.
2
4
X
).
In this course we will concentrate on
oReading computer output
oInterpreting coefficients
oDetermining the order to interpret things.
STA 6126 Chapter 11 Spring 2008
Page 1 of 48
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30

Partial preview of the text

Download Statistical Analysis of Quadratic Regression Models and Logistic Regression and more Exams Statistics in PDF only on Docsity!

Chapter 11

Multiple Regression Analysis

 The basic ideas are the same as in previous

chapters.

 We have one response (dependent) variable, Y.

 The response (Y) is a quantitative variable.

 There are more than one predictors (independent

variables): X 1

, X

2

, …, X

p where p = number of

p redictors in the model.

o The predictors can be:

 Quantitative (as before)

 Categorical (new)

 Interaction terms (product of predictors)

 Powers of predictors (e.g.

2

4

X ).

 In this course we will concentrate on

o Reading computer output

o Interpreting coefficients

o Determining the order to interpret things.

STA 6126 Chapter 11 Spring 2008

Some Examples

Example – 1: Suppose we want to predict temperature

for different cities, based on their latitude and

elevation.

In this case, the response and the predictors are

Y = temperature

X

1 = Latitude

X

2 = Elevation

Possible models are

With p = 2: 1 1 2 2

y     x   x  

(Stiff surface)

With p = 3: 1 1 2 2 3 1 2

y     x   x   x x  

(Twisted surface)

Example – 2: We want to predict patients’ “well-

being” from the dosage of medicine they take (mg.)

using a quadratic model:

2

1 2

y     x   ( ) x 

Here X = Dosage of the active ingredient (in mg’s),

and p = 2.

STA 6126 Chapter 11 Spring 2008

In general terms:

The model:

1 2 2 2 p p

y     x   x  L  x 

Assumptions:

  1.  ~ N(0, ) [ Error terms are independent and

identically distributed as normal with mean zero

and constant standard deviation ].

  1. As a result of (1), we have, Y ~ N(μ Y , ), for

every combination of x 1, x 2 , …, x p

. That is, the

response (Y) has a normal distribution with mean

μ Y (that depends on the values of the independent

variables, x’s) and a constant standard deviation,

 (that does not depend on the values of X’s).

We use data to find the

Fitted Equation or

Prediction Equation

1 2 2 2

p p

yab xb x L b x

STA 6126 Chapter 11 Spring 2008

ANOVA F-test:

Overall test of “goodness” of the model

Ho:  1

2

3

p = 0 NOTHING GOOD in model

Ha: at least one of ’s ≠ 0 SOMETHING IS GOOD.

Test Statistic :

MSReg

F

MSE

P-Value from the tables of the F-distribution with

df 1 = p = degrees of freedom of MSReg

df 2 = n – p – 1 = degrees of freedom of MSE

ANOVA for Multiple Regression Model

Source df SS MSE F

Regression

(Model)

p SSReg

SSReg

MSReg

p

MSReg

F

MSE

Residual

(Error)

n – p – 1 SSE

1

SSE

MSE

n p

 

Total n – 1 SST

STA 6126 Chapter 11 Spring 2008

Example - 1:

Let Y = height of a person,

X

1 = Length of right arm,

X

2 = Length of left arm.

  1. Suppose after collecting data we obtained an

ANOVA table with a small p-value. What does

that mean?

  1. What is the next step?
  2. Let’s say you carried out individual t-tests on each

of the slopes,  1 and  2 and found that the p-values

for both are large, what does that mean?

  1. Can you see a contradiction here?
  2. When do we get such contradictory results?
  3. So, when do we have multicollinearity? [See page

397.]

STA 6126 Chapter 11 Spring 2008

Example – 2: Suppose we are interesting in predicting

the GPA of students in college (CGPA) using 16

different predictor variables. Data were collected from

a random sample of 59 college students.

  1. What is the response variable in this problem?
  2. What are the values of n and p?
  3. What are Ho and Ha that you can test using the

ANOVA table?

  1. What is your decision, based on the following

ANOVA table? What is your conclusion?

Analysis of Variance

Source DF SS MS F P

Regression 16 3.3135 0.2071 1.99 0.

Residual Error 42 4.3601 0.

Total 58 7.

  1. What is the next step?
  2. When do you NOT take the next step?

STA 6126 Chapter 11 Spring 2008

8. The following is another part of the Minitab output.

Which predictor(s) is/are “good?”

  • Constant 0.532 1.496 0.36 0. Predictor Coef SE Coef T P
  • Height 0.01942 0.01637 1.19 0.
  • Gender 0.0468 0.1429 0.33 0.
  • Haircut – 0.001633 0.001697 –0.96 0.
  • Job – 0.0418 0.1024 –0.41 0.
  • Studytime 0.00043 0.01921 0.02 0.
  • Smokecig – 0.3746 0.2249 –1.67 0.
  • Dated 0.04881 0.07111 0.69 0.
  • HSGPA 0.5457 0.1776 3.07 0.
  • HomeDist 0.003147 0.003400 0.93 0.
  • BrowseInternet 0.000689 0.001163 0.59 0.
  • WatchTV –0.0012840 0.0009710 –1.32 0.
  • Exercise –0.011657 0.005934 –1.96 0.
  • ReadNewsP 0.01395 0.02272 0.61 0.
  • Vegan 0.0392 0.1578 0.25 0.
  • PoliticalDegree –0.01390 0.03185 –0.44 0.
  • PoliticalAff –0.08006 0.07741 –1.03 0.
  • STA 6126 Chapter 11 Spring S = 0.322198 R-Sq = 43.2% R-Sq(adj) = 21.5%
  1. The following is the last part of the output. What

does it tell us?

Unusual Observations

Obs Height CGPA Fit SE Fit Residual St Resid

28 67.0 2.9800 3.5898 0.2442 –0.6098 –2.90R

40 65.0 3.9300 3.3458 0.2176 0.5842 2.46R

59 62.0 2.5000 3.4718 0.1352 –0.9718 –3.32R

R denotes an observation with a large standardized residual.

Although the individual t-tests indicate that the GPA

of the student in high school (HSGPA) and Exercise

have coefficients (i) that are significantly different

from zero, when tested one at a time , with p-values of

0.004 and 0.056, respectively (hence they seem to look

good), we should look at all possible combinations of

the 16 predictors, so as not to miss any combination

that may give better results. It is almost impossible to

do this by hand, but fortunately computers can do it

for us.

In this way, we can find the “best subset” of

predictors that will give the “best” prediction

equation. The Minitab output on the next page gives

“all” possible subsets of regression models.

STA 6126 Chapter 11 Spring 2008

We see that when there are more than 2 predictors in

the regression model, the adjusted R

2

does not change

much from the model that has HGPA and Exercise as

the predictors.

Another consideration in model selection is

“parsimony.” That is, the preferred model is one that is

as simple as possible and with a high adjusted R

2

.

Thus, it seems that “the best combination” of

predictors is HGPA and Exercise.

Now we need to work through the above steps again

and see what we can say for a regression model that

has only HGPA (X 1 ) and Exercise (X 2 ) as predictors.

We obtain the following output from Minitab:

STA 6126 Chapter 11 Spring 2008

Regression Analysis: CGPA versus HSGPA, Exercise

The regression equation is

CGPA = 1.55 + 0.560 HSGPA - 0.0111 Exercise

Predictor Coef SE Coef T P

Constant 1.5489 0.5551 2.79 0.

HSGPA 0.5599 0.1436 3.90 0.

Exercise -0.011138 0.004985 –2.23 0.

S = 0.306126 R-Sq = 31.6% R-Sq(adj) = 29.2%

Analysis of Variance

Source DF SS MS F P

Regression 2 2.4256 1.2128 12.94 0.

Residual

(Error) 56 5.2479 0.

Total 58 7.

First, using ANOVA we test Ho:  1

2 = 0 against

Ha: At least one of  1 and  2 is different from zero.

Since the p-value < 0.0005, we reject Ho. The

observed data give strong evidence that at least one of

the two predictors is good in explaining the variation

in CGPA.

Next we carry out two independent tests :

Ho:  1 = 0 vs. Ha:  1  0 and

Ho:  2 = 0 vs. Ha:  2  0

STA 6126 Chapter 11 Spring 2008

 In the first panel (top-left) we see that the all but

one of the residuals are close to the blue line,

indicating that the assumption of the normality of

residuals is supported by the data. The lowest dot

on the LHS of this graph is the outlier or the

influential observation.

 The second panel (top-right) shows that the

standardized residuals are randomly scattered

around the horizontal line (residual = 0), and all,

except one (the outlier) are within 3 standard

deviations of the mean, i.e., zero (as expected).

 The third panel (Low-left) is a histogram of the

standardized residuals and support that the

residuals have a normal distribution with zero

mean and some constant variance.

 Finally, the last graph do not show any funnel

shape, so the assumption of constant variance is

supported. We can still see the outlier(s).

STA 6126 Chapter 11 Spring 2008

Standardized Residual

P

e

r c

e

n

t

  • 4 - 2 0 2 4
  1. 9

99

90

50

10

1

  1. 1

Fitted Value

S

t a

n

d

a

r d

i z

e

d

R

e

s i d

u

a

l

  1. 7 3. 0 3. 3 3. 6 3. 9

1

0

  • 1
  • 2
  • 3

Standardized Residual

F

r e

q

u

e

n

c

y

  • 3 - 2 - 1 0 1

16

12

8

4

0

Observation Order

S

t a

n

d

a

r

d

iz

e

d

R

e

s

id

u

a

l

1 5 10152025303540455055

1

0

  • 1
  • 2
  • 3

Normal Probability Plot of the Residuals Residuals Versus the Fitted Values

Histogram of the Residuals Residuals Versus the Order of the Data

Residual Plots for CGPA

In order to see if including a quadratic or higher order

term of one or both of the predictors might improve

the model, we look at a scatter diagram of the

standardized residuals vs. the predictors. These are

given below:

Residual Plots for CGPA

HSGPA

S

t a

n

d

a

r d

iz

e

d

R

e

s id

u

a

l

  1. 50 2. 75 3. 00 3. 25 3. 50 3. 75 4. 00

2

1

0

  • 1
  • 2
  • 3
  • 4

Residuals Versus HSGPA

(response is CGPA)

Exercise

S

t a

n

d

a

r d

iz

e

d

R

e

s id

u

a

l

0 10 20 30 40 50 60

2

1

0

  • 1
  • 2
  • 3
  • 4

Residuals Versus Exercise

(response is CGPA)

We do not see any higher order relation between the

residuals and the predictors. So we cannot improve the

model by adding any other predictor.

However, there is at least one observation that needs to

be checked and corrected if possible, or removed from

the data set otherwise.

The question is which one of the observation should

we look at and delete first (if we cannot find the

reason why it has such a large residual)?

[We delete observations one at a time because things

may change after deleting one observation.]

STA 6126 Chapter 11 Spring 2008

Regression Analysis: CGPA versus HSGPA, Exercise

Analysis of Variance

Source DF SS MS F P

Regression 2 1.45009 0.72504 7.69 0.

Residual Error 55 5.18265 0.

Total 57 6.

Looking at the ANOVA table we decide to reject Ho

and conclude that at least one of the two predictors is

“good.” [Note the change in the degrees of freedom in

ANOVA. Why should they change?]

The regression equation is

CGPA = 1.54 + 0.554 HSGPA - 0.00432 Exercise

Predictor Coef SE Coef T P

Constant 1.5388 0.5568 2.76 0.

HSGPA 0.5542 0.1441 3.85 0.

Exercise -0.004320 0.009596 -0.45 0.

S = 0.306969 R-Sq = 21.9% R-Sq(adj) = 19.0%

Test on the ’s one at a time show that the second

predictor (Exercise) is not “good” since the

corresponding p-value = 0.654 > larger than any

reasonable . This means we should try a new model,

without Exercise. Because we are going to change the

model, we do not need to do anything based on the

rest of the output.

Unusual Observations

Obs HSGPA CGPA Fit SE Fit Residual St Resid

3 3.00 3.6000 3.1970 0.1324 0.4030 1.45 X

25 3.50 3.3100 3.3705 0.1974 -0.0605 -0.26 X

26 2.55 3.1400 2.9261 0.1856 0.2139 0.87 X

27 3.80 2.9800 3.6361 0.0497 -0.6561 -2.17R

58 3.60 2.5000 3.5252 0.0594 -1.0252 -3.40R

R denotes an observation with a large standardized residual.

X denotes an observation whose X value gives it large influence.

STA 6126 Chapter 11 Spring 2008

Here is the output for the SLR model with HSGPA as

the predictor:

Regression Analysis: CGPA versus HSGPA

The regression equation is

CGPA = 1.50 + 0.560 HSGPA

Predictor Coef SE Coef T P

Constant 1.4964 0.5448 2.75 0.

HSGPA 0.5596 0.1426 3.92 0.

S = 0.304776 R-Sq = 21.6% R-Sq(adj) = 20.2%

Analysis of Variance

Source DF SS MS F P

Regression 1 1.4310 1.4310 15.41 0.

Residual Error 56 5.2017 0.

Total 57 6.

Both panels show that  is significantly different from

zero and hence we have a “reasonably good” model.

[It is not really a good model, why?]

Next we should look at the following panel??? of the

output to see if we want to delete a few more

observations to improve the model.

We may also try to find other predictors so as to

improve R

2

which is around 20%, i.e., only 20% of the

variation in CGPA is explained by changes in

HSGPA, or alternatively we can say that HSGPA has

reduced the error sum of squares only by 20%.

STA 6126 Chapter 11 Spring 2008