Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Summary formula sheet for simple linear regression _ _ _ Slope b = ! (Yi -Y)(Xi -X) / ! (Xi -X)2 _ Variance 5 2 / ! (Xi -X)2 _ _ Intercept a= Y - b X _ 2 1 X _ 2 Variance of a [ n + ! ] 5 2 (Xi -X) Estimated mean at X_ 0 a + b X0 (X0 -X)_2 1 2 Variance [ n + ! ] 5 2 (Xi -X) Estimated individual at _X0 a + b X0 (X0 -X)_2 1 2 Variance [1 + n + ! ] 5 (Xi -X)2 _ Total SS = ! (Yi -Y)2 Regression _ SS =_ _ 2 [ ! (Yi -Y)(Xi -X)] / ! (Xi -X)2 Error SS = Total SS - Regression SS R2 = Regression SS/ Total SS = "proportion explained" MSE = error mean square = estimate of 5 2 = Error SS/ df df= degrees of freedom = n-2 for simple linear. Example Data points (x1 ,y1 ), (x2 ,y2 ), ...., (xn ,yn ) _ (1,5), (2,7),_ (3,9), (4,6), (5,8) x = 15/5=3, y = 7 Corrected sum of squares for x: n _ !(xi - x)2 = Sxx = (1-3)2 +...+(5-3)2 = 10 i=1 Corrected sum of squares for y: n _ !(yi -y)2 = Syy = (5-7)2 +...+(8-7)2 = 10 i=1 Corrected sum of cross products = Sxy = n _ _ !(xi - x)(yi -y) = i=1 (-2)(-2)+(-1)(0)+...+(2)(1) = 5 = __ !xi yi -n x y = 110-5(3)(7) n i=1 Slope: b = Sxy /Sxx = 5/10 = 0.5 Intercept: _ _ y - b x = 7-0.5(3) = 5.5 ^ y=5.5 + 0.5x y y^ r=y- y^ 5 6 -1 7 6.5 0.5 9 7 2 6 7.5 -1.5 !ri2 = "Error sum of squares" = 8 8 0 n i=1 SSE = 1+0.25+4+2.25=7.5 SSE is also Syy - S2xy /Sxx = Syy - b2 Sxx = 10-52 /10 Variance of b: MSE/Sxx œ 2.5/10 = 0.25. ÈMSE/Sxx is called "standard error" of b. Task: test H0 : true slope is 0 t = b/È0.25 = 1 which is not an unusual t. data a; input x y @@; cards; 15 27 39 46 58 ; proc reg; model Y =X / p; run; Dependent Variable: y Analysis of Variance Source DF Model 1 Error 3 Corr Total 4 Root MSE Dependent Mean Coeff Var Sum of Squares 2.50000 7.50000 10.00000 1.58114 7.00000 22.58770 Mean Square F Value 2.50000 1.00 2.50000 R-Square Adj R-Sq Pr > F 0.3910 0.2500 0.0000 Parameter Estimates Variable Intercept x DF 1 1 Parameter Standard Estimate Error t Value 5.50000 1.65831 3.32 0.50000 0.50000 1.00 Output Statistics Pr > |t| 0.0452 0.3910 Obs Dep Var y Predicted Value Residual 1 2 3 4 5 5.0000 7.0000 9.0000 6.0000 8.0000 6.0000 6.5000 7.0000 7.5000 8.0000 -1.0000 0.5000 2.0000 -1.5000 0