Chapter 5 Matrix Approach to Simple Linear Regression

Size: px
Start display at page:

Download "Chapter 5 Matrix Approach to Simple Linear Regression"

Transcription

1 Chapter 5 Matrx Approach to Smple Lear Regresso Defto: A matrx s a rectagular array of umbers or symbolc elemets I may applcatos, the rows of a matrx wll represet dvduals cases (people, tems, plats, amals,...) ad colums wll represet attrbutes or characterstcs The dmeso of a matrx s t umber of rows ad colums, ofte deoted as r x c (r rows by c colums) Ca be represeted full form or abbrevated form: a a a j a c a a a j a c A aj,..., r; j,..., c a a aj a c a r ar arj arc Specal Types of Matrces Square Matrx: Number of rows = # of Colums b b A 8 4 B b b Vector: Matrx wth oe colum (colum vector) or oe row (row vector) d 57 d C 4 D E' 7 3 ' f f f3 d F 3 r c 8 d4 Traspose: Matrx formed by terchagg rows ad colums of a matrx (use "prme" to deote traspose) G ' G 3 5 h h c h hr H h j,..., r; j,..., c ' h j,..., ;,..., rc H j c r cr hr hrc h c h rc

2 Matrx Equalty: Matrces of the same dmeso, ad correspodg elemets same cells are all equal: 4 6 b b A 0 = B b 4, b 6, b, b 0 b b Example: Bollywood Box Offce Data Data orgal (o-trasformed) uts. Respose Vector: Y' Desg Matrx: Y Y Y Y Y Y Y ' As we wll see below, the matrx cludes a colum of s, ths wll allow for the tercept term.

3 Y Each row represets a dvdual flm. There are =55 rows both ad Y.

4 Matrx Addto ad Subtracto Addto ad Subtracto of Matrces of Commo Dmeso: C 0 D 4 6 C D C D a a c b b c A rc a j,..., r; j,..., c b B j,..., r; j,..., c rc ar a rc br b rc a b a c b c A B aj b j,..., r; j,..., c rc a rbr arc b rc a b a c b c AB aj b,..., ;,..., rc j r j c ar br arc b rc Regresso Example: Y E Y Y E Y E Y Y E Y Y E Y sce Y E Y ε Y E Y ε EY Y E Y Y EY EY Matrx Multplcato Multplcato of a Matrx by a Scalar (sgle umber): 3() 3() 6 3 k 3 A 7 ka 3( ) 3(7) 6 Multplcato of a Matrx by a Matrx (#cols( A) = #rows( B)): If c r : A B A B AB = ab,..., r ; j,..., c ra ca rb cb ra cb ab c r th th j sum of the products of the A B elemets of row of A ad j colum of B: 5 3 A 3 B (3) 5() ( ) 5(4) 6 8 A B AB 3(3) ( )() 3( ) ( )(4) 7 7 0(3) 7() 0( ) 7(4) j A B c If c r c : A B AB = ab = a b,..., r ; j,..., c A B j k kj A B ra ca rb cb ra cb k

5 Note that the (,j) th elemet of AB s the sumproduct of the th row of A ad the j th colum of B. Also, t s mportat to remember that ulke matrx addto ad subtracto, matrx multplcato s ot elemet by elemet. Examples of Matrx Multplcato Smultaeous Equatos: a x a x y a x a x y ( equatos: x, x ukow): a x a x y ax ax y a a x y a a x y A = Y Sum of Squares: Regresso Equato (Expected Values): Matrces used smple lear regresso (that geeralze to multple regresso): YY ' Y Y Y Y Y Y Y ' Y 0 Y Y 0 0 ' Y β Y Y 0

6 Example: Bollywood Box Offce Data Y'Y ' 'Y Specal Types of Matrces Symmetrc Matrx: Square matrx wth a traspose equal to tself: A = A': A A' A Dagoal Matrx: Square matrx wth all off-dagoal elemets equal to 0: b 0 0 A b 0 B Note:Dagoal matrces are symmetrc (ot vce versa) b 3 Idetty Matrx: Dagoal matrx wth all dagoal elemets equal to (acts lke multplyg a scalar by ): 0 0 a a a3 a a a3 I 0 0 A a a a IA AI A a a a a3 a3 a 33 a3 a3 a 33 Scalar Matrx: Dagoal matrx wth all dagoal elemets equal to a sgle umber" k k k k I 0 0 k k Vector ad matrx ad zero-vector: J 0 Note: ' r ' r rr r r r All of these matrces have mportat roles regresso aalyss, partcularly whe we have multple predctor varables. Software packages (cludg R ad ECEL (to a lesser extet)) ca be used to make all relevat matrx computatos. Lear Depedece ad Matrx Rak Lear Depedece: Whe a lear combato of the colums (rows) of a matrx produces a zero vector (oe or more colums (rows) ca be wrtte as lear fucto of the other colums (rows)) Rak of a matrx: Number of learly depedet colums (rows) of the matrx. Rak caot exceed the mmum of the umber of rows or colums of the matrx. rak(a) m(r A,c a ) A matrx s full rak f rak(a) = m(r A,c a ) rr J rr

7 3 A 3 Colums of are learly depedet rak( ) = 4 A A A A 0 A A 4 3 B 0 0 Colums of are learly depedet rak( ) = 4 B B B B 0 B B For all well posed regresso problems, ad wll be full rak. Matrx Iverse Note: For scalars (except 0), whe we multply a umber, by ts recprocal, we get : (/)= x(/x)=x(x - )= I matrx form f A s a square matrx ad full rak (all rows ad colums are learly depedet), the A has a verse: A - such that: A - A = A A - = I A 4 A A A I / B 0 / 0 B / 6 BB - 4/ / I / Obtag verses of x matrces s very smple. For matrces that are larger tha x, we wll use R ad/or ECEL to obta verses whe ecessary. Note that all software packages are terally dog the computatos lear regresso programs.

8 Computg the Iverse of a x Matrx a a A full rak (colums/rows are learly depedet) a a Determat of A A a a a a Note: If A s ot full rak (for some value k): a ka a ka A aa aa kaa aka 0 ' a a - A Thus does ot exst f s ot full rak a a A A A Whle there are rules for geeral r r matrces, we wll use computers to solve them Regresso Example: Note: ' ' '

9 Example: Bollywood Box Offce Data SS ' 55(765.43) Solvg Smultaeous Equatos wth a Matrx Iverse AY = C where A ad C are matrces of of costats, Y s matrx of ukows A AY A C Y = A C (assumg A s square ad full rak) Equato : y 6y 48 Equato : 0y y 6 y 48 - A 0 Y y C Y = A C A ( ) 6(0) Y = A C Note the wsdom of watg to dvde by A at ed of calculato! Serous roudg errors ca occur whe dvdg by the determat too early maual computatos. Some Useful Matrx Results (Assumg Coformablty of Matrces to Operatos All rules assume that the matrces are coformable to operatos: Addto Rules: A B B A ( A B) C A ( B C) Multplcato Rules: (AB)C A(BC) C( A B) CA + CB k( A B) ka kb k scalar Traspose Rules: ( A ')' A ( A B )' A ' B' ( AB)' B'A' (ABC)' = C'B'A' Iverse Rules (Full Rak, Square Matrces): (AB) = B A (ABC) = C B A (A ) = A (A') = (A )'

10 Radom Vectors ad Matrces Show for case of =3, geeralzes to ay : Radom varables: Y, Y, Y Y Y Y Y 3 3 E Y Expectato: EY E Y I geeral: EYj E Y,..., ; j,..., p p E Y 3 Varace-Covarace Matrx for a Radom Vector: Y E Y Y E Y E Y Y E Y ' E Y E Y Y EY Y EY Y3 EY 3 Y3 E Y 3 Y EY Y EY Y EY Y EY Y3 E Y 3 Y EY Y EY Y EY Y EY Y3 E Y 3 Y3 EY3 Y EY Y3 EY 3Y EY Y3 E Y 3 3 E Lear Regresso Example ( = 3) Error terms are assumed to be depedet, wth mea 0, costat varace : j E 0, 0 j ε E ε σ ε 0 0 I Y = β + ε E Y E β + ε β E ε β σ Y σ β + ε σ ε 0 0 I

11 Mea ad Varace of Lear Fuctos of Y A matrx of fxed costats k Y radom vector a a Y W ay... a Y W AY radom vector: k W a a Y W a Y... a Y k k k k k E W E W EW k E a Y... a Y a E Y... a E Y EakY... aky akey... akey a a E Y AE Y a a E Y k k σ W = E AY - AE Y AY - AE Y ' = E A Y - E Y A Y - E Y ' = E A Y - E Y Y - E Y 'A' = AE Y - E Y Y - E Y ' A' = Aσ Y A' Multvarate Normal Dstrbuto Geeral Case Y Y Y μ = E Y Σ = σ Y Y Multvarate Normal Desty fucto: f / / - Y Σ exp Y - μ 'Σ Y - μ Y ~ Nμ, Σ ~,,..., Y N Y, Y j Note, f A s a (full rak) matrx of fxed costats: W = AY ~ N Aμ, AΣA' j j

12 Bvarate Normal Desty wth Smple Lear Regresso Matrx Form Smple Lear Regresso Model: Y,..., Y 0 Y 0 Y 0 Defg: 0 Y 0 Y Y 0 0 Y= β ε 0 Y = β + ε sce: β EY Assumg costat varace, ad depedece of error terms : σ Y = σ ε I 0 0 Further, assumg ormal dstrbuto for error terms : Y~ N β, I

13 Least Squares Estmato Matrx Form Q Q Normal equatos obtaed from:, ad settg each equal to 0: b b Y 0 0 b b Y Note: I matrx form: ' 0 Y b0 'Y Defg b b Y 'b = 'Y b = ' 'Y - Based o matrx form: Q Y - β ' Y - β = Y'Y - Y'β - β''y + β''β Y ' Y 0Y Y 0 0 Q Y 0 0 ( Q) ' Y ' β Q Y 0 Settg ths equal to zero, ad replacg wth b ' b ' Y Aga, the key result that we wll be usg repeatedly throughout multple regresso s that: b = ( ) - Y. Y wll always be a x vector of resposes, ad wll deped o what predctor varables are cotaed a model, but wll always have rows. Example: Bollywood Box Offce Data ' 'Y 55(765.43) b 55(765.43) (578.35) ( 47)(9097.5) (765.43) ( 47)(578.35) ( 55)(9097.5) Compare these estmates wth those from Chapter.

14 Ftted Values ad Resduals Matrx Form Y b0 b e Y Y Y b0 b Y b 0 b Note that whle H s hghly useful matrx computatos, t s x. Thus, we wll rarely prt t out (except very small datasets), ad t s very dffcult to work wth ECEL. The mportat take-away here s that whle the elemets of Y ad are assumed to be depedet, the elemets of I Matrx form: - - Y b = ' 'Y = HY H = ' ' b0 b Y H s called the "hat" or "projecto" matrx, ote that H s dempotet ( HH = H) ad symmetrc( H = H' ): Y Y Y Y Y Y Y Y e Y - Y = Y - b = Y - HY = (I - H)Y Y Y Y Y Y ad e are ot (H s ot a dagoal matrx) HH = ' ' ' ' 'I ' ' ' ' H H' = ' ' ' = ' ' = H Note: - E Y = E HY = HE Y = Hβ = ' 'β = β σ Y = Hσ IH' H e E = E I H Y = I H E Y = I H β β - β = 0 σ e = I H σ I I H ' I H MSE MSE s Y H s e = I H

15 Aalyss of Varace Total (Corrected) Sum of Squares: SSTO Y Y Y Y Note: Y ' Y Y Y'JY J SSTO Y ' Y Y'JY Y ' I J Y SSE e'e = Y - b sce b''y = Y'' ' Y ' Y - b = Y'Y - Y'b - b''y + b''b = Y'Y - b''y = Y' I - H Y - 'Y = Y'HY ' SSR SSTO SSE Y b''y Y'HY Y'JY Y H J Y Note that SSTO, SSR, ad SSE are all QUADRATIC FORMS: Y'AY for symmetrc, dempotet matrces A Example: Bollywood Box Offce Data Y Y'IY Y Y'JY b 'Y b''y Y'HY SSTO Y' I J Y SSE Y' I H Y SSR Y' H J Y

16 Ifereces Lear Regresso MSE Recall: b b = ' 'Y Þ E b = ' 'E Y = ' 'β = β σ b = ' 'σ Y ' = σ ' 'I ' = σ ' s b ' s ' - MSE MSE MSE MSE MSE MSE Estmated Mea Respose at : Y h b0 b h h h s Y h h h h 'b ' MSE Predcted New Respose at : - Y h b0 b h h'b s pred MSE h' ' h h s b ' ' h h h - Example: Bollywood Box Offce Data ' (765.43) SSE MSE (765.43) b s sb s b Compare these wth the results from Chapter.

17 R Program for Matrx Computatos Bollywood Data bbo <- read.csv(" header=t) attach(bbo) ames(bbo) Y <- Budget; <- Gross <- legth(y) 0 <- rep(,) <- as.matrx(cbd(0,)) Y <- as.matrx(y,col=) # Colum of s for matrx # Form the -matrx (=55 rows, Cols) # Form the Y-vector (=55 rows, col) # Notes: t() = traspose of, %*% = matrx multplcato, solve(a) = A(-) ( <- t() %*% ) # Obta ' matrx ( rows, cols) (Y <- t() %*% Y) # Obta 'Y vector ( rows, col) (I <- solve()) # Obta (')(-) matrx ( rows, cols) (b <- I %*% Y) # Obta b-vector ( rows, col) Y_hat <- %*% b # Obta the vector of ftted values (=55 rows, col) e <- Y - Y_hat # Obta the vector of resduals (=55 rows, col) prt(cbd(y_hat,e)) H <- %*% I %*% t() # Obta the Hat matrx J_ <- matrx(rep(/,),col=) # Obta the (/)J matrx (=55 rows, =55 cols) I_ <- dag() # Obta the detty matrx (=55 rows, =55 cols) (SSTO <- t(y) %*% (I_ - J_) %*% Y) # Obta Total Sum of Squares (SSTO) # SSTO ca also be computed as: (SSTO <- (t(y) %*% Y) - (t(y) %*% (I_ - J_) %*% Y)) (SSE <- t(y) %*% (I_ - H) %*% Y) # Obta Error Sum of Squares (SSE) # SSE ca also be computed as: (SSE <- (t(y) %*% Y) - (t(b) %*% Y)) (SSR <- t(y) %*% (H - J_) %*% Y) # Obta Regresso Sum of Squares (SSR) # SSR ca also be computed as: (SSR <- (t(b) %*% Y) - (t(y) %*% J_ %*% Y)) (MSE <- SSE/(-)) # Obta MSE = s (s_b <- MSE[,] * I) # Obta s{b}, must use MSE[,] ad * to do scalar multplcato (_h <- matrx(c(,0),col=)) # Create _h vector, for case where budget=0 (Y_hat_h <- t(_h) %*% b) # Obta the ftted value whe budget=0 (s_yhat_h <- t(_h) %*% s_b %*% _h) # Obta s{y_hat_h} (s_pred <- MSE + (t(_h) %*% s_b %*% _h)) # Obta s{pred}

18 R Output for Matrx Computatos Bollywood Data > ( <- t() %*% ) # Obta ' matrx ( rows, cols) > > (Y <- t() %*% Y) # Obta 'Y vector ( rows, col) [,] > > (I <- solve()) # Obta (')(-) matrx ( rows, cols) e e-06 > > (b <- I %*% Y) # Obta b-vector ( rows, col) [,] > > Y_hat <- %*% b # Obta the vector of ftted values (=55 rows, col) > > e <- Y - Y_hat # Obta the vector of resduals (=55 rows, col) > > prt(cbd(y_hat,e)) [,] [,] [,] [,] [54,] [55,] > Cotued Below

19 > > H <- %*% I %*% t() # Obta the Hat matrx > > J_ <- matrx(rep(/,),col=) # Obta the (/)J matrx (=55 rows, =55 cols) > > I_ <- dag() # Obta the detty matrx (=55 rows, =55 cols) > > (SSTO <- t(y) %*% (I_ - J_) %*% Y) # Obta Total Sum of Squares (SSTO) [,] [,] > # SSTO ca also be computed as: > # (SSTO <- (t(y) %*% Y) - (t(y) %*% (I_ - J_) %*% Y)) > > (SSE <- t(y) %*% (I_ - H) %*% Y) # Obta Error Sum of Squares (SSE) [,] [,] > # SSE ca also be computed as: > # (SSE <- (t(y) %*% Y) - (t(b) %*% Y)) > > (SSR <- t(y) %*% (H - J_) %*% Y) # Obta Regresso Sum of Squares (SSR) [,] [,] > # SSR ca also be computed as: > # (SSR <- (t(b) %*% Y) - (t(y) %*% J_ %*% Y)) > > (MSE <- SSE/(-)) # Obta MSE = s [,] [,] > > (s_b <- MSE[,] * I) # Obta s{b}, must use MSE[,] ad * to do scalar multplcato > > (_h <- matrx(c(,0),col=)) # Create _h vector, for case where budget=0 [,] [,] [,] 0 > > (Y_hat_h <- t(_h) %*% b) # Obta the ftted value whe budget=0 [,] [,] > > (s_yhat_h <- t(_h) %*% s_b %*% _h) # Obta s{y_hat_h} [,] [,].5905 > > (s_pred <- MSE + (t(_h) %*% s_b %*% _h)) # Obta s{pred} [,] [,]

20 E(Y) Models wth Multple Predctors Chapter 6 Multple Regresso I Most Practcal Problems have more tha oe potetal predctor varable Goal s to determe effects (f ay) of each predctor, cotrollg for others Ca clude polyomal terms to allow for olear relatos Ca clude product terms to allow for teractos whe effect of oe varable depeds o level of aother varable Ca clude dummy varables for categorcal predctors Frst-Order Model wth Predctors Y 0 E 0 E Y Plae 3-dmesos E(Y)= Iterpretato of Regresso Coeffcets Addtve: E{Y} = Mea of 0 Itercept, Mea of Y whe = =0 Slope wth Respect to (effect of creasg by ut, whle holdg costat) Slope wth Respect to (effect of creasg by ut, whle holdg costat)

21 These ca also be obtaed by takg the partal dervatves of E{Y} wth respect to ad, respectvely Iteracto Model: E{Y} = Whe = 0: Effect of creasg by : ()+ 3 ()(0)= Whe = : Effect of creasg by : ()+ 3 ()()= + 3 The effect of creasg depeds o level of, ad vce versa Geeral Lear Regresso Model wth p- Predctor Varables Y... 0 p, p p Y 0 k k k p Y where: k k 0 k 0 E 0 E Y... (Hyperplae p-dmesos) 0 p p p Smple lear regresso Normalty, depedece, ad costat varace for errors: 0, ~ NID 0, Y ~ N..., Y, Y 0 j p p j Example: Factors Effectg Ar Permeablty of Wove Fabrcs Y Average ar permeablty cm /s/cm 3 Warp Yar Desty (eds/cm) Weft Yar Desty (pcks/cm) Mass per Ut Area grams/cm 3 Graphc Source: Wkpeda Data Source: A. Ca, S. Vasslads, M. Ragouss, I. Tarakcoglu (007). Predcto of the Ar Permeablty of Wove Fabrcs Usg Neural Networks, Iteratoal Joural of Clothg Scece ad Techology, Vol. 9, #, pp. 8-35

22 ID warp weft mass mea_ap sd_ap Data represet the mea of each of 5 assessmets of ar permeablty. The stadard devato (sd_ap) s ot used ow, the respose, Y, s mea_ap. The stadard devato wll be used later for weghted least squares. SUMMARY OUTPUT Regresso Statstcs Multple R R Square Adjusted R Squar Stadard Error Observatos 30 All umbers o ths table are reproduced below. The Stadard Error the Regresso Statstcs porto s s = MSE ANOVA df SS MS F gfcace F Regresso E-0 Resdual Total Coeffcetsadard Erro t Stat P-value Lower 95%Upper 95% Itercept E warp weft mass

23 Scatterplot Matrx Note that the bottom row plots Y versus each of the varables. Ar permeablty teds to decrease as each predctor creases. We wll see later that the overall model s a good ft, whle dvdual coeffcets are ot sgfcat (due to the strog correlato betwee weft ad mass). The relatoshps betwee ar permeablty ad weft ad mass appear to be olear. Specal Types of Varables/Models p- dstct umerc predctors (attrbutes) Y = Sales, =Advertsg, =Prce Categorcal Predctors Idcator (Dummy) varables, represetg m- levels of a m level categorcal varable Y = Salary, =Experece, = f College Grad, 0 f Not Polyomal Terms Allow for beds the Regresso Y=MPG, =Speed, =Speed Trasformed Varables Trasformed Y varable to acheve learty Y =l(y) Y =/Y Iteracto Effects Effect of oe predctor depeds o levels of other predctors Y = Salary, =Experece, = f Coll Grad, 0 f Not, 3 = E{Y} =

24 No-College Grads ( =0): E{Y} = (0) + 3 (0)= 0 + College Grads ( =): E{Y} = () + 3 ()= ( 0 + )+( + 3 ) Respose Surface Models E{Y} = Note: Although the Respose Surface Model has polyomal terms, t s lear wth respect to the Regresso parameters Matrx Form of Multple Regresso Model Y...,..., 0 p, p Matrx Form: Y, p Y Y, p Y p, p 0 β ε E ε p p σ ε 0 0 I Y β ε E Y = E β + ε β σ Y I p p p p p p Note that smple lear regresso s the specal case where p- =.

25 Least Squares Estmato of Regresso Coeffcets Goal: Mmze: Q Y 0... p, p Obta Estmates of,,..., that mmze Q b, b,..., b Example: Factors Effectg Ar Permeablty of Wove Fabrcs ' 'Y INV(') b Note that the elemets of ad Y are: 0 p 0 p b0 b Normal Equatos: ' ' - b Y b ' 'Y pp p p p b p Maxmum Lkelhood also leads to the same estmator b : L Y β, exp 0... p, p / sce maxmzg L volves mmzg Y... 0 p, p 3 Y 3 Y ' 'Y 3 Y Y

26 Ftted Values ad Resduals Ftted Values: Y e Y Y Resduals: e Y e e p p - - Y b ' 'Y = HY H = ' ' H = H' = HH p p - ' e = Y Y Y b Y ' 'Y = I H Y I H I H I H I H MSE σ Y = σ HY = Hσ Y H' = σ H s Y H MSE σ e = σ I H Y = I H σ Y I H ' = σ I H s e I H Example: Factors Effectg Ar Permeablty of Wove Fabrcs Y-hat e e vs Y-hat e

27 Aalyss of Varace Sums of Squares Y Y Y Y Y Y Y Y Y Y b HY Y JY Y Y Y Y SSTO Y Y Y Y ' Y Y Y' I J Y SSE Y Y SSE Y Y ' Y Y Y' I H Y Y'Y - b''y MSE p SSR SSR Y Y Y Y ' Y Y Y' H J Y b''y Y' JY MSR p E MSE p p k kk k k ' kk ' kk ' k k k ' k E MSR SS SS SS k k k ' k' E MSR E MSE E MSR E MSE... 0 p Example: Factors Effectg Ar Permeablty of Wove Fabrcs Y Y'IY Y 39.3 Y'JY b 'Y b''y Y'HY SSTO Y' I J Y SSE Y' I H Y MSE SSR Y' H J Y MSR

28 ANOVA Table, F-test, ad R Aalyss of Varace (ANOVA) Table Source df Sum of Squares Mea Square Regresso p SSR SSR b''y - Y' JY MSR p Error p SSE Y'Y - b''y SSE MSE p Total SSTO Y'Y - Y' JY Test of H :... 0 E Y H : Not all 0 0 p 0 A k MSR Test Statstc: F* Rejecto Rego: F* F ; p, p P-value= PrF p, p F * MSE SSR SSE Coeffcet of Multple Determato: R Correlato: R R SSTO SSTO SSE p Adjusted-R SSE places a "pealty" o models wth extra predctors SSTO p SSTO Example: Factors Effectg Ar Permeablty of Wove Fabrcs H0 3 H A k : 0 : Not all TS : F* RR : F* F.95;3, P value: P F 3, R R Adjusted-R

29 Ifereces Regardg Regresso Parameters Y = β + ε E ε = 0 σ ε = I E Y = β σ Y = I E b = E ' 'Y = ' 'E Y = ' 'β = β p p p p b b, b b, b s b s b, b s b, b b, b b b, b s b, b s b s b, b σ b s b bp, b0 bp, b bp s bp, b s bp, b s bp σ b = σ ' 'Y ' 'σ Y ' ' ' ' ' ' ' MSE s b = ' bk k ~ t p 00% CI for b t ; p s b s b k - k k k bk Test of H0 : k 0 H A : k 0 Test Statstc: t* s b Rejecto Rego: t * t ; p P-value=Pr t p t * k Smultaeous 00% CI for : k ; g s s g p b t p sb k Example: Factors Effectg Ar Permeablty of Wove Fabrcs s b MSE ' 3.9 t.975, Test for : TS : t* ( ) % CI for : ( ) , Test for : TS : t* ( ) % CI for : ( ) , Test for 3: TS : t3* ( ) % CI for : ( ) , Note: Idvdually, o terms are sgfcat, but as a group they are. We wll uderstad why later.

30 Estmatg Mea Respose at Specfc -levels Gve set of levels of,..., :,..., ' ' ' ' h h h 00% CI for E h Y : Y h t ; p s h Y p h h, p β b h ' ' h EYh h Y h h p hp, E Y β Y σ b ' s Y MSE ' h h h h h h h Example: Factors Effectg Ar Permeablty of Wove Fabrcs Estmatg the mea at Warp= = 60,Weft= =35, Mass= 3 = % Cofdece Rego for Regresso Surface: Y hws Y h W pf ; p, p 00% CI for several ( g) E Y : Y Bs Y B t ; p g h h h ' h ' h ' Y h hb sy ' h h 3.9(.586) 4.88 ' 95% CI for β : (4.88) (4.5503,.55) h

31 Predctg New Respose(s) at Specfc -levels Gve set of levels of,..., :,..., pred MSE p h h, p β b h ' ' h EYh h Y h h p s hp, ' h - ' h mea of m observatos (at same -levels): s predmea MSE m 00% CI for Yh (ew) : Y h t ; p spred ' h - ' g Y Y h Ss S gf g p Scheffe: 00% CI for several ( ) : pred ;, h(ew) Boferro: 00% CI for several ( g) Yh (ew) : Y h Bspred B t ; p g Example: Factors Effectg Ar Permeablty of Wove Fabrcs Predctg a ew Ar Permeablty observato at Warp= = 60,Weft= =35, Mass= 3 = 5 h ' h ' h ' Y h hb s ' h pred 3.9( 0.586) % PI for Y : (7.0450) (.6, 7.889) h( ew) Presumably, ar permeablty measuremets caot be egatve, so we would terpret the predcto terval as beg (0, 7.889)

32 R Program for Chapter 6 Examples Ar Permeablty arperm <- read.csv("e:\\blue_drve\\sta40\\arperm_wove_reg.csv", header=true) attach(arperm) ames(arperm) Y <- mea_ap <- warp <- weft 3 <- mass <- legth(y) 0 <- rep(,) <- as.matrx(cbd(0,,,3)) # Form the -matrx (=30 rows, 4 Cols) Y <- as.matrx(y,col=) # Form the Y-vector (=30 rows, col) p <- col() # Notes: t() = traspose of, %*% = matrx multplcato, solve(a) = A(-) ( <- t() %*% ) (Y <- t() %*% Y) (I <- solve()) # Obta ' matrx (4 rows, 4 cols) # Obta 'Y vector (4 rows, col) # Obta (')(-) matrx (4 rows, 4 cols) (b <- I %*% Y) # Obta b-vector (4 rows, col) Y_hat <- %*% b e <- Y - Y_hat # Obta the vector of ftted values (=30 rows, col) # Obta the vector of resduals (=30 rows, col) prt(cbd(y_hat,e)) H <- %*% I %*% t() J_ <- matrx(rep(/,),col=) I_ <- dag() # Obta the Hat matrx # Obta the (/)J matrx (=30 rows, =30 cols) # Obta the detty matrx (=30 rows, =30 cols) (SSTO <- t(y) %*% (I_ - J_) %*% Y) # Obta Total Sum of Squares (SSTO) # SSTO ca also be computed as: # (SSTO <- (t(y) %*% Y) - (t(y) %*% (I_ - J_) %*% Y)) (SSE <- t(y) %*% (I_ - H) %*% Y) # Obta Error Sum of Squares (SSE) # SSE ca also be computed as: # (SSE <- (t(y) %*% Y) - (t(b) %*% Y)) (SSR <- t(y) %*% (H - J_) %*% Y) # Obta Regresso Sum of Squares (SSR) # SSR ca also be computed as: # (SSR <- (t(b) %*% Y) - (t(y) %*% J_ %*% Y)) (MSE <- SSE/(-p)) (s_b <- MSE[,] * I) multplcato se_b <- sqrt(dag(s_b)) # Obta MSE = s # Obta s{b}, must use MSE[,] ad * to do scalar # Obta SE's of dvdual regresso coeffcets Cotued Below

33 se_b <- sqrt(dag(s_b)) # Obta SE's of dvdual regresso coeffcets prt(cbd((b-qt(.975,-p)*se_b),(b+qt(.975,-p)*se_b))) # Prt CI's for Beta coeffcets (_h <- matrx(c(,60,35,5),col=)) =60,=35,3=5 # Create _h vector, for case where (Y_hat_h <- t(_h) %*% b) # Obta the ftted value whe budget=0 (s_yhat_h <- t(_h) %*% s_b %*% _h) # Obta s{y_hat_h} (s_pred <- MSE + (t(_h) %*% s_b %*% _h)) # Obta s{pred} ### Prt 95% CI for Mea at _h ad 95% PI for Idvdual Observato prt(cbd((y_hat_h-qt(.975,-p)*sqrt(s_yhat_h)),(y_hat_h+qt(.975,-p)*sqrt(s_yhat_h)))) prt(cbd((y_hat_h-qt(.975,-p)*sqrt(s_pred)),(y_hat_h+qt(.975,-p)*sqrt(s_pred)))) R Output > ( <- t() %*% ) # Obta ' matrx (4 rows, 4 cols) > > (Y <- t() %*% Y) # Obta 'Y vector (4 rows, col) [,] > > (I <- solve()) # Obta (')(-) matrx (4 rows, 4 cols) > > (b <- I %*% Y) # Obta b-vector (4 rows, col) [,] > (SSTO <- t(y) %*% (I_ - J_) %*% Y) # Obta Total Sum of Squares (SSTO) [,] [,] > > (SSE <- t(y) %*% (I_ - H) %*% Y) # Obta Error Sum of Squares (SSE) [,] [,] > > (SSR <- t(y) %*% (H - J_) %*% Y) # Obta Regresso Sum of Squares (SSR) [,] [,] Cotued Below

34 > (MSE <- SSE/(-p)) # Obta MSE = s [,] [,] 3.98 > > (s_b <- MSE[,] * I) # Obta s{b}, must use MSE[,] ad * to do scalar multplcato > > se_b <- sqrt(dag(s_b)) # Obta SE's of dvdual regresso coeffcets > > prt(cbd((b-qt(.975,-p)*se_b),(b+qt(.975,-p)*se_b))) # Prt CI's for Beta coeffcets [,] [,] > > (_h <- matrx(c(,60,35,5),col=)) # Create _h vector, for case where =60,=35,3=5 [,] [,] [,] 60 [3,] 35 [4,] 5 > > (Y_hat_h <- t(_h) %*% b) # Obta the ftted value whe budget=0 [,] [,] > > (s_yhat_h <- t(_h) %*% s_b %*% _h) # Obta s{y_hat_h} [,] [,] > > (s_pred <- MSE + (t(_h) %*% s_b %*% _h)) # Obta s{pred} [,] [,] > > ### Prt 95% CI for Mea at _h ad 95% PI for Idvdual Observato > prt(cbd((y_hat_h-qt(.975,-p)*sqrt(s_yhat_h)),(y_hat_h+qt(.975,p)*sqrt(s_yhat_h)))) [,] [,] [,] > prt(cbd((y_hat_h-qt(.975,-p)*sqrt(s_pred)),(y_hat_h+qt(.975,-p)*sqrt(s_pred)))) [,] [,] [,] > Ay dffereces betwee these output values ad those wth the chapter are due to the fact that I used 5 decmal places o calculatos.

35 Chapter 7 Multple Regresso II Extra Sums of Squares For a gve dataset, the total sum of squares remas the same, o matter what predctors are cluded (whe o mssg values exst amog varables) As we clude more predctors, the regresso sum of squares (SSR) creases (techcally does ot decrease), ad the error sum of squares (SSE) decreases SSR + SSE = SSTO, regardless of predctors model Whe a model cotas just, deote: SSR( ), SSE( ) Model Cotag, : SSR(, ), SSE(, ) Predctve cotrbuto of above that of : SSR( ) = SSE( ) SSE(, ) = SSR(, ) SSR( ) Exteds to ay umber of Predctors Deftos ad Decomposto of SSR,,,,,, SSTO SSR SSE SSR SSE SSR SSE 3 3,,,, SSR SSR SSR SSE SSE SSR SSR SSR SSE SSE 3,,, 3,,,, 3, SR,, SSR SSE SSE,, SSR SSR SSR SSE SSE SSR S 3 3 3, SSR SSR SSR SSR SSR,, 3 3,,, 3 3,,,, SSR SSR SSR SSR SSR SSR SSR SSR SSR SSR SSR 3 3

36 Example: Factors Effectg Ar Permeablty of Wove Fabrcs The followg partal ANOVA tables are for all 7 possble models cotag at least oe of the 3 predctors. Predctors SSR SSE dfr dfe , , , ,, ,,,, 3,, 3, , SSTO SSR SSE SSR SSE SSR SSE SSR SSE SSR, SSE, SSR SSR SSR SSR SSR SSR SSR, SSR,, SSR, SSR, SSR,, SSR , ,,, SSR SSR SSR SSR SSR SSR SSR SSR SSR SSR,, SSR SSR SSR, SSR,, SSR SSR SSR, SSR SSR SSR Note that as the # of predctors creases, so does the ways of decomposg SSR

37 ANOVA Sequetal Sum of Squares Ths s a parttog of the Regresso sum of squares the full model, to ts sequetal sums of squares for the varables the order of ther appearace the regresso program. For the case of 3 predctors, etered the order:,, 3 : Source of Varato SS df MS Regresso SSR(,,3) 3 MSR(,,3) SSR() MSR() SSR( ) MSR( ) 3, SSR(3,) MSR(3,) Error SSE(,,3) -4 MSE(,,3) Total SSTO - SSR SSR MSR MSR SSR 3, MSR 3, SSR,, 3 MSR,, 3 3 SSR, 3 MSR, 3 Example: Factors Effectg Ar Permeablty of Wove Fabrcs Source of Varato SS df MS Regresso , Error Total Note: =

38 Extra Sums of Squares & Tests of Regresso Coeffcets (Sgle k ) Full Model: Y ~ NID 0, H : 0 H : 0 Reduced Model: Y 0 3 A 3 0 Geeral Lear Test: F* SSE( R) SSE( F) dfr df f SSE( F) df f SSE F SSE 3 dff 4 SSE R SSE dfr Full Model: ( ),, Reduced Model: ( ), 3 SSE( R) SSE( F) SSE, SSE,, SSR, df df R F SSR 3, MSR 0 3, H F* ~ F, 4 SSE,, 3 MSE,, 3 4 Rejecto Rego: F* F ;, 4 P value: P F, 4 F * Example: Factors Effectg Ar Permeablty of Wove Fabrcs H0 : 3 0 H A : MSR 3, 9.5 MSE,, F* F.95;, P value PF, Ths F-test gves the exact same result as the t-test from Chapter 6. t * F * t.975, 4 F.95;, 4

39 Extra Sums of Squares & Tests of Regresso Coeffcets (Multple k ) Full Model: Y ~ NID 0, H : 0 H : ad/or 0 Reduced Model: Y 0 3 A 3 0 Geeral Lear Test: F* SSE( R) SSE( F) dfr df f SSE( F) df f Full Model: SSE( F) SSE,, 3 dff 4 SSE R SSE dfr Reduced Model: ( ) SSE( R) SSE( F) SSE SSE,, SSR, df df R F Example: Factors Effectg Ar Permeablty of Wove Fabrcs SSR, 3 MSR, F F SSE,, 3 MSE,, 3 4 H0 3 * ~, 4 Rejecto Rego: F* F ;, 4 P value: P F, 4 F * H0 : 3 0 H A : ad/or MSR, MSE,, F* 6.65 F.95;, P value PF, Note that the dvdual t-tests for Wear ( ) ad Mass ( 3 ) were ot sgfcat, but whe we test them smultaeously, they are hghly sgfcat. Ths s due to the fact that they are hghly correlated, ad both related to Ar Permeablty (Y). We wll look at ths more detal the secto o Multcollearty.

40 Extra Sums of Squares & Tests of Regresso Coeffcets (Geeral Case) Full Model: Y... ~ NID 0, H 0 p, p :... 0 H : At least oe of q p A q p Reduced Model: Y... q p 0 q, q SSE( R) SSE( F) dfr df F Geeral Lear Test: F* SSE( F) df F p F q R q p q p q Full Model: SSE( F) SSE,..., df p Reduced Model: SSE( R) SSE,..., df q SSE( R) SSE( F) SSE,..., SSE,..., SSR,...,,..., df df q p p q R F SSR q,..., p,..., q p q MSR,..., 0,..., H q p q F* ~ F p q, p SSE,..., MSE,..., p p p Rejecto Rego: F* F ; p q, p P-value P F p q; p F * Sce there are oly three predctors the Ar Permeablty model, we wll ot do ths as a example. Other Lear Tests Suppose frm has two types of advertsg: prt, $000s ad teret, $000s as well as promotoal expedtures, $000s : 3 Let Sales = Y, they vary ther expedtures o perods ad observe sales each (Prce s costat) Y ~ NID 0, Test of equal effects of creasg each put by ut (say $000s): H : H : H s False 0 3 A 0 Full Model: Y 0 df F Reduced Model: Y Y Y W W df 0 3 R

41 Suppose frm has two types of advertsg: prt, $000s ad teret, $000s as well as promotoal expedtures, $000s : 3 Let Sales = Y, they vary ther expedtures o perods ad observe sales each (Prce s costat) Y ~ NID 0, Test that Mea sales whe all puts=0 s $0,000 ad effect of creasg by ut s : H : 0, H : H s False A F R (all uts are $000s) Full Model: Y df 4 Reduced Model: Y 0 Y 0 U U Y 0 df ( o tercept) 3 Coeffcets of Partal Determato-I Proporto of Varato Explaed by or more varables, ot explaed by others Regresso of Y o : Y 0 Uexplaed: Varato Explaed: SSR SSE SSTO SSR Regresso of Y o : Y 0 Uexplaed: Varato Explaed: SSR SSE SSTO SSR Regresso of Y o, : Y 0 Varato Explaed: SSR, Uexplaed: SSE, SSTO SSR, Proporto of Varato Y, Not Explaed by, that s Explaed by : R Y SSE SSE, SSR, SSR SSR, SSR SSR SSE SSE SSTO SSR SSE Proporto of Varato Y, Not Explaed by, that s Explaed by : R Y SSE SSE, SSR, SSR SSR, SSR SSR SSE SSE SSTO SSR SSE

42 Coeffcets of Partal Determato-II R R R Y 3 Y 3 Y 3 SSR,, 3 SSE, SSE,, SSR,, SSR, SSE, SSE, 3 3 SSR,, SSR, SSR, SSTO SSR, SSE, R SSR,, SSR, SSR, SSTO SSR, SSE, SSE 3 3 SSR, SSR, SSTO SSR, SSE, 3 SSE SSE SSE,, SSR,, SSR 3 3 Y 3 SSR,, SSR SSR, SSTO SSR SSE 3 3 Coeffcet of Partal Correlato: R sg R sg Y Y f 0 Y 0 f 0 Y 0 Example: Factors Effectg Ar Permeablty of Wove Fabrcs,, SSR SSE SSR, SSE, 843. SSR SSR SSE RY SSR 3, SSE, 843. RY SSR, SSE R Y

43 Stadardzed Regresso Model Useful removg roud-off errors computg ( ) - Makes easer comparso of magtude of effects of predctors measured o dfferet measuremet scales Coeffcets represet chages Y ( stadard devato uts) as each predctor creases SD (holdg all others costat) Sce all varables are cetered, o tercept term Stadardzed Radom Varables: Scaled to have mea=0, SD= Y Y k k Y Y k k sy sk k,..., p s s Y Correlato Trasformato: * Y Y * k k Y k k,..., p sy sk Stadardzed Regresso Model: Y... * * * * * * p, p s Y * Note: k k k,..., p 0 Y... p p sk k Stadardzed Regresso Model: Y... * * * * * * p, p * * * Y r r, p ry, p * r r Y, p r * * *' * ( p) Y *' * Y r Y r ( p) ( p) ( p) * *, p * Y r p, rp, ry, p Ths results from: k k * k k k s k sk s k s k * * k k ' k k k ' k' k k ', k ' k s k k' s r s k ' sksk ' s ks k ' k * * Y Y k k sy, Y Y k k k Y r s s s s sy s k Yk Y k Y k k Y kk '

44 Stadardzed Regresso Model: Y... * * * * * * p, p * * * Y r r, p ry, p * Y r r, p r * * *' * Y *' * Y r Y r ( p) rp, rp, ry, p ( p) ( p) ( p) * *, p * Y Y *' * * *' * * *' * *' * * b Y b Y b rry ( p) ( p) ( p) ( p) b s b k,..., p b Y b... b Y * k k 0 p p sk Example: Factors Effectg Ar Permeablty of Wove Fabrcs warp weft mass arperm warp* weft* mass* arperm*

45 *'* *'Y* s_y b s_ b s_ b s_ b ybar 3.04 INV(*'*) b* xbar xbar xbar Note that the correlato betwee Weft ad Mass s That leads us to Multcollearty. Multcollearty Cosder model wth Predctors (ths geeralzes to ay umber of predctors) Y = Whe ad are ucorrelated, the regresso coeffcets b ad b are the same whether we ft smple regressos or a multple regresso, ad: SSR( ) = SSR( ) SSR( ) = SSR( ) Whe ad are hghly correlated, ther regresso coeffcets become ustable, ad ther stadard errors become larger (smaller t-statstcs, wder CI s ), leadg to strage fereces whe comparg smple ad partal effects of each predctor Estmated meas ad Predcted values are ot affected Example: Factors Effectg Ar Permeablty of Wove Fabrcs Warp, Weft Warp, Mass Coeffcetsadard Erro t Stat P-value Coeffcetsadard Erro t Stat P-value Itercept Itercept warp warp weft mass Weft, Mass Warp, Weft, Mass Coeffcetsadard Erro t Stat P-value Coeffcetsadard Erro t Stat P-value Itercept Itercept weft warp mass weft mass Compare the stadard errors of the Weft coeffcet: chagg from 0.33 to depedg o whether Mass s the model (a 6-fold crease whe Mass s cluded). Smlarly, stadard error for the Mass coeffcet chages from wthout Weft to wth Weft.

46 R Program for Chapter 7 Examples Ar Permeablty arperm <- read.csv("e:\\blue_drve\\sta40\\arperm_wove_reg.csv", header=true) attach(arperm) ames(arperm) plot(arperm[,:5]) ### Scatterplot Matrx of,,3,y ssto <- sum((mea_ap-mea(mea_ap))) ### Total Sum of Squares ########## Ft all 7 possble Models ap.mod3 <- lm(mea_ap ~ warp + weft + mass) summary(ap.mod3) aova(ap.mod3) ap.mod <- lm(mea_ap ~ warp + weft) #summary(ap.mod) #aova(ap.mod) ap.mod3 <- lm(mea_ap ~ warp + mass) #summary(ap.mod3) #aova(ap.mod3) ap.mod3 <- lm(mea_ap ~ weft + mass) #summary(ap.mod3) #aova(ap.mod3) ap.mod <- lm(mea_ap ~ warp) #summary(ap.mod) #aova(ap.mod) ap.mod <- lm(mea_ap ~ weft) #summary(ap.mod) #aova(ap.mod) ap.mod3 <- lm(mea_ap ~ mass) #summary(ap.mod3) #aova(ap.mod3) ####### Obta SSE ad SSR for each model (devace=sse) sse.x <- devace(ap.mod); ssr.x <- ssto-sse.x sse.x <- devace(ap.mod); ssr.x <- ssto-sse.x sse.x3 <- devace(ap.mod3); ssr.x3 <- ssto-sse.x3 sse.xx <- devace(ap.mod); ssr.xx <- ssto-sse.xx sse.xx3 <- devace(ap.mod3); ssr.xx3 <- ssto-sse.xx3 sse.xx3 <- devace(ap.mod3); ssr.xx3 <- ssto-sse.xx3 sse.xxx3 <- devace(ap.mod3); ssr.xxx3 <- ssto-sse.xxx3 #### Compute Sequetal Sums of Squares ssr.xx-ssr.x ### SSR( ) ssr.xx-ssr.x ### SSR( ) ssr.xxx3-ssr.xx ### SSR(3,) #### Test H0: B=B3=0 aova(ap.mod,ap.mod3) ### Compue Coeffcets of Partal Determato (ssr.xx-ssr.x)/sse.x ### R(Y ) (ssr.xxx3-ssr.xx)/sse.xx ### R(Y3 ) Cotued Below

47 #### Correlato Trasformato ad Stadardzed Regresso Coeffcets y.corr <- (mea_ap-mea(mea_ap))/(sqrt(9)*sd(mea_ap)) x.corr <- (warp-mea(warp))/(sqrt(9)*sd(warp)) x.corr <- (weft-mea(weft))/(sqrt(9)*sd(weft)) x3.corr <- (mass-mea(mass))/(sqrt(9)*sd(mass)) xstar <- matrx(cbd(x.corr,x.corr,x3.corr),col=3) ystar <- matrx(y.corr) bstar <- solve(t(xstar) %*% xstar) %*% t(xstar) %*% ystar bstar ##### Regresso coeffcet estmates for all ad 3 varable models summary(ap.mod) summary(ap.mod3) summary(ap.mod3) summary(ap.mod3) R Output > ap.mod3 <- lm(mea_ap ~ warp + weft + mass) > summary(ap.mod3) Call: lm(formula = mea_ap ~ warp + weft + mass) Resduals: M Q Meda 3Q Max Coeffcets: Estmate Std. Error t value Pr(> t ) (Itercept) e-07 *** warp weft mass Resdual stadard error: o 6 degrees of freedom Multple R-squared: , Adjusted R-squared: 0.8 F-statstc: o 3 ad 6 DF, p-value:.678e-0 > aova(ap.mod3) Aalyss of Varace Table Respose: mea_ap Df Sum Sq Mea Sq F value Pr(>F) warp ** weft e- *** mass Resduals Cotued Below

48 > ssr.xx-ssr.x ### SSR( ) [] > ssr.xx-ssr.x ### SSR( ) [] > ssr.xxx3-ssr.xx ### SSR(3,) [] > > aova(ap.mod,ap.mod3) Aalyss of Varace Table Model : mea_ap ~ warp Model : mea_ap ~ warp + weft + mass Res.Df RSS Df Sum of Sq F Pr(>F) e-0 *** > (ssr.xx-ssr.x)/sse.x ### R(Y ) [] > > (ssr.xxx3-ssr.xx)/sse.xx ### R(Y3 ) [] > bstar <- solve(t(xstar) %*% xstar) %*% t(xstar) %*% ystar > bstar [,] [,] [,] [3,] > summary(ap.mod) lm(formula = mea_ap ~ warp + weft) Coeffcets: Estmate Std. Error t value Pr(> t ) (Itercept) e-08 *** warp *** weft e- *** > summary(ap.mod3) lm(formula = mea_ap ~ warp + mass) Coeffcets: Estmate Std. Error t value Pr(> t ) (Itercept) e-07 *** warp mass e- *** > summary(ap.mod3) lm(formula = mea_ap ~ weft + mass) Coeffcets: Estmate Std. Error t value Pr(> t ) (Itercept) e-09 *** weft mass *** > summary(ap.mod3) lm(formula = mea_ap ~ warp + weft + mass) Coeffcets: Estmate Std. Error t value Pr(> t ) (Itercept) e-07 *** warp weft mass

49 Chapter 8 Models for Quattatve ad Qualtatve Predctors Polyomal Regresso Models Useful Settgs: True relato betwee respose ad predctor s polyomal True relato s complex olear fucto that ca be approxmated by polyomal specfc rage of -levels Models wth Predctor: Icludg p polyomal terms model, creates p- beds d order Model: E{Y} = 0 + x + x (x = cetered ) 3 rd order Model: E{Y} = 0 + x + x + 3 x 3 Respose Surfaces wth (or more) predctors d order model wth Predctors: E Y x x x x x x x x 0

50

51 % RED Modelg Strateges Use Extra Sums of Squares ad Geeral Lear Tests to compare models of creasg complexty (hgher order) Use codg fttg models (cetered/scaled) predctors to reduce multcollearty whe coductg testg. Keep lower order terms wheever hgher order polyomals ad teractos are cluded a model, eve f ot sgfcat. Ft models orgal uts, or back-trasform for plottg o orgal scale * (see below for quadratc) For Respose Surfaces, clude multple replcates at ceter pot for goodess-of-ft tests Cetered varables: 0 0 Y b b x b x b b b ' ' ' 0 0 o b b b b b b b b b b b b b b b Example: Relatoshp Betwee We Color (% Red) ad Athocya Glucosdes (GLU) A study related varous types of color parameters ad pheolc compouds three varetes of we (Temprallo, Gracao, ad Caberet Sauvgo) over a 6 moth storage perod. The followg plot s of the percet red color (Y) versus Athocya Glucosdes (). Source: M. Moagas, P. J. Martı-Alvarez,, B. Bartolome C. Gomez-Cordoves (006). Statstcal terpretato of the color parameters of red wes fucto of ther pheolc composto durg agg bottle, Europea Food Research Techology, Vol., pp %Red versus GLU GLU GLU GLUC GLUC %Red GLU GLUC ad GLUC are the cetered, ad squared cetered values of GLU Fttg the Regresso Model: Y 0 x x ~ NID 0, x

52 % RED Coeffcetsadard Erro t Stat P-value Lower 95%Upper 95% Itercept E GLUC GLUC E E-05 Note that all coeffcets are sgfcat. Also, the tercept represets the ftted value at x=0, or equvaletly, the ftted value at the mea GLU level. The ftted equato, ad back-trasformed coeffcets are: Y x x b ' 0 ' ' (8.77) ( )(8.77) b ( )(8.77) b Y Below s the model ft wth the u-cetered (orgal) GLU values (dffereces are due to roudg): Coeffcetsadard Erro t Stat P-value Lower 95%Upper 95% Itercept E GLU GLU E E %Red versus GLU GLU

53 Regresso Models wth Iteracto Term(s) Iteracto Effect (Slope) of oe predctor varable depeds o the level other predctor varable(s) Formulated by cludg cross-product term(s) amog predctor varables Varable Models: E{Y} = E Y 0 (0) E Y 0 (0) Testg Hypothess of o teracto: H : 0 H : A 3

54 Example Respose Surface Relatg 3 Factors to Color Itesty Idgo Dye Appled to Cotto Source: M.B. Tcha, N. Meks, N. Drr, M. Kechda, ad M.F. Mhe (03). A promsg route to dye cotto by dgo wth a ecologcal exhausto process: A dyeg process optmzato based o a respose surface methodology, Idustral Crops ad Products, Vol. 46, pp A expermet was coducted relatg = Temperature (Celsus, Levels=35,60,00), = Tme (Mutes, Levels=30,60,90,0), ad 3 = Catozg Aget (Percetage, Levels=0,4,0,5,0) to Y = Color Yeld (K/S rato). The expermet was made up of = 60 rus. To obta the same results as the authors, we wll use the orgal data levels, ot cetered or scaled levels. The secod order respose surface s of the form: E Y ECEL Output: Regresso Statstcs Multple R R Square Adjusted R Square Stadard Error 0.66 Observatos 60 ANOVA df SS MS F gfcace F Regresso Resdual Total Coeffcetsadard Erro t Stat P-value Lower 95%Upper 95% Itercept Temp Tme Cato Temp Tme E E-05 Cato TempTme E E-05 TempCat E Note that all regresso coeffcets are sgfcat, mplyg a very complex surface four dmesos. To observe the surface, we wll use the rsm package R.

55 R Program dye <- read.csv("e:\\blue_drve\\sta40\\dye_cotto_rsm.csv", header=true) attach(dye); ames(dye) stall.packages("rsm") lbrary(rsm) dye.rsm <- rsm(ks ~ SO(Temp,Tme,Cato)) summary(dye.rsm) drop(dye.rsm) cotour(dye.rsm, ~ Temp + Tme, mage=true) cotour(dye.rsm, ~ Temp + Cato, mage=true) cotour(dye.rsm, ~ Tme + Cato, mage=true) R Text Output > dye.rsm <- rsm(ks ~ SO(Temp,Tme,Cato)) > summary(dye.rsm) Call: rsm(formula = KS ~ SO(Temp, Tme, Cato)) Estmate Std. Error t value Pr(> t ) (Itercept) e e <.e-6 *** Temp e-0.668e <.e-6 *** Tme e e *** Cato 4.099e e e-09 *** Temp:Tme -.806e e * Temp:Cato 8.976e e * Tme:Cato e e Temp e e <.e-6 *** Tme -.36e e * Cato e e e- ** Multple R-squared: , Adjusted R-squared: F-statstc: o 9 ad 50 DF, p-value: <.e-6 Aalyss of Varace Table Respose: KS Df Sum Sq Mea Sq F value Pr(>F) FO(Temp, Tme, Cato) < e-6 TWI(Temp, Tme, Cato) PQ(Temp, Tme, Cato) < e-6 Resduals Lack of ft Pure error Statoary pot of respose surface: Temp Tme Cato > drop(dye.rsm) Df Sum of Sq RSS AIC <oe> FO(Temp, Tme, Cato) TWI(Temp, Tme, Cato) PQ(Temp, Tme, Cato) Note that the frst ANOVA table gves the sequetal sums of squares, the secod oe (drop) gves the partal sums of squares, each group gve all the others. I ths case, sequetal makes more sese due to the herarchy wth ma effects (FO = Frst order terms tested frst). Hgher order terms are (TWI = Two-Way Iteractos ad PQ = Polyomal Quadratc). Statoary pot gves the best levels for each varable to maxmze Y.

56 Cotour Plots for all Pars of Varables (at Best Level of Thrd Varable):

57 Data (Splt to 3 Groups of Colums for Readablty) Temp Tme Cato KS Temp Tme Cato KS Temp Tme Cato KS Qualtatve Predctors Ofte, we wsh to clude categorcal varables as predctors (e.g. geder, rego of coutry, ) Trck: Create dummy (dcator) varable(s) to represet effects of levels of the categorcal varables o respose Problem: If varable has c categores, ad we create c dummy varables, the model s ot full rak whe we clude tercept Soluto: Create c dummy varables, leavg oe level as the cotrol/basele/referece category Iteractos ca be geerated betwee qualtatve ad quattatve predctors May models wll cota multple qualtatve predctors.

Introduction to Matrices and Matrix Approach to Simple Linear Regression

Introduction to Matrices and Matrix Approach to Simple Linear Regression Itroducto to Matrces ad Matrx Approach to Smple Lear Regresso Matrces Defto: A matrx s a rectagular array of umbers or symbolc elemets I may applcatos, the rows of a matrx wll represet dvduals cases (people,

More information

Simple Linear Regression

Simple Linear Regression Statstcal Methods I (EST 75) Page 139 Smple Lear Regresso Smple regresso applcatos are used to ft a model descrbg a lear relatoshp betwee two varables. The aspects of least squares regresso ad correlato

More information

Objectives of Multiple Regression

Objectives of Multiple Regression Obectves of Multple Regresso Establsh the lear equato that best predcts values of a depedet varable Y usg more tha oe eplaator varable from a large set of potetal predctors {,,... k }. Fd that subset of

More information

STA302/1001-Fall 2008 Midterm Test October 21, 2008

STA302/1001-Fall 2008 Midterm Test October 21, 2008 STA3/-Fall 8 Mdterm Test October, 8 Last Name: Frst Name: Studet Number: Erolled (Crcle oe) STA3 STA INSTRUCTIONS Tme allowed: hour 45 mutes Ads allowed: A o-programmable calculator A table of values from

More information

Example: Multiple linear regression. Least squares regression. Repetition: Simple linear regression. Tron Anders Moger

Example: Multiple linear regression. Least squares regression. Repetition: Simple linear regression. Tron Anders Moger Example: Multple lear regresso 5000,00 4000,00 Tro Aders Moger 0.0.007 brthweght 3000,00 000,00 000,00 0,00 50,00 00,00 50,00 00,00 50,00 weght pouds Repetto: Smple lear regresso We defe a model Y = β0

More information

12.2 Estimating Model parameters Assumptions: ox and y are related according to the simple linear regression model

12.2 Estimating Model parameters Assumptions: ox and y are related according to the simple linear regression model 1. Estmatg Model parameters Assumptos: ox ad y are related accordg to the smple lear regresso model (The lear regresso model s the model that says that x ad y are related a lear fasho, but the observed

More information

Lecture 8: Linear Regression

Lecture 8: Linear Regression Lecture 8: Lear egresso May 4, GENOME 56, Sprg Goals Develop basc cocepts of lear regresso from a probablstc framework Estmatg parameters ad hypothess testg wth lear models Lear regresso Su I Lee, CSE

More information

Chapter 14 Logistic Regression Models

Chapter 14 Logistic Regression Models Chapter 4 Logstc Regresso Models I the lear regresso model X β + ε, there are two types of varables explaatory varables X, X,, X k ad study varable y These varables ca be measured o a cotuous scale as

More information

Multiple Regression. More than 2 variables! Grade on Final. Multiple Regression 11/21/2012. Exam 2 Grades. Exam 2 Re-grades

Multiple Regression. More than 2 variables! Grade on Final. Multiple Regression 11/21/2012. Exam 2 Grades. Exam 2 Re-grades STAT 101 Dr. Kar Lock Morga 11/20/12 Exam 2 Grades Multple Regresso SECTIONS 9.2, 10.1, 10.2 Multple explaatory varables (10.1) Parttog varablty R 2, ANOVA (9.2) Codtos resdual plot (10.2) Trasformatos

More information

ENGI 3423 Simple Linear Regression Page 12-01

ENGI 3423 Simple Linear Regression Page 12-01 ENGI 343 mple Lear Regresso Page - mple Lear Regresso ometmes a expermet s set up where the expermeter has cotrol over the values of oe or more varables X ad measures the resultg values of aother varable

More information

Multiple Linear Regression Analysis

Multiple Linear Regression Analysis LINEA EGESSION ANALYSIS MODULE III Lecture - 4 Multple Lear egresso Aalyss Dr. Shalabh Departmet of Mathematcs ad Statstcs Ida Isttute of Techology Kapur Cofdece terval estmato The cofdece tervals multple

More information

Simple Linear Regression - Scalar Form

Simple Linear Regression - Scalar Form Smple Lear Regresso - Scalar Form Q.. Model Y X,..., p..a. Derve the ormal equatos that mmze Q. p..b. Solve for the ordary least squares estmators, p..c. Derve E, V, E, V, COV, p..d. Derve the mea ad varace

More information

Chapter 13 Student Lecture Notes 13-1

Chapter 13 Student Lecture Notes 13-1 Chapter 3 Studet Lecture Notes 3- Basc Busess Statstcs (9 th Edto) Chapter 3 Smple Lear Regresso 4 Pretce-Hall, Ic. Chap 3- Chapter Topcs Types of Regresso Models Determg the Smple Lear Regresso Equato

More information

Statistics MINITAB - Lab 5

Statistics MINITAB - Lab 5 Statstcs 10010 MINITAB - Lab 5 PART I: The Correlato Coeffcet Qute ofte statstcs we are preseted wth data that suggests that a lear relatoshp exsts betwee two varables. For example the plot below s of

More information

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions.

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions. Ordary Least Squares egresso. Smple egresso. Algebra ad Assumptos. I ths part of the course we are gog to study a techque for aalysg the lear relatoshp betwee two varables Y ad X. We have pars of observatos

More information

Simple Linear Regression

Simple Linear Regression Correlato ad Smple Lear Regresso Berl Che Departmet of Computer Scece & Iformato Egeerg Natoal Tawa Normal Uversty Referece:. W. Navd. Statstcs for Egeerg ad Scetsts. Chapter 7 (7.-7.3) & Teachg Materal

More information

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model Lecture 7. Cofdece Itervals ad Hypothess Tests the Smple CLR Model I lecture 6 we troduced the Classcal Lear Regresso (CLR) model that s the radom expermet of whch the data Y,,, K, are the outcomes. The

More information

Probability and. Lecture 13: and Correlation

Probability and. Lecture 13: and Correlation 933 Probablty ad Statstcs for Software ad Kowledge Egeers Lecture 3: Smple Lear Regresso ad Correlato Mocha Soptkamo, Ph.D. Outle The Smple Lear Regresso Model (.) Fttg the Regresso Le (.) The Aalyss of

More information

Chapter Business Statistics: A First Course Fifth Edition. Learning Objectives. Correlation vs. Regression. In this chapter, you learn:

Chapter Business Statistics: A First Course Fifth Edition. Learning Objectives. Correlation vs. Regression. In this chapter, you learn: Chapter 3 3- Busess Statstcs: A Frst Course Ffth Edto Chapter 2 Correlato ad Smple Lear Regresso Busess Statstcs: A Frst Course, 5e 29 Pretce-Hall, Ic. Chap 2- Learg Objectves I ths chapter, you lear:

More information

Statistics: Unlocking the Power of Data Lock 5

Statistics: Unlocking the Power of Data Lock 5 STAT 0 Dr. Kar Lock Morga Exam 2 Grades: I- Class Multple Regresso SECTIONS 9.2, 0., 0.2 Multple explaatory varables (0.) Parttog varablty R 2, ANOVA (9.2) Codtos resdual plot (0.2) Exam 2 Re- grades Re-

More information

Econometric Methods. Review of Estimation

Econometric Methods. Review of Estimation Ecoometrc Methods Revew of Estmato Estmatg the populato mea Radom samplg Pot ad terval estmators Lear estmators Ubased estmators Lear Ubased Estmators (LUEs) Effcecy (mmum varace) ad Best Lear Ubased Estmators

More information

Simple Linear Regression and Correlation.

Simple Linear Regression and Correlation. Smple Lear Regresso ad Correlato. Correspods to Chapter 0 Tamhae ad Dulop Sldes prepared b Elzabeth Newto (MIT) wth some sldes b Jacquele Telford (Johs Hopks Uverst) Smple lear regresso aalss estmates

More information

Summary of the lecture in Biostatistics

Summary of the lecture in Biostatistics Summary of the lecture Bostatstcs Probablty Desty Fucto For a cotuos radom varable, a probablty desty fucto s a fucto such that: 0 dx a b) b a dx A probablty desty fucto provdes a smple descrpto of the

More information

Lecture Notes 2. The ability to manipulate matrices is critical in economics.

Lecture Notes 2. The ability to manipulate matrices is critical in economics. Lecture Notes. Revew of Matrces he ablt to mapulate matrces s crtcal ecoomcs.. Matr a rectagular arra of umbers, parameters, or varables placed rows ad colums. Matrces are assocated wth lear equatos. lemets

More information

ECON 482 / WH Hong The Simple Regression Model 1. Definition of the Simple Regression Model

ECON 482 / WH Hong The Simple Regression Model 1. Definition of the Simple Regression Model ECON 48 / WH Hog The Smple Regresso Model. Defto of the Smple Regresso Model Smple Regresso Model Expla varable y terms of varable x y = β + β x+ u y : depedet varable, explaed varable, respose varable,

More information

Functions of Random Variables

Functions of Random Variables Fuctos of Radom Varables Chapter Fve Fuctos of Radom Varables 5. Itroducto A geeral egeerg aalyss model s show Fg. 5.. The model output (respose) cotas the performaces of a system or product, such as weght,

More information

4. Standard Regression Model and Spatial Dependence Tests

4. Standard Regression Model and Spatial Dependence Tests 4. Stadard Regresso Model ad Spatal Depedece Tests Stadard regresso aalss fals the presece of spatal effects. I case of spatal depedeces ad/or spatal heterogeet a stadard regresso model wll be msspecfed.

More information

ESS Line Fitting

ESS Line Fitting ESS 5 014 17. Le Fttg A very commo problem data aalyss s lookg for relatoshpetwee dfferet parameters ad fttg les or surfaces to data. The smplest example s fttg a straght le ad we wll dscuss that here

More information

Multivariate Transformation of Variables and Maximum Likelihood Estimation

Multivariate Transformation of Variables and Maximum Likelihood Estimation Marquette Uversty Multvarate Trasformato of Varables ad Maxmum Lkelhood Estmato Dael B. Rowe, Ph.D. Assocate Professor Departmet of Mathematcs, Statstcs, ad Computer Scece Copyrght 03 by Marquette Uversty

More information

Lecture 3 Probability review (cont d)

Lecture 3 Probability review (cont d) STATS 00: Itroducto to Statstcal Iferece Autum 06 Lecture 3 Probablty revew (cot d) 3. Jot dstrbutos If radom varables X,..., X k are depedet, the ther dstrbuto may be specfed by specfyg the dvdual dstrbuto

More information

Regresso What s a Model? 1. Ofte Descrbe Relatoshp betwee Varables 2. Types - Determstc Models (o radomess) - Probablstc Models (wth radomess) EPI 809/Sprg 2008 9 Determstc Models 1. Hypothesze

More information

STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS. x, where. = y - ˆ " 1

STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS. x, where. = y - ˆ  1 STATISTICAL PROPERTIES OF LEAST SQUARES ESTIMATORS Recall Assumpto E(Y x) η 0 + η x (lear codtoal mea fucto) Data (x, y ), (x 2, y 2 ),, (x, y ) Least squares estmator ˆ E (Y x) ˆ " 0 + ˆ " x, where ˆ

More information

ε. Therefore, the estimate

ε. Therefore, the estimate Suggested Aswers, Problem Set 3 ECON 333 Da Hugerma. Ths s ot a very good dea. We kow from the secod FOC problem b) that ( ) SSE / = y x x = ( ) Whch ca be reduced to read y x x = ε x = ( ) The OLS model

More information

Lecture 3. Sampling, sampling distributions, and parameter estimation

Lecture 3. Sampling, sampling distributions, and parameter estimation Lecture 3 Samplg, samplg dstrbutos, ad parameter estmato Samplg Defto Populato s defed as the collecto of all the possble observatos of terest. The collecto of observatos we take from the populato s called

More information

residual. (Note that usually in descriptions of regression analysis, upper-case

residual. (Note that usually in descriptions of regression analysis, upper-case Regresso Aalyss Regresso aalyss fts or derves a model that descres the varato of a respose (or depedet ) varale as a fucto of oe or more predctor (or depedet ) varales. The geeral regresso model s oe of

More information

Lecture Notes Types of economic variables

Lecture Notes Types of economic variables Lecture Notes 3 1. Types of ecoomc varables () Cotuous varable takes o a cotuum the sample space, such as all pots o a le or all real umbers Example: GDP, Polluto cocetrato, etc. () Dscrete varables fte

More information

Dr. Shalabh. Indian Institute of Technology Kanpur

Dr. Shalabh. Indian Institute of Technology Kanpur Aalyss of Varace ad Desg of Expermets-I MODULE -I LECTURE - SOME RESULTS ON LINEAR ALGEBRA, MATRIX THEORY AND DISTRIBUTIONS Dr. Shalabh Departmet t of Mathematcs t ad Statstcs t t Ida Isttute of Techology

More information

Lecture Note to Rice Chapter 8

Lecture Note to Rice Chapter 8 ECON 430 HG revsed Nov 06 Lecture Note to Rce Chapter 8 Radom matrces Let Y, =,,, m, =,,, be radom varables (r.v. s). The matrx Y Y Y Y Y Y Y Y Y Y = m m m s called a radom matrx ( wth a ot m-dmesoal dstrbuto,

More information

STA 108 Applied Linear Models: Regression Analysis Spring Solution for Homework #1

STA 108 Applied Linear Models: Regression Analysis Spring Solution for Homework #1 STA 08 Appled Lear Models: Regresso Aalyss Sprg 0 Soluto for Homework #. Let Y the dollar cost per year, X the umber of vsts per year. The the mathematcal relato betwee X ad Y s: Y 300 + X. Ths s a fuctoal

More information

Midterm Exam 1, section 1 (Solution) Thursday, February hour, 15 minutes

Midterm Exam 1, section 1 (Solution) Thursday, February hour, 15 minutes coometrcs, CON Sa Fracsco State Uversty Mchael Bar Sprg 5 Mdterm am, secto Soluto Thursday, February 6 hour, 5 mutes Name: Istructos. Ths s closed book, closed otes eam.. No calculators of ay kd are allowed..

More information

{ }{ ( )} (, ) = ( ) ( ) ( ) Chapter 14 Exercises in Sampling Theory. Exercise 1 (Simple random sampling): Solution:

{ }{ ( )} (, ) = ( ) ( ) ( ) Chapter 14 Exercises in Sampling Theory. Exercise 1 (Simple random sampling): Solution: Chapter 4 Exercses Samplg Theory Exercse (Smple radom samplg: Let there be two correlated radom varables X ad A sample of sze s draw from a populato by smple radom samplg wthout replacemet The observed

More information

best estimate (mean) for X uncertainty or error in the measurement (systematic, random or statistical) best

best estimate (mean) for X uncertainty or error in the measurement (systematic, random or statistical) best Error Aalyss Preamble Wheever a measuremet s made, the result followg from that measuremet s always subject to ucertaty The ucertaty ca be reduced by makg several measuremets of the same quatty or by mprovg

More information

Chapter 13, Part A Analysis of Variance and Experimental Design. Introduction to Analysis of Variance. Introduction to Analysis of Variance

Chapter 13, Part A Analysis of Variance and Experimental Design. Introduction to Analysis of Variance. Introduction to Analysis of Variance Chapter, Part A Aalyss of Varace ad Epermetal Desg Itroducto to Aalyss of Varace Aalyss of Varace: Testg for the Equalty of Populato Meas Multple Comparso Procedures Itroducto to Aalyss of Varace Aalyss

More information

Midterm Exam 1, section 2 (Solution) Thursday, February hour, 15 minutes

Midterm Exam 1, section 2 (Solution) Thursday, February hour, 15 minutes coometrcs, CON Sa Fracsco State Uverst Mchael Bar Sprg 5 Mdterm xam, secto Soluto Thursda, Februar 6 hour, 5 mutes Name: Istructos. Ths s closed book, closed otes exam.. No calculators of a kd are allowed..

More information

ECONOMETRIC THEORY. MODULE VIII Lecture - 26 Heteroskedasticity

ECONOMETRIC THEORY. MODULE VIII Lecture - 26 Heteroskedasticity ECONOMETRIC THEORY MODULE VIII Lecture - 6 Heteroskedastcty Dr. Shalabh Departmet of Mathematcs ad Statstcs Ida Isttute of Techology Kapur . Breusch Paga test Ths test ca be appled whe the replcated data

More information

The number of observed cases The number of parameters. ith case of the dichotomous dependent variable. the ith case of the jth parameter

The number of observed cases The number of parameters. ith case of the dichotomous dependent variable. the ith case of the jth parameter LOGISTIC REGRESSION Notato Model Logstc regresso regresses a dchotomous depedet varable o a set of depedet varables. Several methods are mplemeted for selectg the depedet varables. The followg otato s

More information

Econ 388 R. Butler 2016 rev Lecture 5 Multivariate 2 I. Partitioned Regression and Partial Regression Table 1: Projections everywhere

Econ 388 R. Butler 2016 rev Lecture 5 Multivariate 2 I. Partitioned Regression and Partial Regression Table 1: Projections everywhere Eco 388 R. Butler 06 rev Lecture 5 Multvarate I. Parttoed Regresso ad Partal Regresso Table : Projectos everywhere P = ( ) ad M = I ( ) ad s a vector of oes assocated wth the costat term Sample Model Regresso

More information

b. There appears to be a positive relationship between X and Y; that is, as X increases, so does Y.

b. There appears to be a positive relationship between X and Y; that is, as X increases, so does Y. .46. a. The frst varable (X) s the frst umber the par ad s plotted o the horzotal axs, whle the secod varable (Y) s the secod umber the par ad s plotted o the vertcal axs. The scatterplot s show the fgure

More information

Linear Regression with One Regressor

Linear Regression with One Regressor Lear Regresso wth Oe Regressor AIM QA.7. Expla how regresso aalyss ecoometrcs measures the relatoshp betwee depedet ad depedet varables. A regresso aalyss has the goal of measurg how chages oe varable,

More information

CLASS NOTES. for. PBAF 528: Quantitative Methods II SPRING Instructor: Jean Swanson. Daniel J. Evans School of Public Affairs

CLASS NOTES. for. PBAF 528: Quantitative Methods II SPRING Instructor: Jean Swanson. Daniel J. Evans School of Public Affairs CLASS NOTES for PBAF 58: Quattatve Methods II SPRING 005 Istructor: Jea Swaso Dael J. Evas School of Publc Affars Uversty of Washgto Ackowledgemet: The structor wshes to thak Rachel Klet, Assstat Professor,

More information

Chapter 8. Inferences about More Than Two Population Central Values

Chapter 8. Inferences about More Than Two Population Central Values Chapter 8. Ifereces about More Tha Two Populato Cetral Values Case tudy: Effect of Tmg of the Treatmet of Port-We tas wth Lasers ) To vestgate whether treatmet at a youg age would yeld better results tha

More information

Chapter Two. An Introduction to Regression ( )

Chapter Two. An Introduction to Regression ( ) ubject: A Itroducto to Regresso Frst tage Chapter Two A Itroducto to Regresso (018-019) 1 pg. ubject: A Itroducto to Regresso Frst tage A Itroducto to Regresso Regresso aalss s a statstcal tool for the

More information

Mean is only appropriate for interval or ratio scales, not ordinal or nominal.

Mean is only appropriate for interval or ratio scales, not ordinal or nominal. Mea Same as ordary average Sum all the data values ad dvde by the sample sze. x = ( x + x +... + x Usg summato otato, we wrte ths as x = x = x = = ) x Mea s oly approprate for terval or rato scales, ot

More information

Chapter 3 Sampling For Proportions and Percentages

Chapter 3 Sampling For Proportions and Percentages Chapter 3 Samplg For Proportos ad Percetages I may stuatos, the characterstc uder study o whch the observatos are collected are qualtatve ature For example, the resposes of customers may marketg surveys

More information

Reaction Time VS. Drug Percentage Subject Amount of Drug Times % Reaction Time in Seconds 1 Mary John Carl Sara William 5 4

Reaction Time VS. Drug Percentage Subject Amount of Drug Times % Reaction Time in Seconds 1 Mary John Carl Sara William 5 4 CHAPTER Smple Lear Regreo EXAMPLE A expermet volvg fve ubject coducted to determe the relatohp betwee the percetage of a certa drug the bloodtream ad the legth of tme t take the ubject to react to a tmulu.

More information

Correlation and Simple Linear Regression

Correlation and Simple Linear Regression Correlato ad Smple Lear Regresso Berl Che Departmet of Computer Scece & Iformato Egeerg Natoal Tawa Normal Uverst Referece:. W. Navd. Statstcs for Egeerg ad Scetsts. Chapter 7 (7.-7.3) & Teachg Materal

More information

Regression. Linear Regression. A Simple Data Display. A Batch of Data. The Mean is 220. A Value of 474. STAT Handout Module 15 1 st of June 2009

Regression. Linear Regression. A Simple Data Display. A Batch of Data. The Mean is 220. A Value of 474. STAT Handout Module 15 1 st of June 2009 STAT Hadout Module 5 st of Jue 9 Lear Regresso Regresso Joh D. Sork, M.D. Ph.D. Baltmore VA Medcal Ceter GRCC ad Uversty of Marylad School of Medce Claude D. Pepper Older Amercas Idepedece Ceter Reducg

More information

Logistic regression (continued)

Logistic regression (continued) STAT562 page 138 Logstc regresso (cotued) Suppose we ow cosder more complex models to descrbe the relatoshp betwee a categorcal respose varable (Y) that takes o two (2) possble outcomes ad a set of p explaatory

More information

Maximum Likelihood Estimation

Maximum Likelihood Estimation Marquette Uverst Maxmum Lkelhood Estmato Dael B. Rowe, Ph.D. Professor Departmet of Mathematcs, Statstcs, ad Computer Scece Coprght 08 b Marquette Uverst Maxmum Lkelhood Estmato We have bee sag that ~

More information

Analysis of Variance with Weibull Data

Analysis of Variance with Weibull Data Aalyss of Varace wth Webull Data Lahaa Watthaacheewaul Abstract I statstcal data aalyss by aalyss of varace, the usual basc assumptos are that the model s addtve ad the errors are radomly, depedetly, ad

More information

Simple Linear Regression and Correlation. Applied Statistics and Probability for Engineers. Chapter 11 Simple Linear Regression and Correlation

Simple Linear Regression and Correlation. Applied Statistics and Probability for Engineers. Chapter 11 Simple Linear Regression and Correlation 4//6 Appled Statstcs ad Probablty for Egeers Sth Edto Douglas C. Motgomery George C. Ruger Chapter Smple Lear Regresso ad Correlato CHAPTER OUTLINE Smple Lear Regresso ad Correlato - Emprcal Models -8

More information

X X X E[ ] E X E X. is the ()m n where the ( i,)th. j element is the mean of the ( i,)th., then

X X X E[ ] E X E X. is the ()m n where the ( i,)th. j element is the mean of the ( i,)th., then Secto 5 Vectors of Radom Varables Whe workg wth several radom varables,,..., to arrage them vector form x, t s ofte coveet We ca the make use of matrx algebra to help us orgaze ad mapulate large umbers

More information

Multiple Choice Test. Chapter Adequacy of Models for Regression

Multiple Choice Test. Chapter Adequacy of Models for Regression Multple Choce Test Chapter 06.0 Adequac of Models for Regresso. For a lear regresso model to be cosdered adequate, the percetage of scaled resduals that eed to be the rage [-,] s greater tha or equal to

More information

LINEAR REGRESSION ANALYSIS

LINEAR REGRESSION ANALYSIS LINEAR REGRESSION ANALYSIS MODULE V Lecture - Correctg Model Iadequaces Through Trasformato ad Weghtg Dr. Shalabh Departmet of Mathematcs ad Statstcs Ida Isttute of Techology Kapur Aalytcal methods for

More information

Previous lecture. Lecture 8. Learning outcomes of this lecture. Today. Statistical test and Scales of measurement. Correlation

Previous lecture. Lecture 8. Learning outcomes of this lecture. Today. Statistical test and Scales of measurement. Correlation Lecture 8 Emprcal Research Methods I434 Quattatve Data aalss II Relatos Prevous lecture Idea behd hpothess testg Is the dfferece betwee two samples a reflecto of the dfferece of two dfferet populatos or

More information

TESTS BASED ON MAXIMUM LIKELIHOOD

TESTS BASED ON MAXIMUM LIKELIHOOD ESE 5 Toy E. Smth. The Basc Example. TESTS BASED ON MAXIMUM LIKELIHOOD To llustrate the propertes of maxmum lkelhood estmates ad tests, we cosder the smplest possble case of estmatg the mea of the ormal

More information

Statistics. Correlational. Dr. Ayman Eldeib. Simple Linear Regression and Correlation. SBE 304: Linear Regression & Correlation 1/3/2018

Statistics. Correlational. Dr. Ayman Eldeib. Simple Linear Regression and Correlation. SBE 304: Linear Regression & Correlation 1/3/2018 /3/08 Sstems & Bomedcal Egeerg Departmet SBE 304: Bo-Statstcs Smple Lear Regresso ad Correlato Dr. Ama Eldeb Fall 07 Descrptve Orgasg, summarsg & descrbg data Statstcs Correlatoal Relatoshps Iferetal Geeralsg

More information

CHAPTER 2. = y ˆ β x (.1022) So we can write

CHAPTER 2. = y ˆ β x (.1022) So we can write CHAPTER SOLUTIONS TO PROBLEMS. () Let y = GPA, x = ACT, ad = 8. The x = 5.875, y = 3.5, (x x )(y y ) = 5.85, ad (x x ) = 56.875. From equato (.9), we obta the slope as ˆβ = = 5.85/56.875., rouded to four

More information

6.867 Machine Learning

6.867 Machine Learning 6.867 Mache Learg Problem set Due Frday, September 9, rectato Please address all questos ad commets about ths problem set to 6.867-staff@a.mt.edu. You do ot eed to use MATLAB for ths problem set though

More information

Investigation of Partially Conditional RP Model with Response Error. Ed Stanek

Investigation of Partially Conditional RP Model with Response Error. Ed Stanek Partally Codtoal Radom Permutato Model 7- vestgato of Partally Codtoal RP Model wth Respose Error TRODUCTO Ed Staek We explore the predctor that wll result a smple radom sample wth respose error whe a

More information

: At least two means differ SST

: At least two means differ SST Formula Card for Eam 3 STA33 ANOVA F-Test: Completely Radomzed Desg ( total umber of observatos, k = Number of treatmets,& T = total for treatmet ) Step : Epress the Clam Step : The ypotheses: :... 0 A

More information

ENGI 4421 Propagation of Error Page 8-01

ENGI 4421 Propagation of Error Page 8-01 ENGI 441 Propagato of Error Page 8-01 Propagato of Error [Navd Chapter 3; ot Devore] Ay realstc measuremet procedure cotas error. Ay calculatos based o that measuremet wll therefore also cota a error.

More information

Homework Solution (#5)

Homework Solution (#5) Homework Soluto (# Chapter : #6,, 8(b, 3, 4, 44, 49, 3, 9 ad 7 Chapter. Smple Lear Regresso ad Correlato.6 (6 th edto 7, old edto Page 9 Rafall volume ( vs Ruoff volume ( : 9 8 7 6 4 3 : a. Yes, the scatter-plot

More information

MEASURES OF DISPERSION

MEASURES OF DISPERSION MEASURES OF DISPERSION Measure of Cetral Tedecy: Measures of Cetral Tedecy ad Dsperso ) Mathematcal Average: a) Arthmetc mea (A.M.) b) Geometrc mea (G.M.) c) Harmoc mea (H.M.) ) Averages of Posto: a) Meda

More information

Matrix Algebra Tutorial With Examples in Matlab

Matrix Algebra Tutorial With Examples in Matlab Matr Algebra Tutoral Wth Eamples Matlab by Klaus Moelter Departmet of Agrcultural ad Appled Ecoomcs Vrga Tech emal: moelter@vt.edu web: http://faculty.ageco.vt.edu/moelter/ Specfcally desged as a / day

More information

Example. Row Hydrogen Carbon

Example. Row Hydrogen Carbon SMAM 39 Least Squares Example. Heatg ad combusto aalyses were performed order to study the composto of moo rocks collected by Apollo 4 ad 5 crews. Recorded c ad c of the Mtab output are the determatos

More information

Chapter 11 The Analysis of Variance

Chapter 11 The Analysis of Variance Chapter The Aalyss of Varace. Oe Factor Aalyss of Varace. Radomzed Bloc Desgs (ot for ths course) NIPRL . Oe Factor Aalyss of Varace.. Oe Factor Layouts (/4) Suppose that a expermeter s terested populatos

More information

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS Postpoed exam: ECON430 Statstcs Date of exam: Jauary 0, 0 Tme for exam: 09:00 a.m. :00 oo The problem set covers 5 pages Resources allowed: All wrtte ad prted

More information

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE THE ROYAL STATISTICAL SOCIETY 00 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE PAPER I STATISTICAL THEORY The Socety provdes these solutos to assst caddates preparg for the examatos future years ad for the

More information

Chapter 5 Properties of a Random Sample

Chapter 5 Properties of a Random Sample Lecture 6 o BST 63: Statstcal Theory I Ku Zhag, /0/008 Revew for the prevous lecture Cocepts: t-dstrbuto, F-dstrbuto Theorems: Dstrbutos of sample mea ad sample varace, relatoshp betwee sample mea ad sample

More information

Chapter 2 Supplemental Text Material

Chapter 2 Supplemental Text Material -. Models for the Data ad the t-test Chapter upplemetal Text Materal The model preseted the text, equato (-3) s more properl called a meas model. ce the mea s a locato parameter, ths tpe of model s also

More information

Chapter 3 Multiple Linear Regression Model

Chapter 3 Multiple Linear Regression Model Chapter 3 Multple Lear Regresso Model We cosder the problem of regresso whe study varable depeds o more tha oe explaatory or depedet varables, called as multple lear regresso model. Ths model geeralzes

More information

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS Exam: ECON430 Statstcs Date of exam: Frday, December 8, 07 Grades are gve: Jauary 4, 08 Tme for exam: 0900 am 00 oo The problem set covers 5 pages Resources allowed:

More information

Handout #8. X\Y f(x) 0 1/16 1/ / /16 3/ / /16 3/16 0 3/ /16 1/16 1/8 g(y) 1/16 1/4 3/8 1/4 1/16 1

Handout #8. X\Y f(x) 0 1/16 1/ / /16 3/ / /16 3/16 0 3/ /16 1/16 1/8 g(y) 1/16 1/4 3/8 1/4 1/16 1 Hadout #8 Ttle: Foudatos of Ecoometrcs Course: Eco 367 Fall/05 Istructor: Dr. I-Mg Chu Lear Regresso Model So far we have focused mostly o the study of a sgle radom varable, ts correspodg theoretcal dstrbuto,

More information

Lecture 1 Review of Fundamental Statistical Concepts

Lecture 1 Review of Fundamental Statistical Concepts Lecture Revew of Fudametal Statstcal Cocepts Measures of Cetral Tedecy ad Dsperso A word about otato for ths class: Idvduals a populato are desgated, where the dex rages from to N, ad N s the total umber

More information

Lecture 2: Linear Least Squares Regression

Lecture 2: Linear Least Squares Regression Lecture : Lear Least Squares Regresso Dave Armstrog UW Mlwaukee February 8, 016 Is the Relatoshp Lear? lbrary(car) data(davs) d 150) Davs$weght[d]

More information

Lecture 1: Introduction to Regression

Lecture 1: Introduction to Regression Lecture : Itroducto to Regresso A Eample: Eplag State Homcde Rates What kds of varables mght we use to epla/predct state homcde rates? Let s cosder just oe predctor for ow: povert Igore omtted varables,

More information

GG313 GEOLOGICAL DATA ANALYSIS

GG313 GEOLOGICAL DATA ANALYSIS GG33 GEOLOGICAL DATA ANALYSIS 3 GG33 GEOLOGICAL DATA ANALYSIS LECTURE NOTES PAUL WESSEL SECTION 3 LINEAR (MATRIX ALGEBRA OVERVIEW OF MATRIX ALGEBRA (or All you ever wated to kow about Lear Algebra but

More information

Chapter 4 Multiple Random Variables

Chapter 4 Multiple Random Variables Revew for the prevous lecture: Theorems ad Examples: How to obta the pmf (pdf) of U = g (, Y) ad V = g (, Y) Chapter 4 Multple Radom Varables Chapter 44 Herarchcal Models ad Mxture Dstrbutos Examples:

More information

COURSE: Applied Regression Analysis. Lecture 1: Review Simple linear regression.

COURSE: Applied Regression Analysis. Lecture 1: Review Simple linear regression. COURSE: Appled Regresso Aalyss Lecture : Revew Smple lear regresso. Fudametal elemets of statstcs: Populato: set of uts Sample: a subset of the populato Varable of terest: systolc blood pressure cotuous

More information

CHAPTER VI Statistical Analysis of Experimental Data

CHAPTER VI Statistical Analysis of Experimental Data Chapter VI Statstcal Aalyss of Expermetal Data CHAPTER VI Statstcal Aalyss of Expermetal Data Measuremets do ot lead to a uque value. Ths s a result of the multtude of errors (maly radom errors) that ca

More information

Comparing Different Estimators of three Parameters for Transmuted Weibull Distribution

Comparing Different Estimators of three Parameters for Transmuted Weibull Distribution Global Joural of Pure ad Appled Mathematcs. ISSN 0973-768 Volume 3, Number 9 (207), pp. 55-528 Research Ida Publcatos http://www.rpublcato.com Comparg Dfferet Estmators of three Parameters for Trasmuted

More information

Recall MLR 5 Homskedasticity error u has the same variance given any values of the explanatory variables Var(u x1,...,xk) = 2 or E(UU ) = 2 I

Recall MLR 5 Homskedasticity error u has the same variance given any values of the explanatory variables Var(u x1,...,xk) = 2 or E(UU ) = 2 I Chapter 8 Heterosedastcty Recall MLR 5 Homsedastcty error u has the same varace gve ay values of the eplaatory varables Varu,..., = or EUU = I Suppose other GM assumptos hold but have heterosedastcty.

More information

Applied Statistics and Probability for Engineers, 5 th edition February 23, b) y ˆ = (85) =

Applied Statistics and Probability for Engineers, 5 th edition February 23, b) y ˆ = (85) = Appled Statstcs ad Probablty for Egeers, 5 th edto February 3, y.8.7.6.5.4.3.. -5 5 5 x b) y ˆ.3999 +.46(85).6836 c) y ˆ.3999 +.46(9).744 d) ˆ.46-3 a) Regresso Aalyss: Ratg Pots versus Meters per Att The

More information

Special Instructions / Useful Data

Special Instructions / Useful Data JAM 6 Set of all real umbers P A..d. B, p Posso Specal Istructos / Useful Data x,, :,,, x x Probablty of a evet A Idepedetly ad detcally dstrbuted Bomal dstrbuto wth parameters ad p Posso dstrbuto wth

More information

( ) = ( ) ( ) Chapter 13 Asymptotic Theory and Stochastic Regressors. Stochastic regressors model

( ) = ( ) ( ) Chapter 13 Asymptotic Theory and Stochastic Regressors. Stochastic regressors model Chapter 3 Asmptotc Theor ad Stochastc Regressors The ature of eplaator varable s assumed to be o-stochastc or fed repeated samples a regresso aalss Such a assumpto s approprate for those epermets whch

More information

Fundamentals of Regression Analysis

Fundamentals of Regression Analysis Fdametals of Regresso Aalyss Regresso aalyss s cocered wth the stdy of the depedece of oe varable, the depedet varable, o oe or more other varables, the explaatory varables, wth a vew of estmatg ad/or

More information

SPECIAL CONSIDERATIONS FOR VOLUMETRIC Z-TEST FOR PROPORTIONS

SPECIAL CONSIDERATIONS FOR VOLUMETRIC Z-TEST FOR PROPORTIONS SPECIAL CONSIDERAIONS FOR VOLUMERIC Z-ES FOR PROPORIONS Oe s stctve reacto to the questo of whether two percetages are sgfcatly dfferet from each other s to treat them as f they were proportos whch the

More information

Estimation of Stress- Strength Reliability model using finite mixture of exponential distributions

Estimation of Stress- Strength Reliability model using finite mixture of exponential distributions Iteratoal Joural of Computatoal Egeerg Research Vol, 0 Issue, Estmato of Stress- Stregth Relablty model usg fte mxture of expoetal dstrbutos K.Sadhya, T.S.Umamaheswar Departmet of Mathematcs, Lal Bhadur

More information

C. Statistics. X = n geometric the n th root of the product of numerical data ln X GM = or ln GM = X 2. X n X 1

C. Statistics. X = n geometric the n th root of the product of numerical data ln X GM = or ln GM = X 2. X n X 1 C. Statstcs a. Descrbe the stages the desg of a clcal tral, takg to accout the: research questos ad hypothess, lterature revew, statstcal advce, choce of study protocol, ethcal ssues, data collecto ad

More information