|
|
|
||||
|
|
|||||
U.S. Census public use microdata (PUMS) observations have no codes for counties, cities or other small geographic areas. In order to select PUMS observations within an area, you must select observations within the range of Public Use Microdata Area (PUMA) codes which correspond to that area. If you want to perform an analysis on Los Angeles city, Los Angeles County, or the greater Los Angeles area, you would need to know the PUMA codes which compose these areas. This document shows the logical expressions which can be used to select these areas.
The City of Los Angeles is composed of the PUMAs ranging from 6501 to 6521. In SAS, the logical expression to specify this range of PUMA codes is
(6501 LE puma LE 6521)
This logical expression can be used in an IF statement in a DATA step, or in a WHERE statement in a PROC step, as shown in the examples below.
Example 1. Using an IF statement in a DATA step to create a temporary SAS data file composed just of those people living in the City of Los Angeles.
DATA lacity;
SET _census.ca90pump(KEEP = age pwgt1 puma);
IF (6501 LE puma LE 6521);
RUN;
Example 2. Using a WHERE statement in a PROC step to obtain the mean age of all those people living in the City of Los Angeles.
PROC MEANS DATA=_census.ca90pump;
WHERE (6501 LE puma LE 6521);
VAR age;
WEIGHT pwgt1;
RUN;
The PUMA codes for Los Angeles County range from 5200 to 6600. The SAS logical expression for this range is
(5200 LE puma LE 6600)
This logical expression could be used in an IF statement in a DATA step (such as Example 1) or a WHERE statement in a PROC step (such as Example 2).
The PUMA codes for the Los Angeles Consolidated Metropolitan Statistical Area (CMSA), which includes Los Angeles, Orange, Riverside, San Bernardino and Ventura Counties range from 4200 to 4808 and 5200 to 7206. This can be specified using the SAS logical expression
((4200 LE puma LE 4808) OR (5200 LE puma LE 7206))
The SAS logical expression to select each of the five counties in the Los Angeles CMSA
's is shown below.
Los Angeles County
(5200 LE puma LE 6600)
Orange County
(4200 LE puma LE 4808)
Riverside County
(6800 LE puma LE 6905)
San Bernardino County
(7000 LE puma LE 7206)
Ventura County
(6701 LE puma LE 6705)
Originally revised: 21 Jan 97
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services