[acs-r] accessing margin of error in acs.r

arilamstein@gmail.com arilamstein at gmail.com
Mon Feb 22 20:03:13 EST 2016


I am trying to create a data.frame of acs data with 3 columns: region (for
example county fips), estimate and margin.of.error. I'm starting with this
code:

counties = geo.make(state="*", county="*")
county_data = acs.fetch(geography=counties, table.number="B19301")
head(county_data)

I can construct the county fips code from county_data at geography

I can construct the estimates from estimate(county_data).

I am not sure how to get the margins of error. If I type
"head(county_data)" the estimates are printed along with the margins of
error. However, there does not seem to be a "margin.of.error" function to
strip out just the margins of error:

>head(county_data)
ACS DATA:
 2007 -- 2011 ;
  Estimates w/90% confidence intervals;
  for different intervals, see confint()
                        B19301_001
Autauga County, Alabama 25035 +/- 916
Baldwin County, Alabama 27217 +/- 591
Barbour County, Alabama 15899 +/- 883
Bibb County, Alabama    18462 +/- 1267
Blount County, Alabama  21185 +/- 862
Bullock County, Alabama 20678 +/- 3797

However, there does seem to be a standard.error function which provides the
 standard errors:

> head(standard.error(county_data))
                        B19301_001
Autauga County, Alabama   556.8389
Baldwin County, Alabama   359.2705
Barbour County, Alabama   536.7781
Bibb County, Alabama      770.2128
Blount County, Alabama    524.0122
Bullock County, Alabama  2308.2067

Can someone help me understand this discrepancy?

Also, it would be great if someone could provide guidance about which of
these metrics (margin of error vs standard deviation) is better to report
along with the esimate.

My situation is that I have a mapping package that uses the acs package to
get census data estimates as a data.frame and then maps it. I would like to
improve the package by making the data.frames also have an error metric.
But I'm confused about whether margin of error or standard error is the
best metric to include.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/acs-r/attachments/20160222/ef084953/attachment.html


More information about the acs-r mailing list