Last data update: 2014.03.03

R: Percent poverty and crime rate for selected cities
PovertyR Documentation

Percent poverty and crime rate for selected cities

Description

Data for Exercise 9.11 and 9.17

Usage

Poverty

Format

A data frame with 20 observations on the following 6 variables.

City

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 Waco, Tx

Poverty

a numeric vector

Crime

a numeric vector

cindex

a numeric vector

popu

a numeric vector

ratio

a numeric vector

Source

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Duxbury

Examples

str(Poverty)
attach(Poverty)
plot(Crime,Poverty)
model <- lm(Poverty~Crime)
abline(model)
summary(model)
detach(Poverty)
remove(model)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BSDA)
Loading required package: e1071
Loading required package: lattice

Attaching package: 'BSDA'

The following object is masked from 'package:datasets':

    Orange

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BSDA/Poverty.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Poverty
> ### Title: Percent poverty and crime rate for selected cities
> ### Aliases: Poverty
> ### Keywords: datasets
> 
> ### ** Examples
> 
> str(Poverty)
'data.frame':	20 obs. of  6 variables:
 $ City   : Factor w/ 20 levels "Atlanta","Buffalo",..: 6 11 15 7 13 10 9 4 1 5 ...
 $ Poverty: num  46.6 46.4 46.3 44.6 44.1 43.8 43 43 42.9 40.9 ...
 $ Crime  : int  13 4 9 12 17 12 8 7 18 6 ...
 $ cindex : int  1172 100 504 187 654 211 120 425 713 205 ...
 $ popu   : int  1027974 122893 496938 140925 358648 139739 116646 505616 393929 182005 ...
 $ ratio  : num  114 81.4 101.4 132.7 182.4 ...
> attach(Poverty)
The following objects are masked from package:BSDA:

    Crime, Poverty

> plot(Crime,Poverty)
> model <- lm(Poverty~Crime)
> abline(model)
> summary(model)

Call:
lm(formula = Poverty ~ Crime)

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

> detach(Poverty)
> remove(model)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>