regression. lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how...

13
Regression Regression

Upload: gavin-hughes

Post on 26-Mar-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

RegressionRegression

Page 2: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

LinesLines

y=mx+by=mx+b m = slope of the line; how steep it ism = slope of the line; how steep it is b = y-intercept of the line; where the line hits b = y-intercept of the line; where the line hits

the Y axisthe Y axis

Page 3: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

SlopeSlope

Slope is the comparative rate of change Slope is the comparative rate of change for Y and X.for Y and X.

Steeper slope indicates a greater changeSteeper slope indicates a greater change Slope = m = Slope = m = ∆Y∆Y = = (Y2-Y1)(Y2-Y1) = = riserise

∆X (X2-X1) run ∆X (X2-X1) run

Page 4: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Compact and Augmented ModelCompact and Augmented Model The Compact Model says that your best guess for The Compact Model says that your best guess for

any value in a sample is the mean.any value in a sample is the mean. C: YC: Yii = = ββ00 + + εεii

• Anyone’s Yi value (DV) is equal to the intercept (Anyone’s Yi value (DV) is equal to the intercept (ββ00) plus error) plus error

The Augmented Model makes your prediction The Augmented Model makes your prediction even better than the mean by adding a even better than the mean by adding a predictor(s).predictor(s). A: YA: Yii = = ββ00 + + ββ11XX11+ … + + … + ββnnXXnn++εεii

• With the average height of 5’5 we add other predictors like With the average height of 5’5 we add other predictors like shoe size or ring size.shoe size or ring size.

Page 5: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Parameters and Degrees of Parameters and Degrees of FreedomFreedom

A A parameterparameter is a numeric quantity, that  is a numeric quantity, that describes a certain population characteristic. describes a certain population characteristic. (i.e. population mean)(i.e. population mean)

The number of betas in your compact and The number of betas in your compact and augmented model indicates how many augmented model indicates how many parameters you have in each model.parameters you have in each model.

df Regression = PA-PCdf Regression = PA-PC df Residual = N-PAdf Residual = N-PA df Total = N-PCdf Total = N-PC

Page 6: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Predicting Height From Mean Predicting Height From Mean HeightHeight

How much error was there?How much error was there? C: YC: Yii = = ββ00 + + εεii; PC =1; PC =1

WhereWhere β β00 is your average height and is your average height and εεii is your is your

error in the compact modeerror in the compact mode PC = 1PC = 1 ŶŶcc = b = b00 = = ӮӮ..

Page 7: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Predicting Height from Shoe Predicting Height from Shoe Size and Mean HeightSize and Mean Height

How much error was there now?How much error was there now? A: YA: Yii = = ββ00 + + ββ11XX11+ + εεii ; PA = 2 ; PA = 2

ββ00 is the adjusted mean, is the adjusted mean, ββ11 represents the represents the

effect of shoe size, Xeffect of shoe size, X11 is shoe size (a is shoe size (a

predictor) and predictor) and εεii is the error is the error

ŶŶAA = b = b00+b+b11X1X1

bb11= SSxy/SSx = slope= SSxy/SSx = slope

bb00 = = ӮӮ – b – b11(Xbar1)(Xbar1)

Page 8: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Proportional Reduction in Error Proportional Reduction in Error PRE is the amount of error you have reduced PRE is the amount of error you have reduced

by using the augmented model to predict height by using the augmented model to predict height as opposed to the compact modelas opposed to the compact model

PRE = RPRE = R22 = ɳ = ɳ22 = = SSregSSreg SStotal SStotal

= = SSxy SSxy √(SSx)(SSy) √(SSx)(SSy)

Page 9: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Creating the ANOVA TableCreating the ANOVA Table

Page 10: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

The Coefficients TableThe Coefficients Table

Page 11: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Comparing Regression Printout Comparing Regression Printout With ANOVAWith ANOVA

Page 12: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Contrast CodingContrast Coding Contrast codes are orthogonal codes meaning Contrast codes are orthogonal codes meaning

that they are unrelated codes.that they are unrelated codes. Three rules to follow when using contrast Three rules to follow when using contrast

codes:codes: The sum of the weights for all groups must be zeroThe sum of the weights for all groups must be zero The sum of the products for each pair must be zeroThe sum of the products for each pair must be zero The difference in the value of positive weights and The difference in the value of positive weights and

negative weights should be one for each code negative weights should be one for each code variablevariable

http://www.stat.sc.edu/~mclaina/psyc/1st%20lab%20notes%20710.pdf

Page 13: Regression. Lines y=mx+b y=mx+b m = slope of the line; how steep it is m = slope of the line; how steep it is b = y-intercept of the line; where the line

Sums of Squares Everywhere!Sums of Squares Everywhere!

SSE(C) =SSSSE(C) =SSyy = SS = SStt

SSE(A) = SSSSE(A) = SSresidresid =SS =SSww

SSSSregreg = SS = SSbb