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

Ezra Haber Glenn eglenn at mit.edu
Mon Feb 22 20:12:04 EST 2016


The package keeps acs-class objects with geographies, estimates, and
standard.errors (not standard deviations -- lookup both to see the
difference).  When printing out such an object, the package
automatically converts the standard error to a 90% margin of error, by
multiplying it by 1.645.  (For other MOEs, you'd need to use a
different multiplier.) 

So for your table, you can use 1.645*standard.error(county_data) to
get the 90% MOEs.

--Ezra

At Mon, 22 Feb 2016 17:03:13 -0800, arilamstein wrote:
> 
> 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.
> 
> 

--
Ezra Haber Glenn, AICP
Department of Urban Studies and Planning
Massachusetts Institute of Technology
77 Massachusetts Ave., Room 7-337
Cambridge, MA 02139
eglenn at mit.edu 
http://dusp.mit.edu/faculty/ezra-glenn | http://eglenn.scripts.mit.edu/citystate/
617.253.2024 (w)
617.721.7131 (c)


More information about the acs-r mailing list