Docsity

Multiple Regression - Lecture Slides | STA 6167, Study notes of Statistics

Toggle sidebar
bg1
Multiple Regression
• Numeric Response variable (y)
•p Numeric predictor variables (p < n)
• Model:
Y=
β
0+
β
1x1+ ⋅⋅⋅ +
β
pxp+
ε
• Partial Regression Coefficients:
β
i≡effect (on the mean
response) of increasing the ith predictor variable by 1
unit, holding all other predictors constant
• Model Assumptions (Involving Error terms
ε
)
– Normally distributed with mean 0
– Constant Variance
σ
2
– Independent (Problematic when data are series in time/space)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Multiple Regression - Lecture Slides | STA 6167 and more Study notes Statistics in PDF only on Docsity!

Multiple Regression

•^

Numeric Response variable (

y )

•^

p^

Numeric predictor variables (

p < n

•^

Model:^ Y

=

β^0

β^1

x^1

⋅⋅⋅

β p

x^ p

ε

•^

Partial Regression Coefficients:

βi

effect (on the mean

response) of increasing the

th i predictor variable by 1

unit,

holding all other predictors constant

•^

Model Assumptions (Involving Error terms

ε^

  • Normally distributed with mean 0 – Constant Variance

(^2) σ

  • Independent (Problematic when data are series in time/space)

Example - Effect of Birth weight on

Body Size in Early Adolescence

  • Response: Height at Early adolescence (

n^

=250 cases)

  • Predictors (

p =6 explanatory variables)

  • Adolescent Age (

x^1

, in years -- 11-14)

  • Tanner stage (

x^2

, units not given)

  • Gender (

x^3

=1 if male, 0 if female)

  • Gestational age (

x^4

, in weeks at birth)

  • Birth length (

x^5

, units not given)

  • Birthweight Group (

x^6

=1,...,

<

g^

(1), 1500-

1999

g (2), 2000-

g (3), 2500-

g (4), 3000-

3499

g (5), >

g (6))

Source: Falkner, et al (2004)

Analysis of Variance

•^

Direct extension to ANOVA based on simplelinear regression

-^

Only adjustments are to degrees of freedom:^ –

DF

= R p

DF

= E n

  • p

*^

( p

*=

p +1=#Parameters)

Source ofVariation

Sum ofSquares

Degrees ofFreedom

MeanSquare

F

Model

SSR

p^

MSR

=^ SSR

/ p^

F^ =

MSR

/ MSE

Error

SSE

n - _p_*

MSE

=^ SSE

/( n -

p *)

Total

TSS

n -

SSR TSS

TSS

SSE

TSS

R^

=

−

= 2

Testing for the Overall Model -

F

-test

  • Tests whether

any

of the explanatory variables are

associated with the response

-^

H

: 0 β^1

=

⋅⋅⋅

=

β

=0 (None of thep

x

s^ associated with

y

)

-^

H

: Not allA

β

= 0i

)

( : :. .

*)

/( )

(^1) (

/

:. .

, ,

2

2

obs

p n p

obs obs

F

F P

val

P

F

F

R R

p

n

R

p

R

MSRMSE

F

S T

≥

−

≥

−

−

=

=

−

α

Testing Individual Partial Coefficients -

t

-tests

•^

Wish to determine whether the response isassociated with a single explanatory variable, aftercontrolling for the others

-^

H

βi

H
:A

βi

(2-sided alternative) |)

| ( (^2) :

|

|: . .

:. .

, 2 / ^ ^

obs

p n

obs

i b

obs

t t P

val P

t

t

R R

s

t S T

i^ ≥

−

≥

−

α β

Example - Effect of Birth weight on

Body Size in Early Adolescence

Variable

b^

SE

b^

t=b/SE

b^

P-val (z)

Adolescent Age

.

Tanner Stage

<.

Male

.

Gestational Age

-0.

-0.

.

Birth Length

.

Birth Wt Grp

-0.

-1.

.

Controlling for all other predictors, adolescent age, Tanner stage, andBirth length are associated with adolescent height measurement

Comparing Regression Models

-^

H

: 0

βg+

=…=

p^

= 0 (After removing the

effects of

X

,…, 1

X

, none of other predictorsg

are associated with

Y

)

-^

H

: a

H

0

is false

(^

(^

)

( :

*]

[

1

)

(

*]

/[

)

/()

(

: TS

*) (, ,

(^22)

2

obs

p n g p

obs

r c

c

c

r

c

obs

F

F P P

F

F

RR

p n

R

g p R R p n

SSE

g p

SSR

SSR

F

≥

=

≥

−

−

−

−

=

−

−

−

=

− − α

P -value based on

F

-distribution with

p-g

and

n

-p* d.f.

Models with Dummy Variables

•^

Some models have both numeric and categoricalexplanatory variables (Recall

gender

in example)

•^

If a categorical variable has

m

levels, need to create

m

dummy variables that take on the values 1 if the level ofinterest is present, 0 otherwise.

-^

The baseline level of the categorical variable is the onefor which all

m

-1 dummy variables are set to 0

•^

The regression coefficient corresponding to a dummyvariable is the difference between the mean for thatlevel and the mean for baseline group, controlling forall numeric predictors

Example - Weather and Spinal Patients

-^

Subjects - Visitors to National Spinal Network in 23 citiesCompleting SF-36 Form

-^

Response - Physical Function subscale (1 of 10 reported)

-^

Predictors:–

Patient’s age (

x )^1

-^

Gender (

x =1 if female, 0 if male)^2

-^

High temperature on day of visit (

x )^3

-^

Low temperature on day of visit (

x )^4

-^

Dew point (

x )^5

-^

Wet bulb (

x )^6

-^

Total precipitation (

x )^7

-^

Barometric Pressure (

x )^7

-^

Length of sunlight (

x )^8

-^

Moon Phase (new, wax crescent, 1st Qtr, wax gibbous, full moon,wan gibbous, last Qtr, wan crescent, presumably had 8-1=7dummy variables)

Source: Glaser, et al (2004)

Modeling Interactions

  • Statistical Interaction: When the effect of one

predictor (on the response) depends on the levelof other predictors.

  • Can be modeled (and thus tested) with cross-

product terms (case of 2 predictors):^ –

E
( Y

β^1

X^1

β^2

X^2

β^3

X
X 1

2

–^
X^2
E
( Y

β^1

X^1
–^
X^2
E
( Y

β^1

X^1

β^2

β^3

X^1

β^2

β^1

β^3

) X

1

  • The effect of increasing

X

1

by 1 on

E

( Y

) depends

on level of

X

, unless 2

β

=0 ( 3

t -test)

Backward Elimination

•^

Select a significance level to stay in the model (e.g.SLS=0.20, generally .05 is too low, causing too manyvariables to be removed)

-^

Fit the full model with all possible predictors

-^

Consider the predictor with lowest

t -statistic (highest

P -value).^ – If

P

> SLS, remove the predictor and fit model without this variable (must re-fit model here because partial regressioncoefficients change)

  • If

P

≤

SLS, stop and keep current model

•^

Continue until all predictors have

P

-values below SLS

Forward Selection

•^

Choose a significance level to enter the model (e.g.SLE=0.20, generally .05 is too low, causing too fewvariables to be entered)

-^

Fit all simple regression models.

-^

Consider the predictor with the highest

t -statistic (lowest

P -value)^ – If

P

≤

SLE, keep this variable and fit all two variable models

that include this predictor

  • If

P

> SLE, stop and keep previous model

•^

Continue until no new predictors have

P
SLE

All Possible Regressions -

C

p

•^

Fits every possible model. If

K

potential predictor

variables, there are 2

K -1 models.

•^

Label the Mean Square Error for the model containingall

K

predictors as

MSE

K

•^

For each model, compute

SSE

and

C

where p

p*

is the

number of parameters (including intercept) in model

*) 2 (^

p n

SSEMSE

C

K

p^

− −

=

  • Select the model with the fewest predictors that has

C

≈ p^

p*

Regression Diagnostics

•^

Model Assumptions:^ – Regression function correctly specified (e.g. linear)^ – Conditional distribution of

Y

is normal distribution

  • Conditional distribution of

Y

has constant standard deviation

  • Observations on

Y

are statistically independent

•^

Residual plots can be used to check the assumptions^ – Histogram (stem-and-leaf plot) should be mound-shaped

(normal)

  • Plot of Residuals versus each predictor should be random cloud
    • U-shaped (or inverted U)

⇒

Nonlinear relation

  • Funnel shaped

⇒

Non-constant Variance

  • Plot of Residuals versus Time order (Time series data) should be

random cloud. If pattern appears, not independent.