Presentation is loading. Please wait.

Presentation is loading. Please wait.

Crime? FBI records violent crime, z x y z [1,] 58035 354.559 46 [2,] 120100 351.593 998 [3,] 102743 339.815 615 [4,] 117242 321.533 168 [5,] 137538.

Similar presentations


Presentation on theme: "Crime? FBI records violent crime, z x y z [1,] 58035 354.559 46 [2,] 120100 351.593 998 [3,] 102743 339.815 615 [4,] 117242 321.533 168 [5,] 137538."— Presentation transcript:

1

2

3 Crime? FBI records violent crime, z x y z [1,] 58035 354.559 46 [2,] 120100 351.593 998 [3,] 102743 339.815 615 [4,] 117242 321.533 168 [5,] 137538 311.839 169 [6,] 101400 305.200 1095 [7,] 1000007 304.206 2439 [8,] 58047 292.977 204 [9,] 74900 285.698 199. ; [21]

4 Total sum of squares (TSS) TSS =  (Y i - ) 2 = 44829 i = A + B 1 X i1 + B 2 X i2 Residual sum of squares (RSS) RSS =  (Y i - i ) 2 = 38656 Regression sum of squares (RegSS) RegSS =  ( i - ) 2 = 6173

5 Analysis of variance TSS = RegSS + RSS zz = z/x ANOVA Table. via anova(lm(y~log10(x) + zz) Response: y Df Sum Sq Mean Sq F value Pr(>F) log10(x) 1 6173 6172.6 2.8883 0.1064 zz 1 189 188.6 0.0883 0.7698 Residuals 18 38467 2137.1

6 Call: lm(formula = y ~ log10(x) + zz) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 78.830 124.363 0.634 0.534 log10(x) 38.554 26.067 1.479 0.156 zz 1.257 4.232 0.297 0.770 Residual standard error: 46.23 on 18 degrees of freedom Multiple R-squared: 0.1419, Adjusted R-squared: 0.04656 F-statistic: 1.488 on 2 and 18 DF, p-value: 0.2523 Where do these values come from?

7 Statistical inference. Y i =  +  x i +  i x_i constant E (  i ) = 0 E (Y i ) =  +  x i V(  i ) =  2 V(Y i ) =  2 Normality.  i ~ N(0,  2 ) Y i ~ N(  +  x i,  2 ) {  i }~ IN(0,  2 ) {Y i }~ IN(  +  x i,  2 )

8 N( ,  2 ) has density 1/(  (2  )  ) exp{-(y-  )2 /(2  2 )} Joint density  [1/(  (2  )  ) exp{-(Y i -  )2 /(2  2 )}] log-likelihood l( ,  2 ) =  [-.5log  2 - (Y i -  ) 2 /(2  2 ) mles S Y 2 =  (Y i - ) 2 /n

9 B =  (Y i - )( x i - )/  ( x i - ) 2 =  Y i (  i - ) /  ( x i - ) 2 =  m i Y i constant coefficients =  +   i ( x i - )/  ( x i - ) 2 E(B) =  V(B) =  2 /  (x i - ) 2 B is normally distributed with these parameters

10 For A use matrix formulation y = X  +  X is constant E  = 0 V(  ) =  2 I Normal equations X'Xb = X'y b = (X'X) -1 X'y if inverse exists =  + (X'X) -1 X'  E(b) =  V(b) =  2 (X'X) -1 b is normal with these parameters OR write Y i =  +  (x i - ) +  i

11 Distributions. normal t chi-squared F For formulas and discussion see Appendix D (on website)


Download ppt "Crime? FBI records violent crime, z x y z [1,] 58035 354.559 46 [2,] 120100 351.593 998 [3,] 102743 339.815 615 [4,] 117242 321.533 168 [5,] 137538."

Similar presentations


Ads by Google