SE of census estimates from replicate weights

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SE of census estimates from replicate weights

Bud Bliss
Dear List,

I hope someone can provide a bit of guidance on this subject. I'm using Public Use Microdata Sample (PUMS) from the 2006-2008 American Community Survey to obtain population proportions by race and ethnicity. The Census Bureau provides two ways to obtain standard errors of the estimates for this data: a provided "design factor," or through the use of replicate weights. Design factors are only available for specific proportions, so they are of limited use. On the other hand, SPSS does not directly support the use of replicate weights. But I figured it would be easier for me to apply a bit of Python to the task than to ask permission to install some other software. Besides the fact that it seemed like a fun project ;-)

So the code below uses PUMS data from the two areas that cover our city (about 5,000 records). It calculates the appropriate proportions by race, then cycles through the 80 alternative weighting factors to produce proportions from each, adding the new proportions to a table of the previously calculated proportions as it goes. Surprisingly, it takes less than a minute to run.

Then I transpose the results and use descriptive statistics to generate the mean and SE from the collection of alternative proportions. For the Hispanic population, the result is 10.038 percent with SE = 0.039 (N=81, the range is 9.26 to 10.98). Finally, is it appropriate to say for a very non-technical audience that "the Hispanic proportion of the population is approximately 10%, and at a 95% confidence level, we can say that it is between 10.00 and 10.08" (which is to say plus or minus two times the SE)?

Thanks in advance for any suggestions!

Meredith (Bud) Bliss
Crime Analyst - Beaverton Police Dept.

==============================
#!/usr/bin/env python

"PUMS_SE_20100424.py -- Use this module to compile race \
proportions from PUMS. "

import sys
import os
import spss

spss.Submit("""
GET FILE='G:/Reference/OthrCensus/PUMS_OR_06-08.sav'.
DATASET NAME PUMSData WINDOW=FRONT.

DATASET ACTIVATE PUMSData  .
SELECT IF(AGEP GT 15).

WEIGHT
  BY PWGTP .

* Convert absurd race/ethnicity categories to an equally .
* absurd single race category .
COMPUTE RaceRec = 0 .
IF RAC1P EQ '1' RaceRec = 1 .
IF (RAC1P EQ '3' OR RAC1P EQ '4' OR  RAC1P EQ '5') RaceRec = 3 .
IF (RAC1P EQ '6' OR RAC1P EQ '7') RaceRec = 4 .
IF (RAC1P EQ '8' OR RAC1P EQ '9') RaceRec = 5 .
IF RACBLK EQ '1' RaceRec = 2 .
IF (HISP NE '01') RaceRec = 6 .
EXE .

* Define Variable Properties.
VALUE LABELS  RaceRec
     1  'White'
     2  'Black'
     3  'AIAN'
     4  'Asian P/I'
     5  'Mixed / Other'
     6  'Hispanic' .
EXECUTE.

OMS
/SELECT TABLES
/IF COMMANDS = ['Frequencies']  SUBTYPES = ['Frequencies']
/DESTINATION FORMAT = SAV
OUTFILE = 'G:/Reference/OthrCensus/PUMSFreq.sav'
VIEWER = NO  .

FREQUENCIES
  VARIABLES=RaceRec
  /ORDER=ANALYSIS .

OMSEND .

GET FILE 'G:/Reference/OthrCensus/PUMSFreq.sav'  .
DATASET NAME PUMSFreq  .
DATASET ACTIVATE PUMSFreq  .
DELETE VARIABLES Command_ Subtype_ Label_ Var1 Frequency ValidPercent CumulativePercent .
RENAME VARIABLES  (Var2=Race).
SAVE OUTFILE = 'G:/Reference/OthrCensus/PUMSFreq.sav'  .

DATASET CLOSE PUMSFreq  .
""" )

for count in range(1,81):
    spss.Submit("""
DATASET ACTIVATE PUMSData  .
WEIGHT OFF .
WEIGHT
  BY PWGTP%s .

OMS
/SELECT TABLES
/IF COMMANDS = ['Frequencies']  SUBTYPES = ['Frequencies']
/DESTINATION FORMAT = SAV
OUTFILE = 'G:/Reference/OthrCensus/PUMSFreqAlt.sav'
VIEWER = NO  .

FREQUENCIES
  VARIABLES=RaceRec
  /ORDER=  ANALYSIS .

OMSEND .

GET FILE 'G:/Reference/OthrCensus/PUMSFreqAlt.sav'  .
DATASET NAME PUMSFreqAlt  .
DATASET ACTIVATE PUMSFreqAlt  .
DELETE VARIABLES Command_ Subtype_ Label_ Var1 Frequency ValidPercent CumulativePercent .
RENAME VARIABLES  (Var2 Percent =Race Percent%s)   .
SORT CASES BY Race .
SAVE OUTFILE = 'G:/Reference/OthrCensus/PUMSFreqAlt.sav'  .
DATASET CLOSE PUMSFreqAlt  .

GET FILE 'G:/Reference/OthrCensus/PUMSFreq.sav'  .
DATASET NAME PUMSFreq  .
DATASET ACTIVATE PUMSFreq  .
SORT CASES BY Race .

MATCH FILES /FILE=*
 /TABLE='G:/Reference/OthrCensus/PUMSFreqAlt.sav'
 /BY Race .
EXECUTE .

SAVE OUTFILE = 'G:/Reference/OthrCensus/PUMSFreq.sav'  .

""" %(count,count))

print 'Success at last!'

======================================================================
PUBLIC RECORDS LAW DISCLOSURE

This e-mail is a public record of the City of Beaverton and is subject to public disclosure unless exempt from disclosure under Oregon Public Records Law.  This email is subject to the State Retention Schedule.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD