In the wake of the Great Recession of 2009, there has been a good deal of focus on employment statistics, one of the most important metrics policymakers use to gauge the overall strength of the economy. In the United States, the government measures unemployment using the Current Population Survey (CPS), which collects demographic and employment information from a wide range of Americans each month. In this exercise, we will employ the topics reviewed in the lectures as well as a few new techniques using the September 2013 version of this rich, nationally representative dataset (available online).
The observations in the dataset represent people surveyed in the September 2013 CPS who actually completed a survey. While the full dataset has 385 variables, in this exercise we will use a more compact version of the dataset, CPSData.csv, which has the following variables:
PeopleInHousehold: The number of people in the interviewee’s household.
Region: The census region where the interviewee lives.
State: The state where the interviewee lives.
MetroAreaCode: A code that identifies the metropolitan area in which the interviewee lives (missing if the interviewee does not live in a metropolitan area). The mapping from codes to names of metropolitan areas is provided in the file MetroAreaCodes.csv.
Age: The age, in years, of the interviewee. 80 represents people aged 80-84, and 85 represents people aged 85 and higher.
Married: The marriage status of the interviewee.
Sex: The sex of the interviewee.
Education: The maximum level of education obtained by the interviewee.
Race: The race of the interviewee.
Hispanic: Whether the interviewee is of Hispanic ethnicity.
CountryOfBirthCode: A code identifying the country of birth of the interviewee. The mapping from codes to names of countries is provided in the file CountryCodes.csv.
Citizenship: The United States citizenship status of the interviewee.
EmploymentStatus: The status of employment of the interviewee.
Industry: The industry of employment of the interviewee (only available if they are employed).
Load the dataset from CPSData.csv into a data frame called CPS, and view the dataset with the summary() and str() commands.
CPS = read.csv("Unit1/CPSData.csv")
summary(CPS)
PeopleInHousehold Region
Min. : 1.000 Midwest :30684
1st Qu.: 2.000 Northeast:25939
Median : 3.000 South :41502
Mean : 3.284 West :33177
3rd Qu.: 4.000
Max. :15.000
State MetroAreaCode Age
California :11570 Min. :10420 Min. : 0.00
Texas : 7077 1st Qu.:21780 1st Qu.:19.00
New York : 5595 Median :34740 Median :39.00
Florida : 5149 Mean :35075 Mean :38.83
Pennsylvania: 3930 3rd Qu.:41860 3rd Qu.:57.00
Illinois : 3912 Max. :79600 Max. :85.00
(Other) :94069 NA's :34238
Married Sex
Divorced :11151 Female:67481
Married :55509 Male :63821
Never Married:30772
Separated : 2027
Widowed : 6505
NA's :25338
Education
High school :30906
Bachelor's degree :19443
Some college, no degree:18863
No high school diploma :16095
Associate degree : 9913
(Other) :10744
NA's :25338
Race Hispanic
American Indian : 1433 Min. :0.0000
Asian : 6520 1st Qu.:0.0000
Black : 13913 Median :0.0000
Multiracial : 2897 Mean :0.1393
Pacific Islander: 618 3rd Qu.:0.0000
White :105921 Max. :1.0000
CountryOfBirthCode Citizenship
Min. : 57.00 Citizen, Native :116639
1st Qu.: 57.00 Citizen, Naturalized: 7073
Median : 57.00 Non-Citizen : 7590
Mean : 82.68
3rd Qu.: 57.00
Max. :555.00
EmploymentStatus
Disabled : 5712
Employed :61733
Not in Labor Force:15246
Retired :18619
Unemployed : 4203
NA's :25789
Industry
Educational and health services :15017
Trade : 8933
Professional and business services: 7519
Manufacturing : 6791
Leisure and hospitality : 6364
(Other) :21618
NA's :65060
str(CPS)
'data.frame': 131302 obs. of 14 variables:
$ PeopleInHousehold : int 1 3 3 3 3 3 3 2 2 2 ...
$ Region : Factor w/ 4 levels "Midwest","Northeast",..: 3 3 3 3 3 3 3 3 3 3 ...
$ State : Factor w/ 51 levels "Alabama","Alaska",..: 1 1 1 1 1 1 1 1 1 1 ...
$ MetroAreaCode : int 26620 13820 13820 13820 26620 26620 26620 33660 33660 26620 ...
$ Age : int 85 21 37 18 52 24 26 71 43 52 ...
$ Married : Factor w/ 5 levels "Divorced","Married",..: 5 3 3 3 5 3 3 1 1 3 ...
$ Sex : Factor w/ 2 levels "Female","Male": 1 2 1 2 1 2 2 1 2 2 ...
$ Education : Factor w/ 8 levels "Associate degree",..: 1 4 4 6 1 2 4 4 4 2 ...
$ Race : Factor w/ 6 levels "American Indian",..: 6 3 3 3 6 6 6 6 6 6 ...
$ Hispanic : int 0 0 0 0 0 0 0 0 0 0 ...
$ CountryOfBirthCode: int 57 57 57 57 57 57 57 57 57 57 ...
$ Citizenship : Factor w/ 3 levels "Citizen, Native",..: 1 1 1 1 1 1 1 1 1 1 ...
$ EmploymentStatus : Factor w/ 5 levels "Disabled","Employed",..: 4 5 1 3 2 2 2 2 3 2 ...
$ Industry : Factor w/ 14 levels "Agriculture, forestry, fishing, and hunting",..: NA 11 NA NA 11 4 14 4 NA 12 ...
Among the interviewees with a value reported for the Industry variable, what is the most common industry of employment? Please enter the name exactly how you see it.
ANSWER: Educational and health services
Recall from the homework assignment “The Analytical Detective” that you can call the sort() function on the output of the table() function to obtain a sorted breakdown of a variable. For instance, sort(table(CPS$Region)) sorts the regions by the number of interviewees from that region.
Which state has the fewest interviewees?
sort(table(CPS$Region))
Northeast Midwest West South
25939 30684 33177 41502
Which state has the largest number of interviewees?
ANSWER: South
What proportion of interviewees are citizens of the United States?
7590/(116639+7073)
[1] 0.06135217
The CPS differentiates between race (with possible values American Indian, Asian, Black, Pacific Islander, White, or Multiracial) and ethnicity. A number of interviewees are of Hispanic ethnicity, as captured by the Hispanic variable. For which races are there at least 250 interviewees in the CPS dataset of Hispanic ethnicity? (Select all that apply.)
table(CPS$Race,CPS$Hispanic)
0 1
American Indian 1129 304
Asian 6407 113
Black 13292 621
Multiracial 2449 448
Pacific Islander 541 77
White 89190 16731
Which variables have at least one interviewee with a missing (NA) value? (Select all that apply.)
summary(CPS)
PeopleInHousehold Region
Min. : 1.000 Midwest :30684
1st Qu.: 2.000 Northeast:25939
Median : 3.000 South :41502
Mean : 3.284 West :33177
3rd Qu.: 4.000
Max. :15.000
State MetroAreaCode Age
California :11570 Min. :10420 Min. : 0.00
Texas : 7077 1st Qu.:21780 1st Qu.:19.00
New York : 5595 Median :34740 Median :39.00
Florida : 5149 Mean :35075 Mean :38.83
Pennsylvania: 3930 3rd Qu.:41860 3rd Qu.:57.00
Illinois : 3912 Max. :79600 Max. :85.00
(Other) :94069 NA's :34238
Married Sex
Divorced :11151 Female:67481
Married :55509 Male :63821
Never Married:30772
Separated : 2027
Widowed : 6505
NA's :25338
Education
High school :30906
Bachelor's degree :19443
Some college, no degree:18863
No high school diploma :16095
Associate degree : 9913
(Other) :10744
NA's :25338
Race Hispanic
American Indian : 1433 Min. :0.0000
Asian : 6520 1st Qu.:0.0000
Black : 13913 Median :0.0000
Multiracial : 2897 Mean :0.1393
Pacific Islander: 618 3rd Qu.:0.0000
White :105921 Max. :1.0000
CountryOfBirthCode Citizenship
Min. : 57.00 Citizen, Native :116639
1st Qu.: 57.00 Citizen, Naturalized: 7073
Median : 57.00 Non-Citizen : 7590
Mean : 82.68
3rd Qu.: 57.00
Max. :555.00
EmploymentStatus
Disabled : 5712
Employed :61733
Not in Labor Force:15246
Retired :18619
Unemployed : 4203
NA's :25789
Industry
Educational and health services :15017
Trade : 8933
Professional and business services: 7519
Manufacturing : 6791
Leisure and hospitality : 6364
(Other) :21618
NA's :65060
Often when evaluating a new dataset, we try to identify if there is a pattern in the missing values in the dataset. We will try to determine if there is a pattern in the missing values of the Married variable. The function
is.na(CPS$Married)
returns a vector of TRUE/FALSE values for whether the Married variable is missing. We can see the breakdown of whether Married is missing based on the reported value of the Region variable with the function
table(CPS$Region, is.na(CPS$Married))
Which is the most accurate:
is.na(CPS$Married)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[9] FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
[17] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[25] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
[33] FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE
[41] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
[49] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[57] TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE
[65] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[81] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE
[89] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
[97] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
[105] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[113] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[121] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
[129] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[137] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[145] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
[153] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[161] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[169] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[177] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[185] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE
[193] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[201] FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE
[209] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE
[217] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[225] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE
[233] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[241] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[249] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[257] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
[265] FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE
[273] FALSE FALSE FALSE TRUE FALSE FALSE TRUE TRUE
[281] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[289] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE
[297] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[305] FALSE FALSE TRUE TRUE FALSE TRUE FALSE FALSE
[313] FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE
[321] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
[329] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
[337] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[345] FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE
[353] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE
[361] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[369] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[377] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[385] FALSE TRUE TRUE FALSE FALSE TRUE TRUE TRUE
[393] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE
[401] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
[409] FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE
[417] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
[425] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[433] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[441] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[449] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[457] FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE
[465] TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE
[473] TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
[481] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE
[489] FALSE FALSE TRUE FALSE FALSE TRUE TRUE TRUE
[497] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[505] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[513] FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE
[521] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[529] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[537] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[545] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[553] FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE
[561] TRUE TRUE FALSE FALSE TRUE FALSE FALSE TRUE
[569] TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[577] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[585] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
[593] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[601] FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE
[609] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[617] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[625] FALSE FALSE TRUE FALSE FALSE TRUE TRUE FALSE
[633] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
[641] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[649] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[657] FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE
[665] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[673] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE
[681] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[689] FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
[697] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[705] FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE
[713] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[721] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[729] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE
[737] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[745] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE
[753] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[761] TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[769] FALSE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
[777] FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE
[785] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[793] FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE
[801] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[809] FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE
[817] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[825] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE
[833] FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE
[841] TRUE FALSE FALSE TRUE TRUE TRUE FALSE TRUE
[849] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[857] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
[865] FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE
[873] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[881] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[889] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[897] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[905] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[913] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
[921] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[929] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE
[937] FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE
[945] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[953] FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE
[961] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[969] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[977] FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE
[985] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
[993] FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE
[ reached getOption("max.print") -- omitted 130302 entries ]
table(CPS$Region, is.na(CPS$Married))
FALSE TRUE
Midwest 24609 6075
Northeast 21432 4507
South 33535 7967
West 26388 6789
As mentioned in the variable descriptions, MetroAreaCode is missing if an interviewee does not live in a metropolitan area. Using the same technique as in the previous question, answer the following questions about people who live in non-metropolitan areas.
How many states had all interviewees living in a non-metropolitan area (aka they have a missing MetroAreaCode value)? For this question, treat the District of Columbia as a state (even though it is not technically a state).
table(CPS$State, is.na(CPS$MetroAreaCode))
FALSE TRUE
Alabama 1020 356
Alaska 0 1590
Arizona 1327 201
Arkansas 724 697
California 11333 237
Colorado 2545 380
Connecticut 2593 243
Delaware 1696 518
District of Columbia 1791 0
Florida 4947 202
Georgia 2250 557
Hawaii 1576 523
Idaho 761 757
Illinois 3473 439
Indiana 1420 584
Iowa 1297 1231
Kansas 1234 701
Kentucky 908 933
Louisiana 1216 234
Maine 909 1354
Maryland 2978 222
Massachusetts 1858 129
Michigan 2517 546
Minnesota 2150 989
Mississippi 376 854
Missouri 1440 705
Montana 199 1015
Nebraska 816 1133
Nevada 1609 247
New Hampshire 1148 1514
New Jersey 2567 0
New Mexico 832 270
New York 5144 451
North Carolina 1642 977
North Dakota 432 1213
Ohio 2754 924
Oklahoma 1024 499
Oregon 1519 424
Pennsylvania 3245 685
Rhode Island 2209 0
South Carolina 1139 519
South Dakota 595 1405
Tennessee 1149 635
Texas 6060 1017
Utah 1455 387
Vermont 657 1233
Virginia 2367 586
Washington 1937 429
West Virginia 344 1065
Wisconsin 1882 804
Wyoming 0 1624
How many states had all interviewees living in a metropolitan area? Again, treat the District of Columbia as a state.
ANSWER: Three states had all interviewees living in a metropolitan area.
Which region of the United States has the largest proportion of interviewees living in a non-metropolitan area?
table(CPS$Region, is.na(CPS$MetroAreaCode))
FALSE TRUE
Midwest 20010 10674
Northeast 20330 5609
South 31631 9871
West 25093 8084
10674/(10674+20010)
[1] 0.3478686
5609/(5609+20330)
[1] 0.2162381
9871/(9871+31631)
[1] 0.237844
8084/(8084+25093)
[1] 0.2436628
ANSWER:Midwest
錯誤: 找不到物件 'ANSWER'
While we were able to use the table() command to compute the proportion of interviewees from each region not living in a metropolitan area, it was somewhat tedious (it involved manually computing the proportion for each region) and isn’t something you would want to do if there were a larger number of options. It turns out there is a less tedious way to compute the proportion of values that are TRUE. The mean() function, which takes the average of the values passed to it, will treat TRUE as 1 and FALSE as 0, meaning it returns the proportion of values that are true. For instance, mean(c(TRUE, FALSE, TRUE, TRUE)) returns 0.75. Knowing this, use tapply() with the mean function to answer the following questions:
Which state has a proportion of interviewees living in a non-metropolitan area closest to 30%?
sort(tapply(is.na(CPS$MetroAreaCode), CPS$State, mean))
District of Columbia New Jersey
0.00000000 0.00000000
Rhode Island California
0.00000000 0.02048401
Florida Massachusetts
0.03923092 0.06492199
Maryland New York
0.06937500 0.08060769
Connecticut Illinois
0.08568406 0.11221881
Colorado Arizona
0.12991453 0.13154450
Nevada Texas
0.13308190 0.14370496
Louisiana Pennsylvania
0.16137931 0.17430025
Michigan Washington
0.17825661 0.18131868
Georgia Virginia
0.19843249 0.19844226
Utah Oregon
0.21009772 0.21821925
Delaware New Mexico
0.23396567 0.24500907
Hawaii Ohio
0.24916627 0.25122349
Alabama Indiana
0.25872093 0.29141717
Wisconsin South Carolina
0.29932986 0.31302774
Minnesota Oklahoma
0.31506849 0.32764281
Missouri Tennessee
0.32867133 0.35594170
Kansas North Carolina
0.36227390 0.37304315
Iowa Arkansas
0.48694620 0.49049965
Idaho Kentucky
0.49868248 0.50678979
New Hampshire Nebraska
0.56874530 0.58132376
Maine Vermont
0.59832081 0.65238095
Mississippi South Dakota
0.69430894 0.70250000
North Dakota West Virginia
0.73738602 0.75585522
Montana Alaska
0.83607908 1.00000000
Wyoming
1.00000000
Which state has the largest proportion of non-metropolitan interviewees, ignoring states where all interviewees were non-metropolitan?
Montana
錯誤: 找不到物件 'Montana'
Codes like MetroAreaCode and CountryOfBirthCode are a compact way to encode factor variables with text as their possible values, and they are therefore quite common in survey datasets. In fact, all but one of the variables in this dataset were actually stored by a numeric code in the original CPS datafile.
When analyzing a variable stored by a numeric code, we will often want to convert it into the values the codes represent. To do this, we will use a dictionary, which maps the the code to the actual value of the variable. We have provided dictionaries MetroAreaCodes.csv and CountryCodes.csv, which respectively map MetroAreaCode and CountryOfBirthCode into their true values. Read these two dictionaries into data frames MetroAreaMap and CountryMap.
How many observations (codes for metropolitan areas) are there in MetroAreaMap?
MetroAreaMap = read.csv("Unit1/MetroAreaCodes.csv")
CountryMap = read.csv("Unit1/CountryCodes.csv")
str(MetroAreaMap)
'data.frame': 271 obs. of 2 variables:
$ Code : int 460 3000 3160 3610 3720 6450 10420 10500 10580 10740 ...
$ MetroArea: Factor w/ 271 levels "Akron, OH","Albany-Schenectady-Troy, NY",..: 12 92 97 117 122 195 1 3 2 4 ...
How many observations (codes for countries) are there in CountryMap?
str(CountryMap)
'data.frame': 149 obs. of 2 variables:
$ Code : int 57 66 73 78 96 100 102 103 104 105 ...
$ Country: Factor w/ 149 levels "Afghanistan",..: 139 57 105 135 97 3 11 18 24 37 ...
To merge in the metropolitan areas, we want to connect the field MetroAreaCode from the CPS data frame with the field Code in MetroAreaMap. The following command merges the two data frames on these columns, overwriting the CPS data frame with the result:
CPS = merge(CPS, MetroAreaMap, by.x="MetroAreaCode", by.y="Code", all.x=TRUE)
The first two arguments determine the data frames to be merged (they are called “x” and “y”, respectively, in the subsequent parameters to the merge function). by.x=“MetroAreaCode” means we’re matching on the MetroAreaCode variable from the “x” data frame (CPS), while by.y=“Code” means we’re matching on the Code variable from the “y” data frame (MetroAreaMap). Finally, all.x=TRUE means we want to keep all rows from the “x” data frame (CPS), even if some of the rows’ MetroAreaCode doesn’t match any codes in MetroAreaMap (for those familiar with database terminology, this parameter makes the operation a left outer join instead of an inner join).
Review the new version of the CPS data frame with the summary() and str() functions. What is the name of the variable that was added to the data frame by the merge() operation?
summary(CPS)
MetroAreaCode PeopleInHousehold Region
Min. :10420 Min. : 1.000 Midwest :30684
1st Qu.:21780 1st Qu.: 2.000 Northeast:25939
Median :34740 Median : 3.000 South :41502
Mean :35075 Mean : 3.284 West :33177
3rd Qu.:41860 3rd Qu.: 4.000
Max. :79600 Max. :15.000
NA's :34238
State Age
California :11570 Min. : 0.00
Texas : 7077 1st Qu.:19.00
New York : 5595 Median :39.00
Florida : 5149 Mean :38.83
Pennsylvania: 3930 3rd Qu.:57.00
Illinois : 3912 Max. :85.00
(Other) :94069
Married Sex
Divorced :11151 Female:67481
Married :55509 Male :63821
Never Married:30772
Separated : 2027
Widowed : 6505
NA's :25338
Education
High school :30906
Bachelor's degree :19443
Some college, no degree:18863
No high school diploma :16095
Associate degree : 9913
(Other) :10744
NA's :25338
Race Hispanic
American Indian : 1433 Min. :0.0000
Asian : 6520 1st Qu.:0.0000
Black : 13913 Median :0.0000
Multiracial : 2897 Mean :0.1393
Pacific Islander: 618 3rd Qu.:0.0000
White :105921 Max. :1.0000
CountryOfBirthCode Citizenship
Min. : 57.00 Citizen, Native :116639
1st Qu.: 57.00 Citizen, Naturalized: 7073
Median : 57.00 Non-Citizen : 7590
Mean : 82.68
3rd Qu.: 57.00
Max. :555.00
EmploymentStatus
Disabled : 5712
Employed :61733
Not in Labor Force:15246
Retired :18619
Unemployed : 4203
NA's :25789
Industry
Educational and health services :15017
Trade : 8933
Professional and business services: 7519
Manufacturing : 6791
Leisure and hospitality : 6364
(Other) :21618
NA's :65060
MetroArea
New York-Northern New Jersey-Long Island, NY-NJ-PA: 5409
Washington-Arlington-Alexandria, DC-VA-MD-WV : 4177
Los Angeles-Long Beach-Santa Ana, CA : 4102
Philadelphia-Camden-Wilmington, PA-NJ-DE : 2855
Chicago-Naperville-Joliet, IN-IN-WI : 2772
(Other) :77749
NA's :34238
str(CPS)
'data.frame': 131302 obs. of 15 variables:
$ MetroAreaCode : int 10420 10420 10420 10420 10420 10420 10420 10420 10420 10420 ...
$ PeopleInHousehold : int 4 4 2 4 1 3 4 4 2 3 ...
$ Region : Factor w/ 4 levels "Midwest","Northeast",..: 1 1 1 1 1 1 1 1 1 1 ...
$ State : Factor w/ 51 levels "Alabama","Alaska",..: 36 36 36 36 36 36 36 36 36 36 ...
$ Age : int 2 9 73 40 63 19 30 6 60 32 ...
$ Married : Factor w/ 5 levels "Divorced","Married",..: NA NA 2 2 3 3 2 NA 2 2 ...
$ Sex : Factor w/ 2 levels "Female","Male": 2 2 1 1 2 1 1 1 1 2 ...
$ Education : Factor w/ 8 levels "Associate degree",..: NA NA 8 4 6 4 2 NA 4 4 ...
$ Race : Factor w/ 6 levels "American Indian",..: 6 6 6 6 6 6 2 6 6 6 ...
$ Hispanic : int 0 0 0 0 0 0 0 1 0 0 ...
$ CountryOfBirthCode: int 57 57 57 362 57 57 203 57 57 57 ...
$ Citizenship : Factor w/ 3 levels "Citizen, Native",..: 1 1 1 2 1 1 3 1 1 1 ...
$ EmploymentStatus : Factor w/ 5 levels "Disabled","Employed",..: NA NA 4 3 1 2 3 NA 2 2 ...
$ Industry : Factor w/ 14 levels "Agriculture, forestry, fishing, and hunting",..: NA NA NA NA NA 7 NA NA 4 13 ...
$ MetroArea : Factor w/ 271 levels "Akron, OH","Albany-Schenectady-Troy, NY",..: 1 1 1 1 1 1 1 1 1 1 ...
How many interviewees have a missing value for the new metropolitan area variable? Note that all of these interviewees would have been removed from the merged data frame if we did not include the all.x=TRUE parameter.
summary(CPS)
MetroAreaCode PeopleInHousehold Region
Min. :10420 Min. : 1.000 Midwest :30684
1st Qu.:21780 1st Qu.: 2.000 Northeast:25939
Median :34740 Median : 3.000 South :41502
Mean :35075 Mean : 3.284 West :33177
3rd Qu.:41860 3rd Qu.: 4.000
Max. :79600 Max. :15.000
NA's :34238
State Age
California :11570 Min. : 0.00
Texas : 7077 1st Qu.:19.00
New York : 5595 Median :39.00
Florida : 5149 Mean :38.83
Pennsylvania: 3930 3rd Qu.:57.00
Illinois : 3912 Max. :85.00
(Other) :94069
Married Sex
Divorced :11151 Female:67481
Married :55509 Male :63821
Never Married:30772
Separated : 2027
Widowed : 6505
NA's :25338
Education
High school :30906
Bachelor's degree :19443
Some college, no degree:18863
No high school diploma :16095
Associate degree : 9913
(Other) :10744
NA's :25338
Race Hispanic
American Indian : 1433 Min. :0.0000
Asian : 6520 1st Qu.:0.0000
Black : 13913 Median :0.0000
Multiracial : 2897 Mean :0.1393
Pacific Islander: 618 3rd Qu.:0.0000
White :105921 Max. :1.0000
CountryOfBirthCode Citizenship
Min. : 57.00 Citizen, Native :116639
1st Qu.: 57.00 Citizen, Naturalized: 7073
Median : 57.00 Non-Citizen : 7590
Mean : 82.68
3rd Qu.: 57.00
Max. :555.00
EmploymentStatus
Disabled : 5712
Employed :61733
Not in Labor Force:15246
Retired :18619
Unemployed : 4203
NA's :25789
Industry
Educational and health services :15017
Trade : 8933
Professional and business services: 7519
Manufacturing : 6791
Leisure and hospitality : 6364
(Other) :21618
NA's :65060
MetroArea
New York-Northern New Jersey-Long Island, NY-NJ-PA: 5409
Washington-Arlington-Alexandria, DC-VA-MD-WV : 4177
Los Angeles-Long Beach-Santa Ana, CA : 4102
Philadelphia-Camden-Wilmington, PA-NJ-DE : 2855
Chicago-Naperville-Joliet, IN-IN-WI : 2772
(Other) :77749
NA's :34238
Which of the following metropolitan areas has the largest number of interviewees?
sort(table(CPS$MetroArea))
Appleton-Oshkosh-Neenah, WI
0
Grand Rapids-Muskegon-Holland, MI
0
Greenville-Spartanburg-Anderson, SC
0
Hinesville-Fort Stewart, GA
0
Jamestown, NY
0
Kalamazoo-Battle Creek, MI
0
Portsmouth-Rochester, NH-ME
0
Bowling Green, KY
29
Ocean City, NJ
30
Springfield, OH
34
Bloomington-Normal IL
40
Valdosta, GA
42
Warner Robins, GA
42
Tallahassee, FL
43
Columbia, MO
47
Punta Gorda, FL
48
Midland, TX
51
Niles-Benton Harbor, MI
51
Johnson City, TN
52
Santa Fe, NM
52
Prescott, AZ
54
Vineland-Millville-Bridgeton, NJ
54
Hickory-Morgantown-Lenoir, NC
57
Madera, CA
57
Columbus, GA-AL
59
Joplin, MO
59
Panama City-Lynn Haven, FL
59
Chico, CA
60
Anniston-Oxford, AL
61
Napa, CA
61
Anderson, IN
62
Florence, AL
63
Jacksonville, NC
63
Johnstown, PA
63
Lubbock, TX
63
Monroe, MI
63
Anderson, SC
64
Farmington, NM
64
Athens-Clark County, GA
65
Gulfport-Biloxi, MS
65
Longview, TX
65
Macon, GA
65
Leominster-Fitchburg-Gardner, MA
66
Roanoke, VA
66
Santa-Cruz-Watsonville, CA
66
Kingsport-Bristol, TN-VA
67
Albany, GA
68
Bellingham, WA
70
Gainesville, FL
70
Jackson, MI
70
Binghamton, NY
73
Lynchburg, VA
73
Saginaw-Saginaw Township North, MI
74
Salisbury, MD
74
Barnstable Town, MA
75
Ocala, FL
76
Springfield, IL
76
Fayetteville, NC
77
Michigan City-La Porte, IN
77
San Luis Obispo-Paso Robles, CA
77
Holland-Grand Haven, MI
78
Tuscaloosa, AL
78
Brownsville-Harlingen, TX
79
Vero Beach, FL
79
Waco, TX
79
Fort Walton Beach-Crestview-Destin, FL
80
Utica-Rome, NY
80
Decatur, IL
81
Lake Charles, LA
81
South Bend-Mishawaka, IN-MI
81
Altoona, PA
82
Huntington-Ashland, WV-KY-OH
82
Medford, OR
82
Naples-Marco Island, FL
82
St. Cloud, MN
82
Ann Arbor, MI
85
Oshkosh-Neenah, WI
85
Hagerstown-Martinsburg, MD-WV
86
Bremerton-Silverdale, WA
87
Erie, PA
87
Kankakee-Bradley, IL
87
Kingston, NY
87
Amarillo, TX
88
Laredo, TX
89
Harrisonburg, VA
90
Muskegon-Norton Shores, MI
90
Trenton-Ewing, NJ
91
Decatur, Al
96
Wausau, WI
96
Lawton, OK
97
Lawrence, KS
98
El Centro, CA
99
Evansville, IN-KY
99
Janesville, WI
99
Olympia, WA
99
Spartanburg, SC
99
Killeen-Temple-Fort Hood, TX
101
Flint, MI
102
Myrtle Beach-Conway-North Myrtle Beach, SC
102
Montgomery, AL
103
Bloomington, IN
104
Salinas, CA
104
Fort Smith, AR-OK
105
Merced, CA
106
Las Cruses, NM
107
Pensacola-Ferry Pass-Brent, FL
107
Port St. Lucie-Fort Pierce, FL
109
Eau Claire, WI
110
Mobile, AL
110
Atlantic City, NJ
111
Danbury, CT
112
Peoria, IL
112
Yakima, WA
112
La Crosse, WI
114
Rockford, IL
114
Asheville, NC
116
Victoria, TX
116
Coeur d'Alene, ID
117
Huntsville, AL
117
York-Hanover, PA
117
Canton-Massillon, OH
118
Lansing-East Lansing, MI
119
Racine, WI
119
Visalia-Porterville, CA
121
Champaign-Urbana, IL
122
Beaumont-Port Author, TX
123
Appleton,WI
125
Duluth, MN-WI
126
Kalamazoo-Portage, MI
127
Winston-Salem, NC
127
Santa Rosa-Petaluma, CA
129
Pueblo, CO
130
Iowa City, IA
131
Corpus Christi, TX
132
Santa Barbara-Santa Maria-Goleta, CA
132
Vallejo-Fairfield, CA
133
Fort Wayne, IN
136
Green Bay, WI
136
Bend, OR
140
Deltona-Daytona Beach-Ormond Beach, FL
140
Reading, PA
142
Worcester, MA-CT
144
Cape Coral-Fort Myers, FL
146
Shreveport-Bossier City, LA
146
Lakeland-Winter Haven, FL
149
Youngstown-Warren-Boardman, OH
153
Springfield, MA-CT
155
Lancaster, PA
156
Spokane, WA
156
Waterloo-Cedar Falls, IA
156
Waterbury, CT
157
Modesto, CA
158
Augusta-Richmond County, GA-SC
161
Springfield, MO
161
Greeley, CO
162
Chattanooga, TN-GA
167
Knoxville, TN
168
Palm Bay-Melbourne-Titusville, FL
168
Salem, OR
170
Boulder, CO
171
Harrisburg-Carlisle, PA
174
Scranton-Wilkes Barre, PA
176
Monroe, LA
179
Lafayette, LA
181
Topeka, KS
182
Greenville, SC
185
Durham, NC
189
Sarasota-Bradenton-Venice, FL
192
Stockton, CA
193
McAllen-Edinburg-Pharr, TX
195
Cedar Rapids, IA
196
Eugene-Springfield, OR
196
Lexington-Fayette, KY
198
Billings, MT
199
Poughkeepsie-Newburgh-Middletown, NY
201
Savannah, GA
202
Norwich-New London, CT-RI
203
Fort Collins-Loveland, CO
206
Bangor, ME
208
Fayetteville-Springdale-Rogers, AR-MO
215
Jackson, MS
222
Syracuse, NY
223
Akron, OH
231
Charleston-North Charleston, SC
232
Toledo, OH
235
Davenport-Moline-Rock Island, IA-IL
240
El Paso, TX
244
Bakersfield, CA
245
Greensboro-High Point, NC
251
Baton Rouge, LA
262
Charleston, WV
262
Rochester-Dover, NH-ME
262
Oxnard-Thousand Oaks-Ventura, CA
267
Albany-Schenectady-Troy, NY
268
Dayton, OH
268
Madison, WI
284
Columbia, SC
291
Tucson, AZ
302
Fresno, CA
303
Grand Rapids-Wyoming, MI
304
Rochester, NY
307
Provo-Orem, UT
309
Reno-Sparks, NV
310
Tulsa, OK
323
Allentown-Bethlehem-Easton, PA-NJ
334
Raleigh-Cary, NC
336
Buffalo-Niagara Falls, NY
344
Memphis, TN-MS-AR
348
New Orleans-Metairie-Kenner, LA
367
Colorado Springs, CO
372
Birmingham-Hoover, AL
392
Jacksonville, FL
393
Little Rock-North Little Rock, AR
404
Ogden-Clearfield, UT
423
Wichita, KS
427
Fargo, ND-MN
432
Dover, DE
456
Richmond, VA
490
Des Moines, IA
501
Nashville-Davidson-Murfreesboro, TN
505
New Haven, CT
506
Austin-Round Rock, TX
516
Charlotte-Gastonia-Concord, NC-SC
517
Louisville, KY-IN
519
Columbus, OH
551
Indianapolis, IN
570
Sioux Falls, SD
595
Virginia Beach-Norfolk-Newport News, VA-NC
597
Oklahoma City, OK
604
San Antonio, TX
607
Albuquerque, NM
609
Orlando, FL
610
Boise City-Nampa, ID
644
Burlington-South Burlington, VT
657
Sacramento-Arden-Arcade-Roseville, CA
667
San Jose-Sunnyvale-Santa Clara, CA
670
Cleveland-Elyria-Mentor, OH
681
Portland-South Portland, ME
701
Milwaukee-Waukesha-West Allis, WI
714
Cincinnati-Middletown, OH-KY-IN
719
Salt Lake City, UT
723
Bridgeport-Stamford-Norwalk, CT
730
Pittsburgh, PA
732
Tampa-St. Petersburg-Clearwater, FL
842
Hartford-West Hartford-East Hartford, CT
885
San Diego-Carlsbad-San Marcos, CA
907
St. Louis, MO-IL
956
Omaha-Council Bluffs, NE-IA
957
Kansas City, MO-KS
962
Phoenix-Mesa-Scottsdale, AZ
971
Portland-Vancouver-Beaverton, OR-WA
1089
Seattle-Tacoma-Bellevue, WA
1255
Riverside-San Bernardino, CA
1290
Las Vegas-Paradise, NV
1299
Detroit-Warren-Livonia, MI
1354
San Francisco-Oakland-Fremont, CA
1386
Baltimore-Towson, MD
1483
Denver-Aurora, CO
1504
Atlanta-Sandy Springs-Marietta, GA
1552
Miami-Fort Lauderdale-Miami Beach, FL
1554
Honolulu, HI
1576
Houston-Baytown-Sugar Land, TX
1649
Dallas-Fort Worth-Arlington, TX
1863
Minneapolis-St Paul-Bloomington, MN-WI
1942
Boston-Cambridge-Quincy, MA-NH
2229
Providence-Fall River-Warwick, MA-RI
2284
Chicago-Naperville-Joliet, IN-IN-WI
2772
Philadelphia-Camden-Wilmington, PA-NJ-DE
2855
Los Angeles-Long Beach-Santa Ana, CA
4102
Washington-Arlington-Alexandria, DC-VA-MD-WV
4177
New York-Northern New Jersey-Long Island, NY-NJ-PA
5409
Which metropolitan area has the highest proportion of interviewees of Hispanic ethnicity? Hint: Use tapply() with mean, as in the previous subproblem. Calling sort() on the output of tapply() could also be helpful here.
sort(tapply(CPS$Hispanic,CPS$MetroArea,mean))
Anderson, SC
0.000000000
Ann Arbor, MI
0.000000000
Barnstable Town, MA
0.000000000
Bloomington-Normal IL
0.000000000
Bloomington, IN
0.000000000
Bowling Green, KY
0.000000000
Decatur, IL
0.000000000
Eau Claire, WI
0.000000000
Florence, AL
0.000000000
Hagerstown-Martinsburg, MD-WV
0.000000000
Harrisonburg, VA
0.000000000
Huntington-Ashland, WV-KY-OH
0.000000000
Huntsville, AL
0.000000000
Jackson, MI
0.000000000
Johnstown, PA
0.000000000
Macon, GA
0.000000000
Mobile, AL
0.000000000
Salisbury, MD
0.000000000
Savannah, GA
0.000000000
Warner Robins, GA
0.000000000
Dayton, OH
0.003731343
Monroe, LA
0.005586592
Knoxville, TN
0.005952381
Charleston, WV
0.007633588
Appleton,WI
0.008000000
Jackson, MS
0.009009009
Burlington-South Burlington, VT
0.009132420
Montgomery, AL
0.009708738
Wausau, WI
0.010416667
Portland-South Portland, ME
0.011412268
Oshkosh-Neenah, WI
0.011764706
Altoona, PA
0.012195122
St. Cloud, MN
0.012195122
Holland-Grand Haven, MI
0.012820513
Akron, OH
0.012987013
Springfield, IL
0.013157895
Bellingham, WA
0.014285714
Bangor, ME
0.014423077
Kingsport-Bristol, TN-VA
0.014925373
Cedar Rapids, IA
0.015306122
Gulfport-Biloxi, MS
0.015384615
Duluth, MN-WI
0.015873016
Pittsburgh, PA
0.016393443
Joplin, MO
0.016949153
Charleston-North Charleston, SC
0.017241379
Buffalo-Niagara Falls, NY
0.017441860
La Crosse, WI
0.017543860
Niles-Benton Harbor, MI
0.019607843
Evansville, IN-KY
0.020202020
Spartanburg, SC
0.020202020
Bend, OR
0.021428571
Muskegon-Norton Shores, MI
0.022222222
Erie, PA
0.022988506
Harrisburg-Carlisle, PA
0.022988506
Madison, WI
0.024647887
Lake Charles, LA
0.024691358
Fargo, ND-MN
0.025462963
Coeur d'Alene, ID
0.025641026
Spokane, WA
0.025641026
Saginaw-Saginaw Township North, MI
0.027027027
Lynchburg, VA
0.027397260
Pensacola-Ferry Pass-Brent, FL
0.028037383
Memphis, TN-MS-AR
0.028735632
Springfield, OH
0.029411765
Billings, MT
0.030150754
Janesville, WI
0.030303030
Roanoke, VA
0.030303030
St. Louis, MO-IL
0.030334728
Iowa City, IA
0.030534351
Rochester-Dover, NH-ME
0.030534351
Kalamazoo-Portage, MI
0.031496063
Youngstown-Warren-Boardman, OH
0.032679739
Champaign-Urbana, IL
0.032786885
Toledo, OH
0.034042553
Fort Wayne, IN
0.036764706
Little Rock-North Little Rock, AR
0.037128713
Detroit-Warren-Livonia, MI
0.037666174
Greenville, SC
0.037837838
Baton Rouge, LA
0.038167939
Johnson City, TN
0.038461538
Louisville, KY-IN
0.038535645
Michigan City-La Porte, IN
0.038961039
Flint, MI
0.039215686
Cincinnati-Middletown, OH-KY-IN
0.040333797
Lexington-Fayette, KY
0.040404040
Lawrence, KS
0.040816327
Albany-Schenectady-Troy, NY
0.041044776
Binghamton, NY
0.041095890
Punta Gorda, FL
0.041666667
Sioux Falls, SD
0.042016807
Columbia, MO
0.042553191
York-Hanover, PA
0.042735043
Gainesville, FL
0.042857143
Richmond, VA
0.042857143
Springfield, MO
0.043478261
Columbus, OH
0.043557169
Rockford, IL
0.043859649
Albany, GA
0.044117647
Sarasota-Bradenton-Venice, FL
0.046875000
Valdosta, GA
0.047619048
Anniston-Oxford, AL
0.049180328
South Bend-Mishawaka, IN-MI
0.049382716
Virginia Beach-Norfolk-Newport News, VA-NC
0.050251256
Minneapolis-St Paul-Bloomington, MN-WI
0.052008239
Decatur, Al
0.052083333
Birmingham-Hoover, AL
0.053571429
Palm Bay-Melbourne-Titusville, FL
0.053571429
Winston-Salem, NC
0.055118110
Dover, DE
0.057017544
Bremerton-Silverdale, WA
0.057471264
Rochester, NY
0.058631922
Myrtle Beach-Conway-North Myrtle Beach, SC
0.058823529
Racine, WI
0.058823529
Honolulu, HI
0.059644670
Cleveland-Elyria-Mentor, OH
0.060205580
Asheville, NC
0.060344828
Lafayette, LA
0.060773481
Peoria, IL
0.062500000
Monroe, MI
0.063492063
Anderson, IN
0.064516129
Provo-Orem, UT
0.064724919
Ocean City, NJ
0.066666667
Panama City-Lynn Haven, FL
0.067796610
Kingston, NY
0.068965517
Nashville-Davidson-Murfreesboro, TN
0.069306931
Boston-Cambridge-Quincy, MA-NH
0.069537909
Tallahassee, FL
0.069767442
Omaha-Council Bluffs, NE-IA
0.070010449
Indianapolis, IN
0.071929825
New Haven, CT
0.073122530
Des Moines, IA
0.073852295
Utica-Rome, NY
0.075000000
Greensboro-High Point, NC
0.075697211
Vero Beach, FL
0.075949367
Canton-Massillon, OH
0.076271186
Eugene-Springfield, OR
0.076530612
Chattanooga, TN-GA
0.077844311
Philadelphia-Camden-Wilmington, PA-NJ-DE
0.078458844
Columbia, SC
0.079037801
Syracuse, NY
0.080717489
Shreveport-Bossier City, LA
0.082191781
Baltimore-Towson, MD
0.082265678
Worcester, MA-CT
0.083333333
Lansing-East Lansing, MI
0.084033613
Medford, OR
0.085365854
Milwaukee-Waukesha-West Allis, WI
0.085434174
Atlanta-Sandy Springs-Marietta, GA
0.085695876
Fort Smith, AR-OK
0.085714286
Allentown-Bethlehem-Easton, PA-NJ
0.086826347
Hickory-Morgantown-Lenoir, NC
0.087719298
Seattle-Tacoma-Bellevue, WA
0.088446215
Atlantic City, NJ
0.090090090
Leominster-Fitchburg-Gardner, MA
0.090909091
Jacksonville, FL
0.091603053
Davenport-Moline-Rock Island, IA-IL
0.091666667
Augusta-Richmond County, GA-SC
0.093167702
Boise City-Nampa, ID
0.093167702
Topeka, KS
0.093406593
Portland-Vancouver-Beaverton, OR-WA
0.094582185
Deltona-Daytona Beach-Ormond Beach, FL
0.100000000
Port St. Lucie-Fort Pierce, FL
0.100917431
Lancaster, PA
0.102564103
Tuscaloosa, AL
0.102564103
Norwich-New London, CT-RI
0.103448276
Hartford-West Hartford-East Hartford, CT
0.105084746
Oklahoma City, OK
0.107615894
Waterloo-Cedar Falls, IA
0.108974359
Durham, NC
0.111111111
New Orleans-Metairie-Kenner, LA
0.111716621
Bridgeport-Stamford-Norwalk, CT
0.112328767
Fort Walton Beach-Crestview-Destin, FL
0.112500000
Providence-Fall River-Warwick, MA-RI
0.114273205
Tulsa, OK
0.114551084
Kankakee-Bradley, IL
0.114942529
Chico, CA
0.116666667
Charlotte-Gastonia-Concord, NC-SC
0.117988395
Raleigh-Cary, NC
0.119047619
Colorado Springs, CO
0.120967742
Olympia, WA
0.121212121
Fort Collins-Loveland, CO
0.121359223
Washington-Arlington-Alexandria, DC-VA-MD-WV
0.121378980
Kansas City, MO-KS
0.121621622
Athens-Clark County, GA
0.123076923
Lawton, OK
0.123711340
Green Bay, WI
0.125000000
Jacksonville, NC
0.126984127
Prescott, AZ
0.129629630
Trenton-Ewing, NJ
0.131868132
Wichita, KS
0.133489461
Lakeland-Winter Haven, FL
0.134228188
Scranton-Wilkes Barre, PA
0.136363636
Grand Rapids-Wyoming, MI
0.138157895
Ogden-Clearfield, UT
0.144208038
Boulder, CO
0.146198830
Fayetteville-Springdale-Rogers, AR-MO
0.148837209
Santa-Cruz-Watsonville, CA
0.151515152
Salt Lake City, UT
0.154910097
Fayetteville, NC
0.155844156
Ocala, FL
0.157894737
Tampa-St. Petersburg-Clearwater, FL
0.159144893
Greeley, CO
0.160493827
Chicago-Naperville-Joliet, IN-IN-WI
0.167388167
Naples-Marco Island, FL
0.182926829
Reno-Sparks, NV
0.196774194
San Francisco-Oakland-Fremont, CA
0.199855700
Columbus, GA-AL
0.203389831
Vallejo-Fairfield, CA
0.210526316
Reading, PA
0.211267606
Salem, OR
0.211764706
Orlando, FL
0.213114754
Springfield, MA-CT
0.219354839
Beaumont-Port Author, TX
0.227642276
New York-Northern New Jersey-Long Island, NY-NJ-PA
0.228508042
Napa, CA
0.229508197
Denver-Aurora, CO
0.232047872
Santa Rosa-Petaluma, CA
0.232558140
Farmington, NM
0.234375000
San Luis Obispo-Paso Robles, CA
0.246753247
Waterbury, CT
0.248407643
Las Vegas-Paradise, NV
0.251732102
Phoenix-Mesa-Scottsdale, AZ
0.254376931
Amarillo, TX
0.261363636
Sacramento-Arden-Arcade-Roseville, CA
0.263868066
San Diego-Carlsbad-San Marcos, CA
0.269018743
Poughkeepsie-Newburgh-Middletown, NY
0.273631841
Dallas-Fort Worth-Arlington, TX
0.283950617
Lubbock, TX
0.285714286
Longview, TX
0.292307692
Pueblo, CO
0.307692308
Austin-Round Rock, TX
0.310077519
San Jose-Sunnyvale-Santa Clara, CA
0.316417910
Stockton, CA
0.321243523
Waco, TX
0.329113924
Danbury, CT
0.339285714
Modesto, CA
0.341772152
Midland, TX
0.352941176
Yakima, WA
0.357142857
Houston-Baytown-Sugar Land, TX
0.359005458
Oxnard-Thousand Oaks-Ventura, CA
0.359550562
Killeen-Temple-Fort Hood, TX
0.386138614
Santa Barbara-Santa Maria-Goleta, CA
0.401515152
Vineland-Millville-Bridgeton, NJ
0.407407407
Fresno, CA
0.409240924
Visalia-Porterville, CA
0.438016529
Cape Coral-Fort Myers, FL
0.438356164
Albuquerque, NM
0.441707718
Los Angeles-Long Beach-Santa Ana, CA
0.460263286
Santa Fe, NM
0.461538462
Victoria, TX
0.465517241
Miami-Fort Lauderdale-Miami Beach, FL
0.467824968
Bakersfield, CA
0.489795918
Riverside-San Bernardino, CA
0.502325581
Tucson, AZ
0.506622517
Las Cruses, NM
0.542056075
Salinas, CA
0.557692308
Merced, CA
0.566037736
Corpus Christi, TX
0.606060606
Madera, CA
0.614035088
San Antonio, TX
0.644151565
El Centro, CA
0.686868687
El Paso, TX
0.790983607
Brownsville-Harlingen, TX
0.797468354
McAllen-Edinburg-Pharr, TX
0.948717949
Laredo, TX
0.966292135
Remembering that CPS$Race == “Asian” returns a TRUE/FALSE vector of whether an interviewee is Asian, determine the number of metropolitan areas in the United States from which at least 20% of interviewees are Asian.
sort(tapply(CPS$Race == "Asian",CPS$MetroArea,mean))
Albany, GA
0.000000000
Altoona, PA
0.000000000
Amarillo, TX
0.000000000
Anderson, IN
0.000000000
Appleton,WI
0.000000000
Asheville, NC
0.000000000
Barnstable Town, MA
0.000000000
Beaumont-Port Author, TX
0.000000000
Billings, MT
0.000000000
Binghamton, NY
0.000000000
Bloomington, IN
0.000000000
Bowling Green, KY
0.000000000
Canton-Massillon, OH
0.000000000
Charleston, WV
0.000000000
Chico, CA
0.000000000
Columbus, GA-AL
0.000000000
Decatur, IL
0.000000000
Durham, NC
0.000000000
Eau Claire, WI
0.000000000
El Paso, TX
0.000000000
Erie, PA
0.000000000
Farmington, NM
0.000000000
Florence, AL
0.000000000
Hagerstown-Martinsburg, MD-WV
0.000000000
Huntsville, AL
0.000000000
Jackson, MI
0.000000000
Jackson, MS
0.000000000
Janesville, WI
0.000000000
Johnson City, TN
0.000000000
Joplin, MO
0.000000000
Kankakee-Bradley, IL
0.000000000
Killeen-Temple-Fort Hood, TX
0.000000000
Kingsport-Bristol, TN-VA
0.000000000
Knoxville, TN
0.000000000
Lafayette, LA
0.000000000
Lansing-East Lansing, MI
0.000000000
Laredo, TX
0.000000000
Leominster-Fitchburg-Gardner, MA
0.000000000
Longview, TX
0.000000000
Lubbock, TX
0.000000000
Lynchburg, VA
0.000000000
Macon, GA
0.000000000
Madera, CA
0.000000000
McAllen-Edinburg-Pharr, TX
0.000000000
Michigan City-La Porte, IN
0.000000000
Midland, TX
0.000000000
Monroe, MI
0.000000000
Muskegon-Norton Shores, MI
0.000000000
Myrtle Beach-Conway-North Myrtle Beach, SC
0.000000000
Niles-Benton Harbor, MI
0.000000000
Ocean City, NJ
0.000000000
Oshkosh-Neenah, WI
0.000000000
Port St. Lucie-Fort Pierce, FL
0.000000000
Poughkeepsie-Newburgh-Middletown, NY
0.000000000
Pueblo, CO
0.000000000
Punta Gorda, FL
0.000000000
Racine, WI
0.000000000
Reading, PA
0.000000000
Roanoke, VA
0.000000000
Rockford, IL
0.000000000
Saginaw-Saginaw Township North, MI
0.000000000
Salem, OR
0.000000000
Salisbury, MD
0.000000000
Santa Fe, NM
0.000000000
Santa-Cruz-Watsonville, CA
0.000000000
Scranton-Wilkes Barre, PA
0.000000000
Shreveport-Bossier City, LA
0.000000000
South Bend-Mishawaka, IN-MI
0.000000000
Spartanburg, SC
0.000000000
Springfield, MA-CT
0.000000000
Springfield, OH
0.000000000
St. Cloud, MN
0.000000000
Tallahassee, FL
0.000000000
Tuscaloosa, AL
0.000000000
Utica-Rome, NY
0.000000000
Valdosta, GA
0.000000000
Vero Beach, FL
0.000000000
Victoria, TX
0.000000000
Vineland-Millville-Bridgeton, NJ
0.000000000
Waco, TX
0.000000000
Waterbury, CT
0.000000000
Wausau, WI
0.000000000
St. Louis, MO-IL
0.002092050
New Orleans-Metairie-Kenner, LA
0.002724796
San Antonio, TX
0.003294893
Charleston-North Charleston, SC
0.004310345
Monroe, LA
0.005586592
Chattanooga, TN-GA
0.005988024
Modesto, CA
0.006329114
Bend, OR
0.007142857
Dayton, OH
0.007462687
Santa Barbara-Santa Maria-Goleta, CA
0.007575758
Santa Rosa-Petaluma, CA
0.007751938
Toledo, OH
0.008510638
Coeur d'Alene, ID
0.008547009
York-Hanover, PA
0.008547009
Yakima, WA
0.008928571
Grand Rapids-Wyoming, MI
0.009868421
Sioux Falls, SD
0.010084034
Evansville, IN-KY
0.010101010
Lawrence, KS
0.010204082
Cleveland-Elyria-Mentor, OH
0.010279001
Lawton, OK
0.010309278
Boise City-Nampa, ID
0.010869565
Harrisburg-Carlisle, PA
0.011494253
Kingston, NY
0.011494253
Louisville, KY-IN
0.011560694
Medford, OR
0.012195122
Greeley, CO
0.012345679
Springfield, MO
0.012422360
Birmingham-Hoover, AL
0.012755102
Waterloo-Cedar Falls, IA
0.012820513
Provo-Orem, UT
0.012944984
Youngstown-Warren-Boardman, OH
0.013071895
Ocala, FL
0.013157895
Allentown-Bethlehem-Easton, PA-NJ
0.014970060
Corpus Christi, TX
0.015151515
Dover, DE
0.015350877
Charlotte-Gastonia-Concord, NC-SC
0.015473888
Sarasota-Bradenton-Venice, FL
0.015625000
Kalamazoo-Portage, MI
0.015748031
Winston-Salem, NC
0.015748031
Johnstown, PA
0.015873016
Colorado Springs, CO
0.016129032
Champaign-Urbana, IL
0.016393443
Napa, CA
0.016393443
Panama City-Lynn Haven, FL
0.016949153
Memphis, TN-MS-AR
0.017241379
Columbus, OH
0.018148820
Prescott, AZ
0.018518519
Las Cruses, NM
0.018691589
Pensacola-Ferry Pass-Brent, FL
0.018691589
Spokane, WA
0.019230769
Fort Collins-Loveland, CO
0.019417476
Flint, MI
0.019607843
Savannah, GA
0.019801980
Tucson, AZ
0.019867550
El Centro, CA
0.020202020
Eugene-Springfield, OR
0.020408163
Davenport-Moline-Rock Island, IA-IL
0.020833333
Deltona-Daytona Beach-Ormond Beach, FL
0.021428571
Topeka, KS
0.021978022
Cincinnati-Middletown, OH-KY-IN
0.022253129
Little Rock-North Little Rock, AR
0.022277228
Albany-Schenectady-Troy, NY
0.022388060
Baton Rouge, LA
0.022900763
Bremerton-Silverdale, WA
0.022988506
Bangor, ME
0.024038462
Naples-Marco Island, FL
0.024390244
Indianapolis, IN
0.024561404
Augusta-Richmond County, GA-SC
0.024844720
Holland-Grand Haven, MI
0.025641026
Fayetteville, NC
0.025974026
Ogden-Clearfield, UT
0.026004728
Rochester-Dover, NH-ME
0.026717557
Virginia Beach-Norfolk-Newport News, VA-NC
0.026800670
Lakeland-Winter Haven, FL
0.026845638
Columbia, SC
0.027491409
Fargo, ND-MN
0.027777778
Bellingham, WA
0.028571429
Montgomery, AL
0.029126214
Omaha-Council Bluffs, NE-IA
0.029258098
Akron, OH
0.030303030
Wichita, KS
0.030444965
Athens-Clark County, GA
0.030769231
Gulfport-Biloxi, MS
0.030769231
Anderson, SC
0.031250000
Denver-Aurora, CO
0.031914894
Greenville, SC
0.032432432
Philadelphia-Camden-Wilmington, PA-NJ-DE
0.032924694
Harrisonburg, VA
0.033333333
Cape Coral-Fort Myers, FL
0.034246575
Kansas City, MO-KS
0.034303534
Worcester, MA-CT
0.034722222
Oklahoma City, OK
0.034768212
Hickory-Morgantown-Lenoir, NC
0.035087719
Lexington-Fayette, KY
0.035353535
Miami-Fort Lauderdale-Miami Beach, FL
0.035392535
Palm Bay-Melbourne-Titusville, FL
0.035714286
Salt Lake City, UT
0.035961272
Mobile, AL
0.036363636
Huntington-Ashland, WV-KY-OH
0.036585366
Richmond, VA
0.036734694
Fort Wayne, IN
0.036764706
Fort Walton Beach-Crestview-Destin, FL
0.037500000
Des Moines, IA
0.037924152
Phoenix-Mesa-Scottsdale, AZ
0.038105046
Pittsburgh, PA
0.038251366
Bridgeport-Stamford-Norwalk, CT
0.038356164
Providence-Fall River-Warwick, MA-RI
0.038966725
Tampa-St. Petersburg-Clearwater, FL
0.039192399
Duluth, MN-WI
0.039682540
Syracuse, NY
0.040358744
Albuquerque, NM
0.041050903
Decatur, Al
0.041666667
Portland-South Portland, ME
0.042796006
Gainesville, FL
0.042857143
Detroit-Warren-Livonia, MI
0.043574594
Trenton-Ewing, NJ
0.043956044
New Haven, CT
0.047430830
Jacksonville, NC
0.047619048
Milwaukee-Waukesha-West Allis, WI
0.047619048
Jacksonville, FL
0.048346056
Burlington-South Burlington, VT
0.048706240
Anniston-Oxford, AL
0.049180328
Tulsa, OK
0.049535604
Raleigh-Cary, NC
0.050595238
Orlando, FL
0.050819672
Fayetteville-Springdale-Rogers, AR-MO
0.051162791
San Luis Obispo-Paso Robles, CA
0.051948052
Boston-Cambridge-Quincy, MA-NH
0.052041274
Austin-Round Rock, TX
0.052325581
Buffalo-Niagara Falls, NY
0.052325581
Springfield, IL
0.052631579
Iowa City, IA
0.053435115
Peoria, IL
0.053571429
Madison, WI
0.056338028
Merced, CA
0.056603774
Fort Smith, AR-OK
0.057142857
Nashville-Davidson-Murfreesboro, TN
0.057425743
Lancaster, PA
0.057692308
Baltimore-Towson, MD
0.057990560
Reno-Sparks, NV
0.058064516
Chicago-Naperville-Joliet, IN-IN-WI
0.058441558
Boulder, CO
0.058479532
Houston-Baytown-Sugar Land, TX
0.061249242
Riverside-San Bernardino, CA
0.062015504
Danbury, CT
0.062500000
Dallas-Fort Worth-Arlington, TX
0.062801932
Columbia, MO
0.063829787
Rochester, NY
0.065146580
Cedar Rapids, IA
0.066326531
Hartford-West Hartford-East Hartford, CT
0.066666667
Portland-Vancouver-Beaverton, OR-WA
0.069788797
Washington-Arlington-Alexandria, DC-VA-MD-WV
0.070624850
Atlanta-Sandy Springs-Marietta, GA
0.072809278
Norwich-New London, CT-RI
0.073891626
Lake Charles, LA
0.074074074
Oxnard-Thousand Oaks-Ventura, CA
0.074906367
Bloomington-Normal IL
0.075000000
Brownsville-Harlingen, TX
0.075949367
Minneapolis-St Paul-Bloomington, MN-WI
0.076725026
Las Vegas-Paradise, NV
0.078521940
Greensboro-High Point, NC
0.079681275
Bakersfield, CA
0.081632653
Ann Arbor, MI
0.082352941
La Crosse, WI
0.087719298
Green Bay, WI
0.088235294
Visalia-Porterville, CA
0.090909091
Seattle-Tacoma-Bellevue, WA
0.099601594
New York-Northern New Jersey-Long Island, NY-NJ-PA
0.104270660
Salinas, CA
0.125000000
Olympia, WA
0.131313131
Los Angeles-Long Beach-Santa Ana, CA
0.135056070
San Diego-Carlsbad-San Marcos, CA
0.142227122
Sacramento-Arden-Arcade-Roseville, CA
0.142428786
Atlantic City, NJ
0.144144144
Stockton, CA
0.155440415
Warner Robins, GA
0.166666667
Fresno, CA
0.184818482
Vallejo-Fairfield, CA
0.203007519
San Jose-Sunnyvale-Santa Clara, CA
0.241791045
San Francisco-Oakland-Fremont, CA
0.246753247
Honolulu, HI
0.501903553
Normally, we would look at the sorted proportion of interviewees from each metropolitan area who have not received a high school diploma with the command:
sort(tapply(CPS$Education == "No high school diploma", CPS$MetroArea, mean))
However, none of the interviewees aged 14 and younger have an education value reported, so the mean value is reported as NA for each metropolitan area. To get mean (and related functions, like sum) to ignore missing values, you can pass the parameter na.rm=TRUE. Passing na.rm=TRUE to the tapply function, determine which metropolitan area has the smallest proportion of interviewees who have received no high school diploma.
Just as we did with the metropolitan area information, merge in the country of birth information from the CountryMap data frame, replacing the CPS data frame with the result. If you accidentally overwrite CPS with the wrong values, remember that you can restore it by re-loading the data frame from CPSData.csv and then merging in the metropolitan area information using the command provided in the previous subproblem.
What is the name of the variable added to the CPS data frame by this merge operation?
summary(CPS)
CountryOfBirthCode MetroAreaCode PeopleInHousehold
Min. : 57.00 Min. :10420 Min. : 1.000
1st Qu.: 57.00 1st Qu.:21780 1st Qu.: 2.000
Median : 57.00 Median :34740 Median : 3.000
Mean : 82.68 Mean :35075 Mean : 3.284
3rd Qu.: 57.00 3rd Qu.:41860 3rd Qu.: 4.000
Max. :555.00 Max. :79600 Max. :15.000
NA's :34238
Region State
Midwest :30684 California :11570
Northeast:25939 Texas : 7077
South :41502 New York : 5595
West :33177 Florida : 5149
Pennsylvania: 3930
Illinois : 3912
(Other) :94069
Age Married Sex
Min. : 0.00 Divorced :11151 Female:67481
1st Qu.:19.00 Married :55509 Male :63821
Median :39.00 Never Married:30772
Mean :38.83 Separated : 2027
3rd Qu.:57.00 Widowed : 6505
Max. :85.00 NA's :25338
Education
High school :30906
Bachelor's degree :19443
Some college, no degree:18863
No high school diploma :16095
Associate degree : 9913
(Other) :10744
NA's :25338
Race Hispanic
American Indian : 1433 Min. :0.0000
Asian : 6520 1st Qu.:0.0000
Black : 13913 Median :0.0000
Multiracial : 2897 Mean :0.1393
Pacific Islander: 618 3rd Qu.:0.0000
White :105921 Max. :1.0000
Citizenship
Citizen, Native :116639
Citizen, Naturalized: 7073
Non-Citizen : 7590
EmploymentStatus
Disabled : 5712
Employed :61733
Not in Labor Force:15246
Retired :18619
Unemployed : 4203
NA's :25789
Industry
Educational and health services :15017
Trade : 8933
Professional and business services: 7519
Manufacturing : 6791
Leisure and hospitality : 6364
(Other) :21618
NA's :65060
MetroArea
New York-Northern New Jersey-Long Island, NY-NJ-PA: 5409
Washington-Arlington-Alexandria, DC-VA-MD-WV : 4177
Los Angeles-Long Beach-Santa Ana, CA : 4102
Philadelphia-Camden-Wilmington, PA-NJ-DE : 2855
Chicago-Naperville-Joliet, IN-IN-WI : 2772
(Other) :77749
NA's :34238
Country
United States:115063
Mexico : 3921
Philippines : 839
India : 770
China : 581
(Other) : 9952
NA's : 176
How many interviewees have a missing value for the new country of birth variable?
summary(CPS)
CountryOfBirthCode MetroAreaCode PeopleInHousehold
Min. : 57.00 Min. :10420 Min. : 1.000
1st Qu.: 57.00 1st Qu.:21780 1st Qu.: 2.000
Median : 57.00 Median :34740 Median : 3.000
Mean : 82.68 Mean :35075 Mean : 3.284
3rd Qu.: 57.00 3rd Qu.:41860 3rd Qu.: 4.000
Max. :555.00 Max. :79600 Max. :15.000
NA's :34238
Region State
Midwest :30684 California :11570
Northeast:25939 Texas : 7077
South :41502 New York : 5595
West :33177 Florida : 5149
Pennsylvania: 3930
Illinois : 3912
(Other) :94069
Age Married Sex
Min. : 0.00 Divorced :11151 Female:67481
1st Qu.:19.00 Married :55509 Male :63821
Median :39.00 Never Married:30772
Mean :38.83 Separated : 2027
3rd Qu.:57.00 Widowed : 6505
Max. :85.00 NA's :25338
Education
High school :30906
Bachelor's degree :19443
Some college, no degree:18863
No high school diploma :16095
Associate degree : 9913
(Other) :10744
NA's :25338
Race Hispanic
American Indian : 1433 Min. :0.0000
Asian : 6520 1st Qu.:0.0000
Black : 13913 Median :0.0000
Multiracial : 2897 Mean :0.1393
Pacific Islander: 618 3rd Qu.:0.0000
White :105921 Max. :1.0000
Citizenship
Citizen, Native :116639
Citizen, Naturalized: 7073
Non-Citizen : 7590
EmploymentStatus
Disabled : 5712
Employed :61733
Not in Labor Force:15246
Retired :18619
Unemployed : 4203
NA's :25789
Industry
Educational and health services :15017
Trade : 8933
Professional and business services: 7519
Manufacturing : 6791
Leisure and hospitality : 6364
(Other) :21618
NA's :65060
MetroArea
New York-Northern New Jersey-Long Island, NY-NJ-PA: 5409
Washington-Arlington-Alexandria, DC-VA-MD-WV : 4177
Los Angeles-Long Beach-Santa Ana, CA : 4102
Philadelphia-Camden-Wilmington, PA-NJ-DE : 2855
Chicago-Naperville-Joliet, IN-IN-WI : 2772
(Other) :77749
NA's :34238
Country
United States:115063
Mexico : 3921
Philippines : 839
India : 770
China : 581
(Other) : 9952
NA's : 176
Among all interviewees born outside of North America, which country was the most common place of birth?
sort(summary(CPS$Country))
Austria Albania
17 18
Norway Europe, not specified
18 19
Uzbekistan West Indies, not specified
19 19
Malaysia Serbia
20 20
Azores USSR
22 22
New Zealand Switzerland
23 23
Yemen Belarus
23 24
Scotland Yugoslavia
24 24
Hungary Afghanistan
25 26
Indonesia Netherlands
26 28
Sweden Bulgaria
28 29
Costa Rica Saudi Arabia
29 29
Guam Cameroon
31 32
Syria Armenia
32 35
Jordan Chile
36 37
Asia, not specified Ireland
39 39
Spain Bangladesh
41 42
Australia Nepal
43 44
Panama Lebanon
44 45
Myanmar (Burma) South Africa
45 48
Turkey Cambodia
48 49
Liberia Kenya
52 55
Romania Greece
55 56
Israel Trinidad and Tobago
57 60
Bosnia & Herzegovina Venezuela
61 61
Argentina Hong Kong
64 64
Portugal Egypt
64 65
Somalia France
72 73
South Korea Ghana
73 76
Nicaragua Ethiopia
76 80
Elsewhere Nigeria
81 85
Iraq Laos
97 98
Taiwan Ukraine
102 104
Guyana Pakistan
109 109
United Kingdom Thailand
111 128
Africa, not specified Ecuador
129 136
Peru Iran
136 144
Italy Brazil
149 159
Poland Haiti
162 167
Russia NA's
173 176
England Japan
179 187
Honduras Columbia
189 206
Jamaica Guatemala
217 309
Dominican Republic Korea
330 334
Canada Cuba
410 426
Germany (Other)
438 446
Vietnam El Salvador
458 477
Puerto Rico China
518 581
India Philippines
770 839
Mexico United States
3921 115063
What proportion of the interviewees from the “New York-Northern New Jersey-Long Island, NY-NJ-PA” metropolitan area have a country of birth that is not the United States? For this computation, don’t include people from this metropolitan area who have a missing country of birth.
1668/(1668+3736)
[1] 0.3086603
Which metropolitan area has the largest number (note – not proportion) of interviewees with a country of birth in India? Hint – remember to include na.rm=TRUE if you are using tapply() to answer this question.
sort(tapply(CPS$Country == "India", CPS$MetroArea, sum, na.rm=TRUE))
Akron, OH
0
Albany-Schenectady-Troy, NY
0
Albany, GA
0
Allentown-Bethlehem-Easton, PA-NJ
0
Altoona, PA
0
Amarillo, TX
0
Anderson, IN
0
Ann Arbor, MI
0
Anniston-Oxford, AL
0
Appleton,WI
0
Asheville, NC
0
Athens-Clark County, GA
0
Augusta-Richmond County, GA-SC
0
Bangor, ME
0
Barnstable Town, MA
0
Baton Rouge, LA
0
Beaumont-Port Author, TX
0
Bellingham, WA
0
Bend, OR
0
Billings, MT
0
Binghamton, NY
0
Bloomington, IN
0
Boulder, CO
0
Bowling Green, KY
0
Bremerton-Silverdale, WA
0
Buffalo-Niagara Falls, NY
0
Canton-Massillon, OH
0
Cape Coral-Fort Myers, FL
0
Cedar Rapids, IA
0
Champaign-Urbana, IL
0
Charleston, WV
0
Chattanooga, TN-GA
0
Chico, CA
0
Coeur d'Alene, ID
0
Colorado Springs, CO
0
Columbia, MO
0
Columbus, GA-AL
0
Columbus, OH
0
Corpus Christi, TX
0
Danbury, CT
0
Davenport-Moline-Rock Island, IA-IL
0
Dayton, OH
0
Decatur, Al
0
Decatur, IL
0
Denver-Aurora, CO
0
Dover, DE
0
Duluth, MN-WI
0
Durham, NC
0
Eau Claire, WI
0
El Centro, CA
0
El Paso, TX
0
Erie, PA
0
Eugene-Springfield, OR
0
Evansville, IN-KY
0
Fargo, ND-MN
0
Farmington, NM
0
Fayetteville, NC
0
Flint, MI
0
Florence, AL
0
Fort Collins-Loveland, CO
0
Fort Smith, AR-OK
0
Fort Walton Beach-Crestview-Destin, FL
0
Gainesville, FL
0
Grand Rapids-Wyoming, MI
0
Greeley, CO
0
Green Bay, WI
0
Greensboro-High Point, NC
0
Gulfport-Biloxi, MS
0
Hagerstown-Martinsburg, MD-WV
0
Harrisonburg, VA
0
Hickory-Morgantown-Lenoir, NC
0
Holland-Grand Haven, MI
0
Huntington-Ashland, WV-KY-OH
0
Huntsville, AL
0
Jackson, MI
0
Jackson, MS
0
Jacksonville, NC
0
Janesville, WI
0
Johnson City, TN
0
Johnstown, PA
0
Joplin, MO
0
Kalamazoo-Portage, MI
0
Kankakee-Bradley, IL
0
Killeen-Temple-Fort Hood, TX
0
Kingsport-Bristol, TN-VA
0
Kingston, NY
0
Knoxville, TN
0
La Crosse, WI
0
Lafayette, LA
0
Lake Charles, LA
0
Lakeland-Winter Haven, FL
0
Lancaster, PA
0
Lansing-East Lansing, MI
0
Laredo, TX
0
Las Cruses, NM
0
Lawton, OK
0
Leominster-Fitchburg-Gardner, MA
0
Lexington-Fayette, KY
0
Longview, TX
0
Louisville, KY-IN
0
Lubbock, TX
0
Lynchburg, VA
0
Macon, GA
0
Madera, CA
0
McAllen-Edinburg-Pharr, TX
0
Medford, OR
0
Merced, CA
0
Michigan City-La Porte, IN
0
Midland, TX
0
Mobile, AL
0
Modesto, CA
0
Monroe, LA
0
Monroe, MI
0
Montgomery, AL
0
Muskegon-Norton Shores, MI
0
Myrtle Beach-Conway-North Myrtle Beach, SC
0
Napa, CA
0
Niles-Benton Harbor, MI
0
Ocala, FL
0
Ocean City, NJ
0
Oshkosh-Neenah, WI
0
Palm Bay-Melbourne-Titusville, FL
0
Panama City-Lynn Haven, FL
0
Pensacola-Ferry Pass-Brent, FL
0
Port St. Lucie-Fort Pierce, FL
0
Portland-South Portland, ME
0
Poughkeepsie-Newburgh-Middletown, NY
0
Prescott, AZ
0
Pueblo, CO
0
Punta Gorda, FL
0
Racine, WI
0
Raleigh-Cary, NC
0
Reading, PA
0
Richmond, VA
0
Riverside-San Bernardino, CA
0
Roanoke, VA
0
Rockford, IL
0
Saginaw-Saginaw Township North, MI
0
Salem, OR
0
Salinas, CA
0
Salisbury, MD
0
San Antonio, TX
0
San Luis Obispo-Paso Robles, CA
0
Santa Barbara-Santa Maria-Goleta, CA
0
Santa Fe, NM
0
Santa Rosa-Petaluma, CA
0
Santa-Cruz-Watsonville, CA
0
Sarasota-Bradenton-Venice, FL
0
Savannah, GA
0
Scranton-Wilkes Barre, PA
0
Shreveport-Bossier City, LA
0
Sioux Falls, SD
0
South Bend-Mishawaka, IN-MI
0
Spartanburg, SC
0
Spokane, WA
0
Springfield, MA-CT
0
Springfield, MO
0
Springfield, OH
0
St. Cloud, MN
0
St. Louis, MO-IL
0
Stockton, CA
0
Tallahassee, FL
0
Toledo, OH
0
Topeka, KS
0
Tuscaloosa, AL
0
Utica-Rome, NY
0
Valdosta, GA
0
Vallejo-Fairfield, CA
0
Vero Beach, FL
0
Victoria, TX
0
Vineland-Millville-Bridgeton, NJ
0
Virginia Beach-Norfolk-Newport News, VA-NC
0
Waco, TX
0
Waterbury, CT
0
Waterloo-Cedar Falls, IA
0
Wausau, WI
0
Wichita, KS
0
Worcester, MA-CT
0
Yakima, WA
0
York-Hanover, PA
0
Youngstown-Warren-Boardman, OH
0
Anderson, SC
1
Bloomington-Normal IL
1
Boise City-Nampa, ID
1
Cincinnati-Middletown, OH-KY-IN
1
Columbia, SC
1
Greenville, SC
1
Harrisburg-Carlisle, PA
1
Jacksonville, FL
1
Lawrence, KS
1
Naples-Marco Island, FL
1
New Orleans-Metairie-Kenner, LA
1
Olympia, WA
1
Provo-Orem, UT
1
Syracuse, NY
1
Tucson, AZ
1
Atlantic City, NJ
2
Bakersfield, CA
2
Birmingham-Hoover, AL
2
Burlington-South Burlington, VT
2
Charleston-North Charleston, SC
2
Cleveland-Elyria-Mentor, OH
2
Deltona-Daytona Beach-Ormond Beach, FL
2
Fort Wayne, IN
2
Las Vegas-Paradise, NV
2
Memphis, TN-MS-AR
2
Miami-Fort Lauderdale-Miami Beach, FL
2
Nashville-Davidson-Murfreesboro, TN
2
Ogden-Clearfield, UT
2
Oklahoma City, OK
2
Oxnard-Thousand Oaks-Ventura, CA
2
Phoenix-Mesa-Scottsdale, AZ
2
Rochester, NY
2
Salt Lake City, UT
2
Springfield, IL
2
Winston-Salem, NC
2
Albuquerque, NM
3
Iowa City, IA
3
Madison, WI
3
Norwich-New London, CT-RI
3
Reno-Sparks, NV
3
Visalia-Porterville, CA
3
Charlotte-Gastonia-Concord, NC-SC
4
Indianapolis, IN
4
Omaha-Council Bluffs, NE-IA
4
Peoria, IL
4
Rochester-Dover, NH-ME
4
San Diego-Carlsbad-San Marcos, CA
4
Trenton-Ewing, NJ
4
Tulsa, OK
4
Orlando, FL
5
Seattle-Tacoma-Bellevue, WA
5
Austin-Round Rock, TX
6
Brownsville-Harlingen, TX
6
Des Moines, IA
6
Little Rock-North Little Rock, AR
6
New Haven, CT
6
Portland-Vancouver-Beaverton, OR-WA
6
Warner Robins, GA
6
Tampa-St. Petersburg-Clearwater, FL
7
Fayetteville-Springdale-Rogers, AR-MO
8
Sacramento-Arden-Arcade-Roseville, CA
8
Honolulu, HI
9
Boston-Cambridge-Quincy, MA-NH
11
Kansas City, MO-KS
11
Bridgeport-Stamford-Norwalk, CT
12
Milwaukee-Waukesha-West Allis, WI
12
Providence-Fall River-Warwick, MA-RI
14
Houston-Baytown-Sugar Land, TX
15
Baltimore-Towson, MD
16
Fresno, CA
16
Pittsburgh, PA
16
Dallas-Fort Worth-Arlington, TX
18
Los Angeles-Long Beach-Santa Ana, CA
19
San Jose-Sunnyvale-Santa Clara, CA
19
Minneapolis-St Paul-Bloomington, MN-WI
23
Hartford-West Hartford-East Hartford, CT
26
Atlanta-Sandy Springs-Marietta, GA
27
San Francisco-Oakland-Fremont, CA
27
Detroit-Warren-Livonia, MI
30
Chicago-Naperville-Joliet, IN-IN-WI
31
Philadelphia-Camden-Wilmington, PA-NJ-DE
32
Washington-Arlington-Alexandria, DC-VA-MD-WV
50
New York-Northern New Jersey-Long Island, NY-NJ-PA
96
In Brazil?
sort(tapply(CPS$Country == "Brazil", CPS$MetroArea, sum, na.rm=TRUE))
Albany-Schenectady-Troy, NY
0
Albany, GA
0
Allentown-Bethlehem-Easton, PA-NJ
0
Altoona, PA
0
Amarillo, TX
0
Anderson, IN
0
Anderson, SC
0
Ann Arbor, MI
0
Anniston-Oxford, AL
0
Appleton,WI
0
Asheville, NC
0
Athens-Clark County, GA
0
Atlantic City, NJ
0
Augusta-Richmond County, GA-SC
0
Austin-Round Rock, TX
0
Bakersfield, CA
0
Baltimore-Towson, MD
0
Bangor, ME
0
Baton Rouge, LA
0
Beaumont-Port Author, TX
0
Bellingham, WA
0
Bend, OR
0
Billings, MT
0
Binghamton, NY
0
Birmingham-Hoover, AL
0
Bloomington-Normal IL
0
Bloomington, IN
0
Boise City-Nampa, ID
0
Boulder, CO
0
Bowling Green, KY
0
Brownsville-Harlingen, TX
0
Buffalo-Niagara Falls, NY
0
Burlington-South Burlington, VT
0
Cedar Rapids, IA
0
Champaign-Urbana, IL
0
Charleston-North Charleston, SC
0
Charleston, WV
0
Chattanooga, TN-GA
0
Cleveland-Elyria-Mentor, OH
0
Coeur d'Alene, ID
0
Colorado Springs, CO
0
Columbia, MO
0
Columbus, GA-AL
0
Columbus, OH
0
Corpus Christi, TX
0
Dayton, OH
0
Decatur, Al
0
Decatur, IL
0
Deltona-Daytona Beach-Ormond Beach, FL
0
Des Moines, IA
0
Detroit-Warren-Livonia, MI
0
Dover, DE
0
Duluth, MN-WI
0
Durham, NC
0
Eau Claire, WI
0
El Centro, CA
0
El Paso, TX
0
Erie, PA
0
Eugene-Springfield, OR
0
Evansville, IN-KY
0
Fargo, ND-MN
0
Farmington, NM
0
Fayetteville-Springdale-Rogers, AR-MO
0
Fayetteville, NC
0
Flint, MI
0
Florence, AL
0
Fort Collins-Loveland, CO
0
Fort Smith, AR-OK
0
Fort Walton Beach-Crestview-Destin, FL
0
Fort Wayne, IN
0
Fresno, CA
0
Gainesville, FL
0
Grand Rapids-Wyoming, MI
0
Greeley, CO
0
Green Bay, WI
0
Greensboro-High Point, NC
0
Greenville, SC
0
Gulfport-Biloxi, MS
0
Hagerstown-Martinsburg, MD-WV
0
Harrisburg-Carlisle, PA
0
Harrisonburg, VA
0
Hickory-Morgantown-Lenoir, NC
0
Holland-Grand Haven, MI
0
Honolulu, HI
0
Houston-Baytown-Sugar Land, TX
0
Huntington-Ashland, WV-KY-OH
0
Huntsville, AL
0
Indianapolis, IN
0
Iowa City, IA
0
Jackson, MI
0
Jackson, MS
0
Jacksonville, NC
0
Janesville, WI
0
Johnson City, TN
0
Johnstown, PA
0
Joplin, MO
0
Kalamazoo-Portage, MI
0
Kankakee-Bradley, IL
0
Killeen-Temple-Fort Hood, TX
0
Kingsport-Bristol, TN-VA
0
Kingston, NY
0
Knoxville, TN
0
La Crosse, WI
0
Lafayette, LA
0
Lake Charles, LA
0
Lakeland-Winter Haven, FL
0
Lancaster, PA
0
Lansing-East Lansing, MI
0
Laredo, TX
0
Las Cruses, NM
0
Las Vegas-Paradise, NV
0
Lawrence, KS
0
Lawton, OK
0
Lexington-Fayette, KY
0
Little Rock-North Little Rock, AR
0
Longview, TX
0
Lubbock, TX
0
Lynchburg, VA
0
Macon, GA
0
Madera, CA
0
Madison, WI
0
McAllen-Edinburg-Pharr, TX
0
Medford, OR
0
Memphis, TN-MS-AR
0
Merced, CA
0
Michigan City-La Porte, IN
0
Midland, TX
0
Milwaukee-Waukesha-West Allis, WI
0
Mobile, AL
0
Modesto, CA
0
Monroe, MI
0
Muskegon-Norton Shores, MI
0
Myrtle Beach-Conway-North Myrtle Beach, SC
0
Napa, CA
0
Naples-Marco Island, FL
0
Nashville-Davidson-Murfreesboro, TN
0
New Haven, CT
0
New Orleans-Metairie-Kenner, LA
0
Niles-Benton Harbor, MI
0
Norwich-New London, CT-RI
0
Ocala, FL
0
Ocean City, NJ
0
Ogden-Clearfield, UT
0
Oklahoma City, OK
0
Olympia, WA
0
Omaha-Council Bluffs, NE-IA
0
Oshkosh-Neenah, WI
0
Palm Bay-Melbourne-Titusville, FL
0
Panama City-Lynn Haven, FL
0
Peoria, IL
0
Pittsburgh, PA
0
Port St. Lucie-Fort Pierce, FL
0
Portland-South Portland, ME
0
Portland-Vancouver-Beaverton, OR-WA
0
Poughkeepsie-Newburgh-Middletown, NY
0
Prescott, AZ
0
Provo-Orem, UT
0
Pueblo, CO
0
Punta Gorda, FL
0
Raleigh-Cary, NC
0
Reading, PA
0
Reno-Sparks, NV
0
Richmond, VA
0
Riverside-San Bernardino, CA
0
Roanoke, VA
0
Rochester-Dover, NH-ME
0
Rockford, IL
0
Saginaw-Saginaw Township North, MI
0
Salinas, CA
0
Salisbury, MD
0
San Antonio, TX
0
San Diego-Carlsbad-San Marcos, CA
0
San Luis Obispo-Paso Robles, CA
0
Santa Barbara-Santa Maria-Goleta, CA
0
Santa Fe, NM
0
Santa Rosa-Petaluma, CA
0
Santa-Cruz-Watsonville, CA
0
Sarasota-Bradenton-Venice, FL
0
Savannah, GA
0
Scranton-Wilkes Barre, PA
0
Shreveport-Bossier City, LA
0
Sioux Falls, SD
0
South Bend-Mishawaka, IN-MI
0
Spartanburg, SC
0
Spokane, WA
0
Springfield, IL
0
Springfield, MA-CT
0
Springfield, MO
0
Springfield, OH
0
St. Cloud, MN
0
St. Louis, MO-IL
0
Stockton, CA
0
Syracuse, NY
0
Tallahassee, FL
0
Toledo, OH
0
Topeka, KS
0
Tucson, AZ
0
Tulsa, OK
0
Tuscaloosa, AL
0
Utica-Rome, NY
0
Valdosta, GA
0
Vallejo-Fairfield, CA
0
Vero Beach, FL
0
Victoria, TX
0
Vineland-Millville-Bridgeton, NJ
0
Visalia-Porterville, CA
0
Waco, TX
0
Warner Robins, GA
0
Waterloo-Cedar Falls, IA
0
Wausau, WI
0
Winston-Salem, NC
0
Worcester, MA-CT
0
Yakima, WA
0
York-Hanover, PA
0
Youngstown-Warren-Boardman, OH
0
Akron, OH
1
Albuquerque, NM
1
Atlanta-Sandy Springs-Marietta, GA
1
Bremerton-Silverdale, WA
1
Cape Coral-Fort Myers, FL
1
Chico, CA
1
Cincinnati-Middletown, OH-KY-IN
1
Denver-Aurora, CO
1
Hartford-West Hartford-East Hartford, CT
1
Kansas City, MO-KS
1
Leominster-Fitchburg-Gardner, MA
1
Louisville, KY-IN
1
Minneapolis-St Paul-Bloomington, MN-WI
1
Monroe, LA
1
Montgomery, AL
1
Oxnard-Thousand Oaks-Ventura, CA
1
Pensacola-Ferry Pass-Brent, FL
1
Racine, WI
1
Rochester, NY
1
Salem, OR
1
San Jose-Sunnyvale-Santa Clara, CA
1
Seattle-Tacoma-Bellevue, WA
1
Tampa-St. Petersburg-Clearwater, FL
1
Trenton-Ewing, NJ
1
Virginia Beach-Norfolk-Newport News, VA-NC
1
Waterbury, CT
1
Wichita, KS
1
Barnstable Town, MA
2
Charlotte-Gastonia-Concord, NC-SC
2
Chicago-Naperville-Joliet, IN-IN-WI
2
Columbia, SC
2
Dallas-Fort Worth-Arlington, TX
2
Jacksonville, FL
2
Orlando, FL
2
Sacramento-Arden-Arcade-Roseville, CA
2
Canton-Massillon, OH
3
Phoenix-Mesa-Scottsdale, AZ
3
Providence-Fall River-Warwick, MA-RI
3
Salt Lake City, UT
3
Davenport-Moline-Rock Island, IA-IL
4
Philadelphia-Camden-Wilmington, PA-NJ-DE
4
Danbury, CT
5
San Francisco-Oakland-Fremont, CA
6
Bridgeport-Stamford-Norwalk, CT
7
New York-Northern New Jersey-Long Island, NY-NJ-PA
7
Washington-Arlington-Alexandria, DC-VA-MD-WV
8
Los Angeles-Long Beach-Santa Ana, CA
9
Miami-Fort Lauderdale-Miami Beach, FL
16
Boston-Cambridge-Quincy, MA-NH
18
In Somalia?
sort(tapply(CPS$Country == "Somalia", CPS$MetroArea, sum, na.rm=TRUE))
Akron, OH
0
Albany-Schenectady-Troy, NY
0
Albany, GA
0
Albuquerque, NM
0
Allentown-Bethlehem-Easton, PA-NJ
0
Altoona, PA
0
Amarillo, TX
0
Anderson, IN
0
Anderson, SC
0
Ann Arbor, MI
0
Anniston-Oxford, AL
0
Appleton,WI
0
Asheville, NC
0
Athens-Clark County, GA
0
Atlanta-Sandy Springs-Marietta, GA
0
Atlantic City, NJ
0
Augusta-Richmond County, GA-SC
0
Austin-Round Rock, TX
0
Bakersfield, CA
0
Baltimore-Towson, MD
0
Bangor, ME
0
Barnstable Town, MA
0
Baton Rouge, LA
0
Beaumont-Port Author, TX
0
Bellingham, WA
0
Bend, OR
0
Billings, MT
0
Binghamton, NY
0
Birmingham-Hoover, AL
0
Bloomington-Normal IL
0
Bloomington, IN
0
Boise City-Nampa, ID
0
Boston-Cambridge-Quincy, MA-NH
0
Boulder, CO
0
Bowling Green, KY
0
Bremerton-Silverdale, WA
0
Bridgeport-Stamford-Norwalk, CT
0
Brownsville-Harlingen, TX
0
Buffalo-Niagara Falls, NY
0
Canton-Massillon, OH
0
Cape Coral-Fort Myers, FL
0
Cedar Rapids, IA
0
Champaign-Urbana, IL
0
Charleston-North Charleston, SC
0
Charleston, WV
0
Charlotte-Gastonia-Concord, NC-SC
0
Chattanooga, TN-GA
0
Chicago-Naperville-Joliet, IN-IN-WI
0
Chico, CA
0
Cincinnati-Middletown, OH-KY-IN
0
Cleveland-Elyria-Mentor, OH
0
Coeur d'Alene, ID
0
Colorado Springs, CO
0
Columbia, MO
0
Columbia, SC
0
Columbus, GA-AL
0
Corpus Christi, TX
0
Dallas-Fort Worth-Arlington, TX
0
Danbury, CT
0
Davenport-Moline-Rock Island, IA-IL
0
Decatur, Al
0
Decatur, IL
0
Deltona-Daytona Beach-Ormond Beach, FL
0
Denver-Aurora, CO
0
Des Moines, IA
0
Detroit-Warren-Livonia, MI
0
Dover, DE
0
Duluth, MN-WI
0
Durham, NC
0
Eau Claire, WI
0
El Centro, CA
0
El Paso, TX
0
Erie, PA
0
Eugene-Springfield, OR
0
Evansville, IN-KY
0
Farmington, NM
0
Fayetteville-Springdale-Rogers, AR-MO
0
Fayetteville, NC
0
Flint, MI
0
Florence, AL
0
Fort Collins-Loveland, CO
0
Fort Smith, AR-OK
0
Fort Walton Beach-Crestview-Destin, FL
0
Fort Wayne, IN
0
Fresno, CA
0
Gainesville, FL
0
Grand Rapids-Wyoming, MI
0
Greeley, CO
0
Green Bay, WI
0
Greensboro-High Point, NC
0
Greenville, SC
0
Gulfport-Biloxi, MS
0
Hagerstown-Martinsburg, MD-WV
0
Harrisburg-Carlisle, PA
0
Harrisonburg, VA
0
Hartford-West Hartford-East Hartford, CT
0
Hickory-Morgantown-Lenoir, NC
0
Holland-Grand Haven, MI
0
Honolulu, HI
0
Huntington-Ashland, WV-KY-OH
0
Huntsville, AL
0
Indianapolis, IN
0
Iowa City, IA
0
Jackson, MI
0
Jackson, MS
0
Jacksonville, FL
0
Jacksonville, NC
0
Janesville, WI
0
Johnson City, TN
0
Johnstown, PA
0
Joplin, MO
0
Kalamazoo-Portage, MI
0
Kankakee-Bradley, IL
0
Kansas City, MO-KS
0
Killeen-Temple-Fort Hood, TX
0
Kingsport-Bristol, TN-VA
0
Kingston, NY
0
Knoxville, TN
0
La Crosse, WI
0
Lafayette, LA
0
Lake Charles, LA
0
Lakeland-Winter Haven, FL
0
Lancaster, PA
0
Lansing-East Lansing, MI
0
Laredo, TX
0
Las Cruses, NM
0
Las Vegas-Paradise, NV
0
Lawrence, KS
0
Lawton, OK
0
Leominster-Fitchburg-Gardner, MA
0
Lexington-Fayette, KY
0
Little Rock-North Little Rock, AR
0
Longview, TX
0
Los Angeles-Long Beach-Santa Ana, CA
0
Louisville, KY-IN
0
Lubbock, TX
0
Lynchburg, VA
0
Macon, GA
0
Madera, CA
0
Madison, WI
0
McAllen-Edinburg-Pharr, TX
0
Medford, OR
0
Memphis, TN-MS-AR
0
Merced, CA
0
Miami-Fort Lauderdale-Miami Beach, FL
0
Michigan City-La Porte, IN
0
Midland, TX
0
Milwaukee-Waukesha-West Allis, WI
0
Mobile, AL
0
Modesto, CA
0
Monroe, LA
0
Monroe, MI
0
Montgomery, AL
0
Muskegon-Norton Shores, MI
0
Myrtle Beach-Conway-North Myrtle Beach, SC
0
Napa, CA
0
Naples-Marco Island, FL
0
Nashville-Davidson-Murfreesboro, TN
0
New Haven, CT
0
New Orleans-Metairie-Kenner, LA
0
New York-Northern New Jersey-Long Island, NY-NJ-PA
0
Niles-Benton Harbor, MI
0
Norwich-New London, CT-RI
0
Ocala, FL
0
Ocean City, NJ
0
Ogden-Clearfield, UT
0
Oklahoma City, OK
0
Olympia, WA
0
Omaha-Council Bluffs, NE-IA
0
Orlando, FL
0
Oshkosh-Neenah, WI
0
Oxnard-Thousand Oaks-Ventura, CA
0
Palm Bay-Melbourne-Titusville, FL
0
Panama City-Lynn Haven, FL
0
Pensacola-Ferry Pass-Brent, FL
0
Peoria, IL
0
Philadelphia-Camden-Wilmington, PA-NJ-DE
0
Pittsburgh, PA
0
Port St. Lucie-Fort Pierce, FL
0
Poughkeepsie-Newburgh-Middletown, NY
0
Prescott, AZ
0
Providence-Fall River-Warwick, MA-RI
0
Provo-Orem, UT
0
Pueblo, CO
0
Punta Gorda, FL
0
Racine, WI
0
Raleigh-Cary, NC
0
Reading, PA
0
Reno-Sparks, NV
0
Riverside-San Bernardino, CA
0
Roanoke, VA
0
Rochester-Dover, NH-ME
0
Rochester, NY
0
Rockford, IL
0
Sacramento-Arden-Arcade-Roseville, CA
0
Saginaw-Saginaw Township North, MI
0
Salem, OR
0
Salinas, CA
0
Salisbury, MD
0
Salt Lake City, UT
0
San Antonio, TX
0
San Diego-Carlsbad-San Marcos, CA
0
San Francisco-Oakland-Fremont, CA
0
San Jose-Sunnyvale-Santa Clara, CA
0
San Luis Obispo-Paso Robles, CA
0
Santa Barbara-Santa Maria-Goleta, CA
0
Santa Fe, NM
0
Santa Rosa-Petaluma, CA
0
Santa-Cruz-Watsonville, CA
0
Sarasota-Bradenton-Venice, FL
0
Savannah, GA
0
Scranton-Wilkes Barre, PA
0
Shreveport-Bossier City, LA
0
South Bend-Mishawaka, IN-MI
0
Spartanburg, SC
0
Spokane, WA
0
Springfield, IL
0
Springfield, MA-CT
0
Springfield, MO
0
Springfield, OH
0
St. Louis, MO-IL
0
Stockton, CA
0
Syracuse, NY
0
Tallahassee, FL
0
Tampa-St. Petersburg-Clearwater, FL
0
Toledo, OH
0
Topeka, KS
0
Trenton-Ewing, NJ
0
Tucson, AZ
0
Tulsa, OK
0
Tuscaloosa, AL
0
Utica-Rome, NY
0
Valdosta, GA
0
Vallejo-Fairfield, CA
0
Vero Beach, FL
0
Victoria, TX
0
Vineland-Millville-Bridgeton, NJ
0
Virginia Beach-Norfolk-Newport News, VA-NC
0
Visalia-Porterville, CA
0
Waco, TX
0
Warner Robins, GA
0
Washington-Arlington-Alexandria, DC-VA-MD-WV
0
Waterbury, CT
0
Waterloo-Cedar Falls, IA
0
Wausau, WI
0
Wichita, KS
0
Winston-Salem, NC
0
Worcester, MA-CT
0
Yakima, WA
0
York-Hanover, PA
0
Youngstown-Warren-Boardman, OH
0
Dayton, OH
1
Richmond, VA
1
Houston-Baytown-Sugar Land, TX
2
Sioux Falls, SD
2
Burlington-South Burlington, VT
3
Portland-South Portland, ME
3
Portland-Vancouver-Beaverton, OR-WA
3
Columbus, OH
5
Fargo, ND-MN
5
Phoenix-Mesa-Scottsdale, AZ
7
Seattle-Tacoma-Bellevue, WA
7
St. Cloud, MN
7
Minneapolis-St Paul-Bloomington, MN-WI
17