Data for Exercise 9.11 and 9.17
Poverty
A data frame/tibble with 20 observations on four variables
a factor with levels Atlanta
,
Buffalo
, Cincinnati
, Cleveland
, Dayton, O
,
Detroit
, Flint, Mich
, Fresno, C
, Gary, Ind
,
Hartford, C
, Laredo
, Macon, Ga
, Miami
,
Milwaukee
, New Orleans
, Newark, NJ
, Rochester,NY
,
Shreveport
, St. Louis
, and Waco, Tx
percent of children living in poverty
crime rate (per 1000 people)
population of city
Children's Defense Fund and the Bureau of Justice Statistics.
Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.
plot(poverty ~ crime, data = Poverty)
model <- lm(poverty ~ crime, data = Poverty)
abline(model, col = "red")
summary(model)
#>
#> Call:
#> lm(formula = poverty ~ crime, data = Poverty)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -4.9540 -3.1121 -0.5467 2.5390 6.5606
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 39.116 1.858 21.052 3.97e-14 ***
#> crime 0.181 0.171 1.058 0.304
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 3.667 on 18 degrees of freedom
#> Multiple R-squared: 0.05857, Adjusted R-squared: 0.006268
#> F-statistic: 1.12 on 1 and 18 DF, p-value: 0.3039
#>
rm(model)