Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Revew of Correlaton & Regresson Petra Petrovcs
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Tpes of dependence assocaton between two nomnal data mxed between a nomnal and a rato data correlaton among rato data
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Correlaton descrbes the strength of a relatonshp, the degree to whch one varable s lnearl related to another Regresson shows us how to determne the nature of a relatonshp between two or more varables X (or X, X,, X p ): known varable(s) / ndependent varable(s) / predctor(s) Y: unknown varable / dependent varable causal relatonshp: X causes Y to change
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Correlaton Measures. Covarance. Coeffcent of correlaton 3. Coeffcent of determnaton 4. Coeffcent of rank correlaton
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Correlaton Measures. Covarance The covarance between two varables s a measure of the jont varaton of the two varables Cov x, x x ranges from - to +; Cov =, when X and Y are uncorrelated; ts sgn shows the drecton of correlaton t doesn t measure the degree of relatonshp!!! n
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet. Coeffcent of correlaton (Pearson) r ts sgn shows the drecton of correlaton t measures the strength of correlaton < r < statstcal dependence r = X and Y are uncorrelated r = - negatve r = postve You can use onl n case of lnear relatonshp! Cov x, s x s
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet 3. Coeffcent of determnaton r The square of the sample correlaton coeffcent between the outcomes and ther predcted values. Measures the degree of correlaton n percentage (%) It provdes a measure of how well future outcomes are lkel to be predcted b the model. Var from to. r S S ˆ S =- S e
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Example A frm admnsters a test to sales tranees before the go nto the feld. The management of the frm s nterested n determnng the relatonshp between the test scores and the sales made b the tranees at the end of one ear n the feld. The followng data were collected for 45 sales personnel who have been n the feld one ear. Calculate dfferent correlaton measures!
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet X Y ndependent dependent varable Salesperson Test score Number of unts sold x d x K. A. 5 88 +9 + +98 L. Z. 6 57-9 B. E. 3 65 +4 - -4 G. P. 5 4 - -4 +46 S. G. 58-6 -8 +48 J. T. 4 4 +8 +58 +464 V. P. 7 69 + +3 +3 T. L. 6 4 - -5 +5 Total 76 7 464 d x d =8 894.5 x d x x dxd
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Number of observed pars: n = 45 x 6 66 s s x 8.6 3.99 C dxd n 8894.5 45-.5 Postve correlaton
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet r s x C s.5 8.6 3.99.7897 r 6.36 % There s a strong & postve relaton between test scores and number of unts sold. The varaton of test scores explans 6.36 percent of the varaton of number of unts sold.
r Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet s 4. Coeffcent of rank correlaton - 6 n (n d ) (Spearman) Measure of the relatonshp between two ordnal data n = number of pared observatons, d = dfference between the ranks for each par of observatons. perfect correlaton r s = perfect nverse correlaton r s = - n case of ndependence r s = rs
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Example Ten students were ranked b ther mathematcal and muscal ablt: Ablt Student A B C D E F G H I J Total Mathematcs 3 4 5 6 7 8 9 - Musc 3 4 5 7 6 8 9 - d = x - - - - -3 d 4 4 4 4 9 4 3 6d 63 - -.86 strong relatonshp n (n ) ( -) ρ
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Smple Lnear Regresson Model E () We model the relatonshp between two varables, X and Y as a straght lne. The model contans two parameters: an ntercept parameter, a slope parameter. Y = β + β x + ε Y = determnstc component + random error β = -ntercept β = slope where: Y dependent or response varable (the varable we wsh to explan or predct) x ndependent or predctor varable ε random error component β -ntercept of the lne,.e. pont at whch the lne ntercept the -axs β slope of the lne x
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Determnstc component ŷ = b + b x Random error x = determnstc component + random error We alwas assume that the mean value of the random error equals the mean value of equals the determnstc component. It s possble to fnd man lnes for whch the sum of the errors s equal to, but there s one (and onl one) lne for whch the SSE (sum of squares of the errors) s a mnmum: least squares lne / regresson lne.
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet The method of least squares gves us the best lnear unbased estmators (BLUE) of the regresson parameters, β, β. The least-squares estmators: b estmates β b estmates β The (emprcal) regresson lne: caret ( hat ): Calculaton of the estmators: f n x b, b b b mn! ˆ b b x
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Least Square Methode There s an extreme value (mnmum) f tha partal dervaton s equal to f b f b x b b b x After transformaton The normal equatons (wth x) Σ = nb + b Σx Σx = b Σx + b Σx The estmated regresson lne: b x ŷ = b + b x
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Interpretaton b : when x=, =b If the X varable s, how much s the Y. b : for ever unt ncrease n x we expect to change b b unts on average. If the X s hgher wth, what s the dfference n Y on average.
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet No relatonshp 4 Number of brths 3 3 4 Number of storks
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Independence Y = - 7. 4 E - +. 8 3 4 8 X 3 R - S q = 3. 4 % - - - 3 - - N n c s k o r r e lá c ó
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Postve correlaton Y = -8. 6 E - +. 6 9 8 6 X 3 R -S q = 6. 5 % - - - 3-3 - - 3 P o z t ív k o r r e l á c ó
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Negatve correlaton Y = 5. 7 E - -. 6 4 7 8 7 X 3 R - S q = 7. 9 % - - - 3-3 - - 3 N e g a t ív k o r r e lá c ó
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Curvlnear relaton Y =. 9 5 8 + 6. 7 6 8 4 X +. 6 6 8 6 X * * 4 R - S q = 8 8. 4 % 3-3 - - 3 N e m l n e á r s k o r r e lá c ó
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Scatter dagrams lnear S a l e s n 6 8 4 $ 3 4 5 Advertsng n $ S e l l n g p r c e 5 4 3 4 4 6 8 Age of a house (ear) curvlnear w a s t a g e 4 3 S e l l n g p r c e 3 3 4 Producton (number of products per da) 5 5 Age of a car (ear) drect relatonshp postve slope nverse relatonshp negatve slope
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Power regresson Y = a X b logy = loga + b logx V = b + b x lg b n b lg x lg b x b lg lg x lg x b = b b = lga
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Compound regresson Y = a b x logy = loga + logb x V = b + b x lg b n b x x lg b x b b = lgb b = lga x
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Estmaton n Regresson Regresson estmaton s a technque used to replace mssng values n data. If we know:. The estmated parameter value;. The hpotheszed value of the parameter; 3. Confdence nterval around the estmated parameter. The number of degrees of freedom equals the number of observatons mnus the number of parameters estmated. = n-
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Estmaton n Regresson Parameter Estmated value Standard error b b ŷ s e s e n(x x s e x) (x x) ( x n ( x x) x) b b ˆ t ˆ t Y t t s s b s ˆ ˆ b s ŷ s e n ( x + (x x) x) = n- In case of average Y values In case of dscrete Y values
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Elastct % change n x demanded % change n E(,x) b b x b x E(, x) = b x Elastct at the mean
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Resdual varable n n n e e e ˆ ˆ ˆ ˆ ˆ S = + S e Sum of square of Y Sum of square explaned b regresson Sum of square of the errors S ˆ
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Analss of Varance n Regresson Analss Sum of Squares Df Regresson Sŷ = (ŷ ) Mean Sum of Squares S Resdual S = ( ŷ n- se Se /( n ) e ) ŷ F = S F e S ŷ /(n - ) Total S = ( ) n- S n - S S ˆ S e n = n n ) (ŷ ) + ( ) = = (
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Model testng H : β = H : β (lnear model) Test statstc: F = S s Pr ŷ e H : S F ( ; ) /(n - F-statstc tests whether all the slope coeffcents n a lnear regresson are equal to. Measures how well the regresson equaton explans the varaton n the dependent varable. e S ŷ ) F Pr H F ( ; ) : H F ( ; ) F
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet H : m H : β = H : β Parameter testng Pr H : m Pr H t Test statstc: t b s( b ) t / t / where: b s the least square estmate of the regresson slope s(b ) s the standard error of b
Mskolc Egetem Gazdaságtudomán Kar Üzlet Informácógazdálkodás és Módszertan Intézet Thanks for our attenton!