This script pulls together other tables created from related scripts for extracting zillow two bedroom home values for May 2020, current July 2020 number of jobs available and hourly and annual average pay per job compared to licensed massage therapists (LMTs) in each of 50 of the US states not including the new District of Columbia state added this year 2020. It also pulls in the top 3 populated city per state that makes those average pay values according to the advertised pay per job and city from Indeed. All files are in the github repository located at https://github.com/JanJanJan2018/LMT-State-Licensing-Database and the census data that we start adding to this table is pulled from 2018 data from Data.census.gov demographics to add per state to state licensing requirements excel file: https://data.census.gov/cedsci/table?q=median%20pay%20by%20region%20and%20race&tid=ACSDP1Y2018.DP05&vintage=2018&cid=DP05_0001E&g=0100000US.04000.001&hidePreview=false

library(ggplot2)
library(grid)
library(gridExtra)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:gridExtra':
## 
##     combine
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
data <- read.csv('ACSDP1Y2018.DP05_data_with_overlays_2020-07-07T154725.csv',
                 sep=',',
                 header=TRUE, na.strings = c('',' ','NA'))
                 
meta <- read.csv('ACSDP1Y2018.DP05_metadata_2020-07-07T154725.csv',header=TRUE, 
                 sep=',',na.strings=c('',' ','NA'))
head(data)
##        GEO_ID                 NAME                              DP05_0001E
## 1          id Geographic Area Name Estimate!!SEX AND AGE!!Total population
## 2 0400000US17             Illinois                                12741080
## 3 0400000US19                 Iowa                                 3156145
## 4 0400000US29             Missouri                                 6126452
## 5 0400000US32               Nevada                                 3034392
## 6 0400000US42         Pennsylvania                                12807060
##                                       DP05_0001M
## 1 Margin of Error!!SEX AND AGE!!Total population
## 2                                          *****
## 3                                          *****
## 4                                          *****
## 5                                          *****
## 6                                          *****
##                                       DP05_0001PE
## 1 Percent Estimate!!SEX AND AGE!!Total population
## 2                                        12741080
## 3                                         3156145
## 4                                         6126452
## 5                                         3034392
## 6                                        12807060
##                                              DP05_0001PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population
## 2                                                    (X)
## 3                                                    (X)
## 4                                                    (X)
## 5                                                    (X)
## 6                                                    (X)
##                                      DP05_0002E
## 1 Estimate!!SEX AND AGE!!Total population!!Male
## 2                                       6266062
## 3                                       1564888
## 4                                       3003165
## 5                                       1522374
## 6                                       6271620
##                                             DP05_0002M
## 1 Margin of Error!!SEX AND AGE!!Total population!!Male
## 2                                                 4378
## 3                                                 3527
## 4                                                 4798
## 5                                                 2263
## 6                                                 4457
##                                             DP05_0002PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!Male
## 2                                                  49.2
## 3                                                  49.6
## 4                                                  49.0
## 5                                                  50.2
## 6                                                  49.0
##                                                    DP05_0002PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!Male
## 2                                                          0.1
## 3                                                          0.1
## 4                                                          0.1
## 5                                                          0.1
## 6                                                          0.1
##                                        DP05_0003E
## 1 Estimate!!SEX AND AGE!!Total population!!Female
## 2                                         6475018
## 3                                         1591257
## 4                                         3123287
## 5                                         1512018
## 6                                         6535440
##                                               DP05_0003M
## 1 Margin of Error!!SEX AND AGE!!Total population!!Female
## 2                                                   4378
## 3                                                   3527
## 4                                                   4798
## 5                                                   2263
## 6                                                   4457
##                                               DP05_0003PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!Female
## 2                                                    50.8
## 3                                                    50.4
## 4                                                    51.0
## 5                                                    49.8
## 6                                                    51.0
##                                                      DP05_0003PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!Female
## 2                                                            0.1
## 3                                                            0.1
## 4                                                            0.1
## 5                                                            0.1
## 6                                                            0.1
##                                                                   DP05_0004E
## 1 Estimate!!SEX AND AGE!!Total population!!Sex ratio (males per 100 females)
## 2                                                                       96.8
## 3                                                                       98.3
## 4                                                                       96.2
## 5                                                                      100.7
## 6                                                                       96.0
##                                                                          DP05_0004M
## 1 Margin of Error!!SEX AND AGE!!Total population!!Sex ratio (males per 100 females)
## 2                                                                               0.1
## 3                                                                               0.4
## 4                                                                               0.3
## 5                                                                               0.3
## 6                                                                               0.1
##                                                                          DP05_0004PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!Sex ratio (males per 100 females)
## 2                                                                                (X)
## 3                                                                                (X)
## 4                                                                                (X)
## 5                                                                                (X)
## 6                                                                                (X)
##                                                                                 DP05_0004PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!Sex ratio (males per 100 females)
## 2                                                                                       (X)
## 3                                                                                       (X)
## 4                                                                                       (X)
## 5                                                                                       (X)
## 6                                                                                       (X)
##                                               DP05_0005E
## 1 Estimate!!SEX AND AGE!!Total population!!Under 5 years
## 2                                                 759456
## 3                                                 197883
## 4                                                 370408
## 5                                                 184539
## 6                                                 700416
##                                                      DP05_0005M
## 1 Margin of Error!!SEX AND AGE!!Total population!!Under 5 years
## 2                                                          2046
## 3                                                          2271
## 4                                                          2583
## 5                                                          1173
## 6                                                          2083
##                                                      DP05_0005PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!Under 5 years
## 2                                                            6.0
## 3                                                            6.3
## 4                                                            6.0
## 5                                                            6.1
## 6                                                            5.5
##                                                             DP05_0005PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!Under 5 years
## 2                                                                   0.1
## 3                                                                   0.1
## 4                                                                   0.1
## 5                                                                   0.1
## 6                                                                   0.1
##                                              DP05_0006E
## 1 Estimate!!SEX AND AGE!!Total population!!5 to 9 years
## 2                                                762237
## 3                                                197454
## 4                                                373737
## 5                                                188880
## 6                                                708163
##                                                     DP05_0006M
## 1 Margin of Error!!SEX AND AGE!!Total population!!5 to 9 years
## 2                                                        10975
## 3                                                         4889
## 4                                                         8163
## 5                                                         5734
## 6                                                         9762
##                                                     DP05_0006PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!5 to 9 years
## 2                                                           6.0
## 3                                                           6.3
## 4                                                           6.1
## 5                                                           6.2
## 6                                                           5.5
##                                                            DP05_0006PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!5 to 9 years
## 2                                                                  0.1
## 3                                                                  0.2
## 4                                                                  0.1
## 5                                                                  0.2
## 6                                                                  0.1
##                                                DP05_0007E
## 1 Estimate!!SEX AND AGE!!Total population!!10 to 14 years
## 2                                                  838140
## 3                                                  215222
## 4                                                  401199
## 5                                                  201625
## 6                                                  775827
##                                                       DP05_0007M
## 1 Margin of Error!!SEX AND AGE!!Total population!!10 to 14 years
## 2                                                          10161
## 3                                                           5215
## 4                                                           7657
## 5                                                           5704
## 6                                                           9517
##                                                       DP05_0007PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!10 to 14 years
## 2                                                             6.6
## 3                                                             6.8
## 4                                                             6.5
## 5                                                             6.6
## 6                                                             6.1
##                                                              DP05_0007PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!10 to 14 years
## 2                                                                    0.1
## 3                                                                    0.2
## 4                                                                    0.1
## 5                                                                    0.2
## 6                                                                    0.1
##                                                DP05_0008E
## 1 Estimate!!SEX AND AGE!!Total population!!15 to 19 years
## 2                                                  835845
## 3                                                  220659
## 4                                                  391923
## 5                                                  182398
## 6                                                  815621
##                                                       DP05_0008M
## 1 Margin of Error!!SEX AND AGE!!Total population!!15 to 19 years
## 2                                                           4854
## 3                                                           4122
## 4                                                           4812
## 5                                                           2209
## 6                                                           4096
##                                                       DP05_0008PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!15 to 19 years
## 2                                                             6.6
## 3                                                             7.0
## 4                                                             6.4
## 5                                                             6.0
## 6                                                             6.4
##                                                              DP05_0008PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!15 to 19 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                DP05_0009E
## 1 Estimate!!SEX AND AGE!!Total population!!20 to 24 years
## 2                                                  839026
## 3                                                  220135
## 4                                                  406398
## 5                                                  180376
## 6                                                  812406
##                                                       DP05_0009M
## 1 Margin of Error!!SEX AND AGE!!Total population!!20 to 24 years
## 2                                                           5924
## 3                                                           3995
## 4                                                           5343
## 5                                                           2061
## 6                                                           5651
##                                                       DP05_0009PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!20 to 24 years
## 2                                                             6.6
## 3                                                             7.0
## 4                                                             6.6
## 5                                                             5.9
## 6                                                             6.3
##                                                              DP05_0009PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!20 to 24 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                DP05_0010E
## 1 Estimate!!SEX AND AGE!!Total population!!25 to 34 years
## 2                                                 1765517
## 3                                                  394507
## 4                                                  819132
## 5                                                  442713
## 6                                                 1695073
##                                                       DP05_0010M
## 1 Margin of Error!!SEX AND AGE!!Total population!!25 to 34 years
## 2                                                           5311
## 3                                                           4452
## 4                                                           5822
## 5                                                           2829
## 6                                                           5655
##                                                       DP05_0010PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!25 to 34 years
## 2                                                            13.9
## 3                                                            12.5
## 4                                                            13.4
## 5                                                            14.6
## 6                                                            13.2
##                                                              DP05_0010PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!25 to 34 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                DP05_0011E
## 1 Estimate!!SEX AND AGE!!Total population!!35 to 44 years
## 2                                                 1644390
## 3                                                  383617
## 4                                                  742343
## 5                                                  405128
## 6                                                 1496113
##                                                       DP05_0011M
## 1 Margin of Error!!SEX AND AGE!!Total population!!35 to 44 years
## 2                                                           5142
## 3                                                           3741
## 4                                                           3976
## 5                                                           2750
## 6                                                           4296
##                                                       DP05_0011PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!35 to 44 years
## 2                                                            12.9
## 3                                                            12.2
## 4                                                            12.1
## 5                                                            13.4
## 6                                                            11.7
##                                                              DP05_0011PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!35 to 44 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                DP05_0012E
## 1 Estimate!!SEX AND AGE!!Total population!!45 to 54 years
## 2                                                 1636054
## 3                                                  369396
## 4                                                  753354
## 5                                                  396167
## 6                                                 1659541
##                                                       DP05_0012M
## 1 Margin of Error!!SEX AND AGE!!Total population!!45 to 54 years
## 2                                                           4871
## 3                                                           3161
## 4                                                           3315
## 5                                                           2674
## 6                                                           4842
##                                                       DP05_0012PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!45 to 54 years
## 2                                                            12.8
## 3                                                            11.7
## 4                                                            12.3
## 5                                                            13.1
## 6                                                            13.0
##                                                              DP05_0012PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!45 to 54 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                DP05_0013E
## 1 Estimate!!SEX AND AGE!!Total population!!55 to 59 years
## 2                                                  855616
## 3                                                  213657
## 4                                                  419591
## 5                                                  191059
## 6                                                  916749
##                                                       DP05_0013M
## 1 Margin of Error!!SEX AND AGE!!Total population!!55 to 59 years
## 2                                                           9963
## 3                                                           4454
## 4                                                           7243
## 5                                                           4897
## 6                                                           9701
##                                                       DP05_0013PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!55 to 59 years
## 2                                                             6.7
## 3                                                             6.8
## 4                                                             6.8
## 5                                                             6.3
## 6                                                             7.2
##                                                              DP05_0013PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!55 to 59 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.2
## 6                                                                    0.1
##                                                DP05_0014E
## 1 Estimate!!SEX AND AGE!!Total population!!60 to 64 years
## 2                                                  814251
## 3                                                  205797
## 4                                                  413293
## 5                                                  186387
## 6                                                  894782
##                                                       DP05_0014M
## 1 Margin of Error!!SEX AND AGE!!Total population!!60 to 64 years
## 2                                                           9868
## 3                                                           4119
## 4                                                           7024
## 5                                                           5137
## 6                                                           9663
##                                                       DP05_0014PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!60 to 64 years
## 2                                                             6.4
## 3                                                             6.5
## 4                                                             6.7
## 5                                                             6.1
## 6                                                             7.0
##                                                              DP05_0014PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!60 to 64 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.2
## 6                                                                    0.1
##                                                DP05_0015E
## 1 Estimate!!SEX AND AGE!!Total population!!65 to 74 years
## 2                                                 1143329
## 3                                                  299333
## 4                                                  596623
## 5                                                  291996
## 6                                                 1311159
##                                                       DP05_0015M
## 1 Margin of Error!!SEX AND AGE!!Total population!!65 to 74 years
## 2                                                           2976
## 3                                                           1873
## 4                                                           2812
## 5                                                           1221
## 6                                                           3293
##                                                       DP05_0015PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!65 to 74 years
## 2                                                             9.0
## 3                                                             9.5
## 4                                                             9.7
## 5                                                             9.6
## 6                                                            10.2
##                                                              DP05_0015PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!65 to 74 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                DP05_0016E
## 1 Estimate!!SEX AND AGE!!Total population!!75 to 84 years
## 2                                                  587651
## 3                                                  162869
## 4                                                  313646
## 5                                                  138844
## 6                                                  707570
##                                                       DP05_0016M
## 1 Margin of Error!!SEX AND AGE!!Total population!!75 to 84 years
## 2                                                           6188
## 3                                                           3158
## 4                                                           5352
## 5                                                           3225
## 6                                                           7958
##                                                       DP05_0016PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!75 to 84 years
## 2                                                             4.6
## 3                                                             5.2
## 4                                                             5.1
## 5                                                             4.6
## 6                                                             5.5
##                                                              DP05_0016PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!75 to 84 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                   DP05_0017E
## 1 Estimate!!SEX AND AGE!!Total population!!85 years and over
## 2                                                     259568
## 3                                                      75616
## 4                                                     124805
## 5                                                      44280
## 6                                                     313640
##                                                          DP05_0017M
## 1 Margin of Error!!SEX AND AGE!!Total population!!85 years and over
## 2                                                              5554
## 3                                                              3074
## 4                                                              5244
## 5                                                              3193
## 6                                                              7963
##                                                          DP05_0017PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!85 years and over
## 2                                                                2.0
## 3                                                                2.4
## 4                                                                2.0
## 5                                                                1.5
## 6                                                                2.4
##                                                                 DP05_0017PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!85 years and over
## 2                                                                       0.1
## 3                                                                       0.1
## 4                                                                       0.1
## 5                                                                       0.1
## 6                                                                       0.1
##                                                    DP05_0018E
## 1 Estimate!!SEX AND AGE!!Total population!!Median age (years)
## 2                                                        38.3
## 3                                                        38.1
## 4                                                        38.8
## 5                                                        38.2
## 6                                                        40.8
##                                                           DP05_0018M
## 1 Margin of Error!!SEX AND AGE!!Total population!!Median age (years)
## 2                                                                0.1
## 3                                                                0.2
## 4                                                                0.1
## 5                                                                0.2
## 6                                                                0.1
##                                                           DP05_0018PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!Median age (years)
## 2                                                                 (X)
## 3                                                                 (X)
## 4                                                                 (X)
## 5                                                                 (X)
## 6                                                                 (X)
##                                                                  DP05_0018PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!Median age (years)
## 2                                                                        (X)
## 3                                                                        (X)
## 4                                                                        (X)
## 5                                                                        (X)
## 6                                                                        (X)
##                                                DP05_0019E
## 1 Estimate!!SEX AND AGE!!Total population!!Under 18 years
## 2                                                 2855802
## 3                                                  733389
## 4                                                 1377726
## 5                                                  689220
## 6                                                 2647617
##                                                       DP05_0019M
## 1 Margin of Error!!SEX AND AGE!!Total population!!Under 18 years
## 2                                                           2274
## 3                                                           2389
## 4                                                           3160
## 5                                                            913
## 6                                                           1899
##                                                       DP05_0019PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!Under 18 years
## 2                                                            22.4
## 3                                                            23.2
## 4                                                            22.5
## 5                                                            22.7
## 6                                                            20.7
##                                                              DP05_0019PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!Under 18 years
## 2                                                                    0.1
## 3                                                                    0.1
## 4                                                                    0.1
## 5                                                                    0.1
## 6                                                                    0.1
##                                                   DP05_0020E
## 1 Estimate!!SEX AND AGE!!Total population!!16 years and over
## 2                                                   10216304
## 3                                                    2506580
## 4                                                    4907003
## 5                                                    2420990
## 6                                                   10470798
##                                                          DP05_0020M
## 1 Margin of Error!!SEX AND AGE!!Total population!!16 years and over
## 2                                                              5459
## 3                                                              3373
## 4                                                              4497
## 5                                                              3306
## 6                                                              5368
##                                                          DP05_0020PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!16 years and over
## 2                                                               80.2
## 3                                                               79.4
## 4                                                               80.1
## 5                                                               79.8
## 6                                                               81.8
##                                                                 DP05_0020PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!16 years and over
## 2                                                                       0.1
## 3                                                                       0.1
## 4                                                                       0.1
## 5                                                                       0.1
## 6                                                                       0.1
##                                                   DP05_0021E
## 1 Estimate!!SEX AND AGE!!Total population!!18 years and over
## 2                                                    9885278
## 3                                                    2422756
## 4                                                    4748726
## 5                                                    2345172
## 6                                                   10159443
##                                                          DP05_0021M
## 1 Margin of Error!!SEX AND AGE!!Total population!!18 years and over
## 2                                                              2274
## 3                                                              2389
## 4                                                              3160
## 5                                                               913
## 6                                                              1899
##                                                          DP05_0021PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!18 years and over
## 2                                                               77.6
## 3                                                               76.8
## 4                                                               77.5
## 5                                                               77.3
## 6                                                               79.3
##                                                                 DP05_0021PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!18 years and over
## 2                                                                       0.1
## 3                                                                       0.1
## 4                                                                       0.1
## 5                                                                       0.1
## 6                                                                       0.1
##                                                   DP05_0022E
## 1 Estimate!!SEX AND AGE!!Total population!!21 years and over
## 2                                                    9379230
## 3                                                    2277260
## 4                                                    4505646
## 5                                                    2236266
## 6                                                    9635621
##                                                          DP05_0022M
## 1 Margin of Error!!SEX AND AGE!!Total population!!21 years and over
## 2                                                              8440
## 3                                                              5679
## 4                                                              6850
## 5                                                              4122
## 6                                                              7363
##                                                          DP05_0022PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!21 years and over
## 2                                                               73.6
## 3                                                               72.2
## 4                                                               73.5
## 5                                                               73.7
## 6                                                               75.2
##                                                                 DP05_0022PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!21 years and over
## 2                                                                       0.1
## 3                                                                       0.2
## 4                                                                       0.1
## 5                                                                       0.1
## 6                                                                       0.1
##                                                   DP05_0023E
## 1 Estimate!!SEX AND AGE!!Total population!!62 years and over
## 2                                                    2459839
## 3                                                     661366
## 4                                                    1284321
## 5                                                     589051
## 6                                                    2861918
##                                                          DP05_0023M
## 1 Margin of Error!!SEX AND AGE!!Total population!!62 years and over
## 2                                                              9329
## 3                                                              4411
## 4                                                              6208
## 5                                                              4630
## 6                                                              9666
##                                                          DP05_0023PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!62 years and over
## 2                                                               19.3
## 3                                                               21.0
## 4                                                               21.0
## 5                                                               19.4
## 6                                                               22.3
##                                                                 DP05_0023PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!62 years and over
## 2                                                                       0.1
## 3                                                                       0.1
## 4                                                                       0.1
## 5                                                                       0.2
## 6                                                                       0.1
##                                                   DP05_0024E
## 1 Estimate!!SEX AND AGE!!Total population!!65 years and over
## 2                                                    1990548
## 3                                                     537818
## 4                                                    1035074
## 5                                                     475120
## 6                                                    2332369
##                                                          DP05_0024M
## 1 Margin of Error!!SEX AND AGE!!Total population!!65 years and over
## 2                                                              2970
## 3                                                              2027
## 4                                                              3446
## 5                                                              1480
## 6                                                              2802
##                                                          DP05_0024PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!65 years and over
## 2                                                               15.6
## 3                                                               17.0
## 4                                                               16.9
## 5                                                               15.7
## 6                                                               18.2
##                                                                 DP05_0024PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!65 years and over
## 2                                                                       0.1
## 3                                                                       0.1
## 4                                                                       0.1
## 5                                                                       0.1
## 6                                                                       0.1
##                                                   DP05_0025E
## 1 Estimate!!SEX AND AGE!!Total population!!18 years and over
## 2                                                    9885278
## 3                                                    2422756
## 4                                                    4748726
## 5                                                    2345172
## 6                                                   10159443
##                                                          DP05_0025M
## 1 Margin of Error!!SEX AND AGE!!Total population!!18 years and over
## 2                                                              2274
## 3                                                              2389
## 4                                                              3160
## 5                                                               913
## 6                                                              1899
##                                                          DP05_0025PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!18 years and over
## 2                                                            9885278
## 3                                                            2422756
## 4                                                            4748726
## 5                                                            2345172
## 6                                                           10159443
##                                                                 DP05_0025PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!18 years and over
## 2                                                                       (X)
## 3                                                                       (X)
## 4                                                                       (X)
## 5                                                                       (X)
## 6                                                                       (X)
##                                                         DP05_0026E
## 1 Estimate!!SEX AND AGE!!Total population!!18 years and over!!Male
## 2                                                          4801941
## 3                                                          1188114
## 4                                                          2298091
## 5                                                          1169070
## 6                                                          4919474
##                                                                DP05_0026M
## 1 Margin of Error!!SEX AND AGE!!Total population!!18 years and over!!Male
## 2                                                                    3028
## 3                                                                    2543
## 4                                                                    3571
## 5                                                                    1337
## 6                                                                    3260
##                                                                DP05_0026PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!18 years and over!!Male
## 2                                                                     48.6
## 3                                                                     49.0
## 4                                                                     48.4
## 5                                                                     49.9
## 6                                                                     48.4
##                                                                       DP05_0026PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!18 years and over!!Male
## 2                                                                             0.1
## 3                                                                             0.1
## 4                                                                             0.1
## 5                                                                             0.1
## 6                                                                             0.1
##                                                           DP05_0027E
## 1 Estimate!!SEX AND AGE!!Total population!!18 years and over!!Female
## 2                                                            5083337
## 3                                                            1234642
## 4                                                            2450635
## 5                                                            1176102
## 6                                                            5239969
##                                                                  DP05_0027M
## 1 Margin of Error!!SEX AND AGE!!Total population!!18 years and over!!Female
## 2                                                                      2781
## 3                                                                      2254
## 4                                                                      3289
## 5                                                                      1437
## 6                                                                      3023
##                                                                  DP05_0027PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!18 years and over!!Female
## 2                                                                       51.4
## 3                                                                       51.0
## 4                                                                       51.6
## 5                                                                       50.1
## 6                                                                       51.6
##                                                                         DP05_0027PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!18 years and over!!Female
## 2                                                                               0.1
## 3                                                                               0.1
## 4                                                                               0.1
## 5                                                                               0.1
## 6                                                                               0.1
##                                                                                      DP05_0028E
## 1 Estimate!!SEX AND AGE!!Total population!!18 years and over!!Sex ratio (males per 100 females)
## 2                                                                                          94.5
## 3                                                                                          96.2
## 4                                                                                          93.8
## 5                                                                                          99.4
## 6                                                                                          93.9
##                                                                                             DP05_0028M
## 1 Margin of Error!!SEX AND AGE!!Total population!!18 years and over!!Sex ratio (males per 100 females)
## 2                                                                                                  0.1
## 3                                                                                                  0.3
## 4                                                                                                  0.2
## 5                                                                                                  0.2
## 6                                                                                                  0.1
##                                                                                             DP05_0028PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!18 years and over!!Sex ratio (males per 100 females)
## 2                                                                                                   (X)
## 3                                                                                                   (X)
## 4                                                                                                   (X)
## 5                                                                                                   (X)
## 6                                                                                                   (X)
##                                                                                                    DP05_0028PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!18 years and over!!Sex ratio (males per 100 females)
## 2                                                                                                          (X)
## 3                                                                                                          (X)
## 4                                                                                                          (X)
## 5                                                                                                          (X)
## 6                                                                                                          (X)
##                                                   DP05_0029E
## 1 Estimate!!SEX AND AGE!!Total population!!65 years and over
## 2                                                    1990548
## 3                                                     537818
## 4                                                    1035074
## 5                                                     475120
## 6                                                    2332369
##                                                          DP05_0029M
## 1 Margin of Error!!SEX AND AGE!!Total population!!65 years and over
## 2                                                              2970
## 3                                                              2027
## 4                                                              3446
## 5                                                              1480
## 6                                                              2802
##                                                          DP05_0029PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!65 years and over
## 2                                                            1990548
## 3                                                             537818
## 4                                                            1035074
## 5                                                             475120
## 6                                                            2332369
##                                                                 DP05_0029PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!65 years and over
## 2                                                                       (X)
## 3                                                                       (X)
## 4                                                                       (X)
## 5                                                                       (X)
## 6                                                                       (X)
##                                                         DP05_0030E
## 1 Estimate!!SEX AND AGE!!Total population!!65 years and over!!Male
## 2                                                           869736
## 3                                                           239515
## 4                                                           456820
## 5                                                           223916
## 6                                                          1020825
##                                                                DP05_0030M
## 1 Margin of Error!!SEX AND AGE!!Total population!!65 years and over!!Male
## 2                                                                    1783
## 3                                                                    1176
## 4                                                                    2154
## 5                                                                    1014
## 6                                                                    1549
##                                                                DP05_0030PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!65 years and over!!Male
## 2                                                                     43.7
## 3                                                                     44.5
## 4                                                                     44.1
## 5                                                                     47.1
## 6                                                                     43.8
##                                                                       DP05_0030PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!65 years and over!!Male
## 2                                                                             0.1
## 3                                                                             0.1
## 4                                                                             0.1
## 5                                                                             0.1
## 6                                                                             0.1
##                                                           DP05_0031E
## 1 Estimate!!SEX AND AGE!!Total population!!65 years and over!!Female
## 2                                                            1120812
## 3                                                             298303
## 4                                                             578254
## 5                                                             251204
## 6                                                            1311544
##                                                                  DP05_0031M
## 1 Margin of Error!!SEX AND AGE!!Total population!!65 years and over!!Female
## 2                                                                      2090
## 3                                                                      1394
## 4                                                                      2434
## 5                                                                       930
## 6                                                                      2017
##                                                                  DP05_0031PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!65 years and over!!Female
## 2                                                                       56.3
## 3                                                                       55.5
## 4                                                                       55.9
## 5                                                                       52.9
## 6                                                                       56.2
##                                                                         DP05_0031PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!65 years and over!!Female
## 2                                                                               0.1
## 3                                                                               0.1
## 4                                                                               0.1
## 5                                                                               0.1
## 6                                                                               0.1
##                                                                                      DP05_0032E
## 1 Estimate!!SEX AND AGE!!Total population!!65 years and over!!Sex ratio (males per 100 females)
## 2                                                                                          77.6
## 3                                                                                          80.3
## 4                                                                                          79.0
## 5                                                                                          89.1
## 6                                                                                          77.8
##                                                                                             DP05_0032M
## 1 Margin of Error!!SEX AND AGE!!Total population!!65 years and over!!Sex ratio (males per 100 females)
## 2                                                                                                  0.2
## 3                                                                                                  0.5
## 4                                                                                                  0.5
## 5                                                                                                  0.5
## 6                                                                                                  0.1
##                                                                                             DP05_0032PE
## 1 Percent Estimate!!SEX AND AGE!!Total population!!65 years and over!!Sex ratio (males per 100 females)
## 2                                                                                                   (X)
## 3                                                                                                   (X)
## 4                                                                                                   (X)
## 5                                                                                                   (X)
## 6                                                                                                   (X)
##                                                                                                    DP05_0032PM
## 1 Percent Margin of Error!!SEX AND AGE!!Total population!!65 years and over!!Sex ratio (males per 100 females)
## 2                                                                                                          (X)
## 3                                                                                                          (X)
## 4                                                                                                          (X)
## 5                                                                                                          (X)
## 6                                                                                                          (X)
##                         DP05_0033E                              DP05_0033M
## 1 Estimate!!RACE!!Total population Margin of Error!!RACE!!Total population
## 2                         12741080                                   *****
## 3                          3156145                                   *****
## 4                          6126452                                   *****
## 5                          3034392                                   *****
## 6                         12807060                                   *****
##                                DP05_0033PE
## 1 Percent Estimate!!RACE!!Total population
## 2                                 12741080
## 3                                  3156145
## 4                                  6126452
## 5                                  3034392
## 6                                 12807060
##                                       DP05_0033PM
## 1 Percent Margin of Error!!RACE!!Total population
## 2                                             (X)
## 3                                             (X)
## 4                                             (X)
## 5                                             (X)
## 6                                             (X)
##                                   DP05_0034E
## 1 Estimate!!RACE!!Total population!!One race
## 2                                   12400103
## 3                                    3086877
## 4                                    5952588
## 5                                    2878562
## 6                                   12473515
##                                          DP05_0034M
## 1 Margin of Error!!RACE!!Total population!!One race
## 2                                             12577
## 3                                              5586
## 4                                              7671
## 5                                              9895
## 6                                             13725
##                                          DP05_0034PE
## 1 Percent Estimate!!RACE!!Total population!!One race
## 2                                               97.3
## 3                                               97.8
## 4                                               97.2
## 5                                               94.9
## 6                                               97.4
##                                                 DP05_0034PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race
## 2                                                       0.1
## 3                                                       0.2
## 4                                                       0.1
## 5                                                       0.3
## 6                                                       0.1
##                                            DP05_0035E
## 1 Estimate!!RACE!!Total population!!Two or more races
## 2                                              340977
## 3                                               69268
## 4                                              173864
## 5                                              155830
## 6                                              333545
##                                                   DP05_0035M
## 1 Margin of Error!!RACE!!Total population!!Two or more races
## 2                                                      12577
## 3                                                       5586
## 4                                                       7671
## 5                                                       9895
## 6                                                      13725
##                                                   DP05_0035PE
## 1 Percent Estimate!!RACE!!Total population!!Two or more races
## 2                                                         2.7
## 3                                                         2.2
## 4                                                         2.8
## 5                                                         5.1
## 6                                                         2.6
##                                                          DP05_0035PM
## 1 Percent Margin of Error!!RACE!!Total population!!Two or more races
## 2                                                                0.1
## 3                                                                0.2
## 4                                                                0.1
## 5                                                                0.3
## 6                                                                0.1
##                                   DP05_0036E
## 1 Estimate!!RACE!!Total population!!One race
## 2                                   12400103
## 3                                    3086877
## 4                                    5952588
## 5                                    2878562
## 6                                   12473515
##                                          DP05_0036M
## 1 Margin of Error!!RACE!!Total population!!One race
## 2                                             12577
## 3                                              5586
## 4                                              7671
## 5                                              9895
## 6                                             13725
##                                          DP05_0036PE
## 1 Percent Estimate!!RACE!!Total population!!One race
## 2                                               97.3
## 3                                               97.8
## 4                                               97.2
## 5                                               94.9
## 6                                               97.4
##                                                 DP05_0036PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race
## 2                                                       0.1
## 3                                                       0.2
## 4                                                       0.1
## 5                                                       0.3
## 6                                                       0.1
##                                          DP05_0037E
## 1 Estimate!!RACE!!Total population!!One race!!White
## 2                                           9135145
## 3                                           2846099
## 4                                           5035197
## 5                                           1924976
## 6                                          10256084
##                                                 DP05_0037M
## 1 Margin of Error!!RACE!!Total population!!One race!!White
## 2                                                    26772
## 3                                                     5629
## 4                                                     7994
## 5                                                    16699
## 6                                                    17296
##                                                 DP05_0037PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!White
## 2                                                      71.7
## 3                                                      90.2
## 4                                                      82.2
## 5                                                      63.4
## 6                                                      80.1
##                                                        DP05_0037PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!White
## 2                                                              0.2
## 3                                                              0.2
## 4                                                              0.1
## 5                                                              0.6
## 6                                                              0.1
##                                                              DP05_0038E
## 1 Estimate!!RACE!!Total population!!One race!!Black or African American
## 2                                                               1793079
## 3                                                                115137
## 4                                                                704327
## 5                                                                280385
## 6                                                               1428406
##                                                                     DP05_0038M
## 1 Margin of Error!!RACE!!Total population!!One race!!Black or African American
## 2                                                                        10015
## 3                                                                         4782
## 4                                                                         6416
## 5                                                                         7032
## 6                                                                        12545
##                                                                     DP05_0038PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Black or African American
## 2                                                                          14.1
## 3                                                                           3.6
## 4                                                                          11.5
## 5                                                                           9.2
## 6                                                                          11.2
##                                                                            DP05_0038PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Black or African American
## 2                                                                                  0.1
## 3                                                                                  0.2
## 4                                                                                  0.1
## 5                                                                                  0.2
## 6                                                                                  0.1
##                                                                      DP05_0039E
## 1 Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native
## 2                                                                         35846
## 3                                                                         11494
## 4                                                                         27705
## 5                                                                         44666
## 6                                                                         21418
##                                                                             DP05_0039M
## 1 Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native
## 2                                                                                 4591
## 3                                                                                 1274
## 4                                                                                 3183
## 5                                                                                 3794
## 6                                                                                 2246
##                                                                             DP05_0039PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native
## 2                                                                                   0.3
## 3                                                                                   0.4
## 4                                                                                   0.5
## 5                                                                                   1.5
## 6                                                                                   0.2
##                                                                                    DP05_0039PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native
## 2                                                                                          0.1
## 3                                                                                          0.1
## 4                                                                                          0.1
## 5                                                                                          0.1
## 6                                                                                          0.1
##                                                                                                DP05_0040E
## 1 Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Cherokee tribal grouping
## 2                                                                                                    3055
## 3                                                                                                     603
## 4                                                                                                    8373
## 5                                                                                                    2626
## 6                                                                                                    2569
##                                                                                                       DP05_0040M
## 1 Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Cherokee tribal grouping
## 2                                                                                                           1023
## 3                                                                                                            412
## 4                                                                                                           1600
## 5                                                                                                           1119
## 6                                                                                                           1058
##                                                                                                       DP05_0040PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Cherokee tribal grouping
## 2                                                                                                             0.0
## 3                                                                                                             0.0
## 4                                                                                                             0.1
## 5                                                                                                             0.1
## 6                                                                                                             0.0
##                                                                                                              DP05_0040PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Cherokee tribal grouping
## 2                                                                                                                    0.1
## 3                                                                                                                    0.1
## 4                                                                                                                    0.1
## 5                                                                                                                    0.1
## 6                                                                                                                    0.1
##                                                                                                DP05_0041E
## 1 Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Chippewa tribal grouping
## 2                                                                                                    2651
## 3                                                                                                     153
## 4                                                                                                     462
## 5                                                                                                     512
## 6                                                                                                     351
##                                                                                                       DP05_0041M
## 1 Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Chippewa tribal grouping
## 2                                                                                                           1224
## 3                                                                                                            142
## 4                                                                                                            359
## 5                                                                                                            505
## 6                                                                                                            267
##                                                                                                       DP05_0041PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Chippewa tribal grouping
## 2                                                                                                             0.0
## 3                                                                                                             0.0
## 4                                                                                                             0.0
## 5                                                                                                             0.0
## 6                                                                                                             0.0
##                                                                                                              DP05_0041PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Chippewa tribal grouping
## 2                                                                                                                    0.1
## 3                                                                                                                    0.1
## 4                                                                                                                    0.1
## 5                                                                                                                    0.1
## 6                                                                                                                    0.1
##                                                                                              DP05_0042E
## 1 Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Navajo tribal grouping
## 2                                                                                                   135
## 3                                                                                                   264
## 4                                                                                                  1210
## 5                                                                                                  2425
## 6                                                                                                   302
##                                                                                                     DP05_0042M
## 1 Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Navajo tribal grouping
## 2                                                                                                          212
## 3                                                                                                          218
## 4                                                                                                          790
## 5                                                                                                         1174
## 6                                                                                                          372
##                                                                                                     DP05_0042PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Navajo tribal grouping
## 2                                                                                                           0.0
## 3                                                                                                           0.0
## 4                                                                                                           0.0
## 5                                                                                                           0.1
## 6                                                                                                           0.0
##                                                                                                            DP05_0042PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Navajo tribal grouping
## 2                                                                                                                  0.1
## 3                                                                                                                  0.1
## 4                                                                                                                  0.1
## 5                                                                                                                  0.1
## 6                                                                                                                  0.1
##                                                                                             DP05_0043E
## 1 Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Sioux tribal grouping
## 2                                                                                                  222
## 3                                                                                                 1964
## 4                                                                                                  653
## 5                                                                                                  857
## 6                                                                                                  447
##                                                                                                    DP05_0043M
## 1 Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Sioux tribal grouping
## 2                                                                                                         174
## 3                                                                                                         681
## 4                                                                                                         330
## 5                                                                                                         451
## 6                                                                                                         425
##                                                                                                    DP05_0043PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Sioux tribal grouping
## 2                                                                                                          0.0
## 3                                                                                                          0.1
## 4                                                                                                          0.0
## 5                                                                                                          0.0
## 6                                                                                                          0.0
##                                                                                                           DP05_0043PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!American Indian and Alaska Native!!Sioux tribal grouping
## 2                                                                                                                 0.1
## 3                                                                                                                 0.1
## 4                                                                                                                 0.1
## 5                                                                                                                 0.1
## 6                                                                                                                 0.1
##                                          DP05_0044E
## 1 Estimate!!RACE!!Total population!!One race!!Asian
## 2                                            717938
## 3                                             79971
## 4                                            121417
## 5                                            250137
## 6                                            455027
##                                                 DP05_0044M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian
## 2                                                     6617
## 3                                                     3082
## 4                                                     3689
## 5                                                     5954
## 6                                                     6288
##                                                 DP05_0044PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian
## 2                                                       5.6
## 3                                                       2.5
## 4                                                       2.0
## 5                                                       8.2
## 6                                                       3.6
##                                                        DP05_0044PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian
## 2                                                              0.1
## 3                                                              0.1
## 4                                                              0.1
## 5                                                              0.2
## 6                                                              0.1
##                                                        DP05_0045E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Asian Indian
## 2                                                          256122
## 3                                                           12415
## 4                                                           30435
## 5                                                           11123
## 6                                                          143539
##                                                               DP05_0045M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Asian Indian
## 2                                                                  10098
## 3                                                                   2942
## 4                                                                   3766
## 5                                                                   2466
## 6                                                                   8217
##                                                               DP05_0045PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Asian Indian
## 2                                                                     2.0
## 3                                                                     0.4
## 4                                                                     0.5
## 5                                                                     0.4
## 6                                                                     1.1
##                                                                      DP05_0045PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Asian Indian
## 2                                                                            0.1
## 3                                                                            0.1
## 4                                                                            0.1
## 5                                                                            0.1
## 6                                                                            0.1
##                                                   DP05_0046E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Chinese
## 2                                                     132447
## 3                                                      13121
## 4                                                      29621
## 5                                                      39196
## 6                                                     119817
##                                                          DP05_0046M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Chinese
## 2                                                              8810
## 3                                                              1977
## 4                                                              3299
## 5                                                              5103
## 6                                                              7260
##                                                          DP05_0046PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Chinese
## 2                                                                1.0
## 3                                                                0.4
## 4                                                                0.5
## 5                                                                1.3
## 6                                                                0.9
##                                                                 DP05_0046PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Chinese
## 2                                                                       0.1
## 3                                                                       0.1
## 4                                                                       0.1
## 5                                                                       0.2
## 6                                                                       0.1
##                                                    DP05_0047E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Filipino
## 2                                                      124649
## 3                                                        5029
## 4                                                       11302
## 5                                                      129739
## 6                                                       25128
##                                                           DP05_0047M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Filipino
## 2                                                               8120
## 3                                                               1225
## 4                                                               2102
## 5                                                               7539
## 6                                                               3284
##                                                           DP05_0047PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Filipino
## 2                                                                 1.0
## 3                                                                 0.2
## 4                                                                 0.2
## 5                                                                 4.3
## 6                                                                 0.2
##                                                                  DP05_0047PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Filipino
## 2                                                                        0.1
## 3                                                                        0.1
## 4                                                                        0.1
## 5                                                                        0.2
## 6                                                                        0.1
##                                                    DP05_0048E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Japanese
## 2                                                       17958
## 3                                                        1494
## 4                                                        2388
## 5                                                       11514
## 6                                                        5056
##                                                           DP05_0048M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Japanese
## 2                                                               2295
## 3                                                                775
## 4                                                               1159
## 5                                                               2257
## 6                                                               1189
##                                                           DP05_0048PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Japanese
## 2                                                                 0.1
## 3                                                                 0.0
## 4                                                                 0.0
## 5                                                                 0.4
## 6                                                                 0.0
##                                                                  DP05_0048PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Japanese
## 2                                                                        0.1
## 3                                                                        0.1
## 4                                                                        0.1
## 5                                                                        0.1
## 6                                                                        0.1
##                                                  DP05_0049E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Korean
## 2                                                     56597
## 3                                                      6717
## 4                                                     11526
## 5                                                     11750
## 6                                                     39144
##                                                         DP05_0049M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Korean
## 2                                                             5468
## 3                                                             1890
## 4                                                             1973
## 5                                                             2453
## 6                                                             4971
##                                                         DP05_0049PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Korean
## 2                                                               0.4
## 3                                                               0.2
## 4                                                               0.2
## 5                                                               0.4
## 6                                                               0.3
##                                                                DP05_0049PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Korean
## 2                                                                      0.1
## 3                                                                      0.1
## 4                                                                      0.1
## 5                                                                      0.1
## 6                                                                      0.1
##                                                      DP05_0050E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Vietnamese
## 2                                                         35367
## 3                                                         11705
## 4                                                         17208
## 5                                                         17744
## 6                                                         40920
##                                                             DP05_0050M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Vietnamese
## 2                                                                 6566
## 3                                                                 2817
## 4                                                                 4212
## 5                                                                 4766
## 6                                                                 4670
##                                                             DP05_0050PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Vietnamese
## 2                                                                   0.3
## 3                                                                   0.4
## 4                                                                   0.3
## 5                                                                   0.6
## 6                                                                   0.3
##                                                                    DP05_0050PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Vietnamese
## 2                                                                          0.1
## 3                                                                          0.1
## 4                                                                          0.1
## 5                                                                          0.2
## 6                                                                          0.1
##                                                       DP05_0051E
## 1 Estimate!!RACE!!Total population!!One race!!Asian!!Other Asian
## 2                                                          94798
## 3                                                          29490
## 4                                                          18937
## 5                                                          29071
## 6                                                          81423
##                                                              DP05_0051M
## 1 Margin of Error!!RACE!!Total population!!One race!!Asian!!Other Asian
## 2                                                                  8476
## 3                                                                  3525
## 4                                                                  3013
## 5                                                                  4901
## 6                                                                  6597
##                                                              DP05_0051PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Asian!!Other Asian
## 2                                                                    0.7
## 3                                                                    0.9
## 4                                                                    0.3
## 5                                                                    1.0
## 6                                                                    0.6
##                                                                     DP05_0051PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Asian!!Other Asian
## 2                                                                           0.1
## 3                                                                           0.1
## 4                                                                           0.1
## 5                                                                           0.2
## 6                                                                           0.1
##                                                                               DP05_0052E
## 1 Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander
## 2                                                                                   5317
## 3                                                                                   3463
## 4                                                                                   7385
## 5                                                                                  19612
## 6                                                                                   5008
##                                                                                      DP05_0052M
## 1 Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander
## 2                                                                                          1835
## 3                                                                                          1362
## 4                                                                                          1417
## 5                                                                                          1707
## 6                                                                                          1684
##                                                                                      DP05_0052PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander
## 2                                                                                            0.0
## 3                                                                                            0.1
## 4                                                                                            0.1
## 5                                                                                            0.6
## 6                                                                                            0.0
##                                                                                             DP05_0052PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander
## 2                                                                                                   0.1
## 3                                                                                                   0.1
## 4                                                                                                   0.1
## 5                                                                                                   0.1
## 6                                                                                                   0.1
##                                                                                                DP05_0053E
## 1 Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Native Hawaiian
## 2                                                                                                    1927
## 3                                                                                                     541
## 4                                                                                                    1844
## 5                                                                                                    6472
## 6                                                                                                     935
##                                                                                                       DP05_0053M
## 1 Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Native Hawaiian
## 2                                                                                                            757
## 3                                                                                                            474
## 4                                                                                                           1238
## 5                                                                                                           1757
## 6                                                                                                            498
##                                                                                                       DP05_0053PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Native Hawaiian
## 2                                                                                                             0.0
## 3                                                                                                             0.0
## 4                                                                                                             0.0
## 5                                                                                                             0.2
## 6                                                                                                             0.0
##                                                                                                              DP05_0053PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Native Hawaiian
## 2                                                                                                                    0.1
## 3                                                                                                                    0.1
## 4                                                                                                                    0.1
## 5                                                                                                                    0.1
## 6                                                                                                                    0.1
##                                                                                                      DP05_0054E
## 1 Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Guamanian or Chamorro
## 2                                                                                                           789
## 3                                                                                                           561
## 4                                                                                                           226
## 5                                                                                                          5668
## 6                                                                                                           746
##                                                                                                             DP05_0054M
## 1 Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Guamanian or Chamorro
## 2                                                                                                                  461
## 3                                                                                                                  469
## 4                                                                                                                  247
## 5                                                                                                                 2108
## 6                                                                                                                  528
##                                                                                                             DP05_0054PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Guamanian or Chamorro
## 2                                                                                                                   0.0
## 3                                                                                                                   0.0
## 4                                                                                                                   0.0
## 5                                                                                                                   0.2
## 6                                                                                                                   0.0
##                                                                                                                    DP05_0054PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Guamanian or Chamorro
## 2                                                                                                                          0.1
## 3                                                                                                                          0.1
## 4                                                                                                                          0.1
## 5                                                                                                                          0.1
## 6                                                                                                                          0.1
##                                                                                       DP05_0055E
## 1 Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Samoan
## 2                                                                                            710
## 3                                                                                            348
## 4                                                                                           2729
## 5                                                                                           3528
## 6                                                                                            766
##                                                                                              DP05_0055M
## 1 Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Samoan
## 2                                                                                                   681
## 3                                                                                                   473
## 4                                                                                                   828
## 5                                                                                                  1359
## 6                                                                                                   483
##                                                                                              DP05_0055PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Samoan
## 2                                                                                                    0.0
## 3                                                                                                    0.0
## 4                                                                                                    0.0
## 5                                                                                                    0.1
## 6                                                                                                    0.0
##                                                                                                     DP05_0055PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Samoan
## 2                                                                                                           0.1
## 3                                                                                                           0.1
## 4                                                                                                           0.1
## 5                                                                                                           0.1
## 6                                                                                                           0.1
##                                                                                                       DP05_0056E
## 1 Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Other Pacific Islander
## 2                                                                                                           1891
## 3                                                                                                           2013
## 4                                                                                                           2586
## 5                                                                                                           3944
## 6                                                                                                           2561
##                                                                                                              DP05_0056M
## 1 Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Other Pacific Islander
## 2                                                                                                                  1640
## 3                                                                                                                  1109
## 4                                                                                                                   660
## 5                                                                                                                  1984
## 6                                                                                                                  1515
##                                                                                                              DP05_0056PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Other Pacific Islander
## 2                                                                                                                    0.0
## 3                                                                                                                    0.1
## 4                                                                                                                    0.0
## 5                                                                                                                    0.1
## 6                                                                                                                    0.0
##                                                                                                                     DP05_0056PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Other Pacific Islander
## 2                                                                                                                           0.1
## 3                                                                                                                           0.1
## 4                                                                                                                           0.1
## 5                                                                                                                           0.1
## 6                                                                                                                           0.1
##                                                    DP05_0057E
## 1 Estimate!!RACE!!Total population!!One race!!Some other race
## 2                                                      712778
## 3                                                       30713
## 4                                                       56557
## 5                                                      358786
## 6                                                      307572
##                                                           DP05_0057M
## 1 Margin of Error!!RACE!!Total population!!One race!!Some other race
## 2                                                              25545
## 3                                                               5286
## 4                                                               6735
## 5                                                              16689
## 6                                                              16186
##                                                           DP05_0057PE
## 1 Percent Estimate!!RACE!!Total population!!One race!!Some other race
## 2                                                                 5.6
## 3                                                                 1.0
## 4                                                                 0.9
## 5                                                                11.8
## 6                                                                 2.4
##                                                                  DP05_0057PM
## 1 Percent Margin of Error!!RACE!!Total population!!One race!!Some other race
## 2                                                                        0.2
## 3                                                                        0.2
## 4                                                                        0.1
## 5                                                                        0.5
## 6                                                                        0.1
##                                            DP05_0058E
## 1 Estimate!!RACE!!Total population!!Two or more races
## 2                                              340977
## 3                                               69268
## 4                                              173864
## 5                                              155830
## 6                                              333545
##                                                   DP05_0058M
## 1 Margin of Error!!RACE!!Total population!!Two or more races
## 2                                                      12577
## 3                                                       5586
## 4                                                       7671
## 5                                                       9895
## 6                                                      13725
##                                                   DP05_0058PE
## 1 Percent Estimate!!RACE!!Total population!!Two or more races
## 2                                                         2.7
## 3                                                         2.2
## 4                                                         2.8
## 5                                                         5.1
## 6                                                         2.6
##                                                          DP05_0058PM
## 1 Percent Margin of Error!!RACE!!Total population!!Two or more races
## 2                                                                0.1
## 3                                                                0.2
## 4                                                                0.1
## 5                                                                0.3
## 6                                                                0.1
##                                                                                 DP05_0059E
## 1 Estimate!!RACE!!Total population!!Two or more races!!White and Black or African American
## 2                                                                                   116872
## 3                                                                                    30402
## 4                                                                                    75345
## 5                                                                                    32463
## 6                                                                                   148313
##                                                                                        DP05_0059M
## 1 Margin of Error!!RACE!!Total population!!Two or more races!!White and Black or African American
## 2                                                                                            7015
## 3                                                                                            3934
## 4                                                                                            5750
## 5                                                                                            5046
## 6                                                                                            9404
##                                                                                        DP05_0059PE
## 1 Percent Estimate!!RACE!!Total population!!Two or more races!!White and Black or African American
## 2                                                                                              0.9
## 3                                                                                              1.0
## 4                                                                                              1.2
## 5                                                                                              1.1
## 6                                                                                              1.2
##                                                                                               DP05_0059PM
## 1 Percent Margin of Error!!RACE!!Total population!!Two or more races!!White and Black or African American
## 2                                                                                                     0.1
## 3                                                                                                     0.1
## 4                                                                                                     0.1
## 5                                                                                                     0.2
## 6                                                                                                     0.1
##                                                                                         DP05_0060E
## 1 Estimate!!RACE!!Total population!!Two or more races!!White and American Indian and Alaska Native
## 2                                                                                            35817
## 3                                                                                             9285
## 4                                                                                            39150
## 5                                                                                            14754
## 6                                                                                            32795
##                                                                                                DP05_0060M
## 1 Margin of Error!!RACE!!Total population!!Two or more races!!White and American Indian and Alaska Native
## 2                                                                                                    3506
## 3                                                                                                    1612
## 4                                                                                                    3567
## 5                                                                                                    2162
## 6                                                                                                    2462
##                                                                                                DP05_0060PE
## 1 Percent Estimate!!RACE!!Total population!!Two or more races!!White and American Indian and Alaska Native
## 2                                                                                                      0.3
## 3                                                                                                      0.3
## 4                                                                                                      0.6
## 5                                                                                                      0.5
## 6                                                                                                      0.3
##                                                                                                       DP05_0060PM
## 1 Percent Margin of Error!!RACE!!Total population!!Two or more races!!White and American Indian and Alaska Native
## 2                                                                                                             0.1
## 3                                                                                                             0.1
## 4                                                                                                             0.1
## 5                                                                                                             0.1
## 6                                                                                                             0.1
##                                                             DP05_0061E
## 1 Estimate!!RACE!!Total population!!Two or more races!!White and Asian
## 2                                                                82982
## 3                                                                13266
## 4                                                                29126
## 5                                                                38991
## 6                                                                55627
##                                                                    DP05_0061M
## 1 Margin of Error!!RACE!!Total population!!Two or more races!!White and Asian
## 2                                                                        7432
## 3                                                                        2302
## 4                                                                        3547
## 5                                                                        5565
## 6                                                                        5231
##                                                                    DP05_0061PE
## 1 Percent Estimate!!RACE!!Total population!!Two or more races!!White and Asian
## 2                                                                          0.7
## 3                                                                          0.4
## 4                                                                          0.5
## 5                                                                          1.3
## 6                                                                          0.4
##                                                                           DP05_0061PM
## 1 Percent Margin of Error!!RACE!!Total population!!Two or more races!!White and Asian
## 2                                                                                 0.1
## 3                                                                                 0.1
## 4                                                                                 0.1
## 5                                                                                 0.2
## 6                                                                                 0.1
##                                                                                                             DP05_0062E
## 1 Estimate!!RACE!!Total population!!Two or more races!!Black or African American and American Indian and Alaska Native
## 2                                                                                                                 8368
## 3                                                                                                                 1951
## 4                                                                                                                 4404
## 5                                                                                                                 5393
## 6                                                                                                                11223
##                                                                                                                    DP05_0062M
## 1 Margin of Error!!RACE!!Total population!!Two or more races!!Black or African American and American Indian and Alaska Native
## 2                                                                                                                        2255
## 3                                                                                                                        1063
## 4                                                                                                                        1478
## 5                                                                                                                        2120
## 6                                                                                                                        2142
##                                                                                                                    DP05_0062PE
## 1 Percent Estimate!!RACE!!Total population!!Two or more races!!Black or African American and American Indian and Alaska Native
## 2                                                                                                                          0.1
## 3                                                                                                                          0.1
## 4                                                                                                                          0.1
## 5                                                                                                                          0.2
## 6                                                                                                                          0.1
##                                                                                                                           DP05_0062PM
## 1 Percent Margin of Error!!RACE!!Total population!!Two or more races!!Black or African American and American Indian and Alaska Native
## 2                                                                                                                                 0.1
## 3                                                                                                                                 0.1
## 4                                                                                                                                 0.1
## 5                                                                                                                                 0.1
## 6                                                                                                                                 0.1
##                                                                              DP05_0063E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population
## 2                                                                              12741080
## 3                                                                               3156145
## 4                                                                               6126452
## 5                                                                               3034392
## 6                                                                              12807060
##                                                                                     DP05_0063M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population
## 2                                                                                        *****
## 3                                                                                        *****
## 4                                                                                        *****
## 5                                                                                        *****
## 6                                                                                        *****
##                                                                                     DP05_0063PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population
## 2                                                                                      12741080
## 3                                                                                       3156145
## 4                                                                                       6126452
## 5                                                                                       3034392
## 6                                                                                      12807060
##                                                                                            DP05_0063PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population
## 2                                                                                                  (X)
## 3                                                                                                  (X)
## 4                                                                                                  (X)
## 5                                                                                                  (X)
## 6                                                                                                  (X)
##                                                                                     DP05_0064E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population!!White
## 2                                                                                      9431680
## 3                                                                                      2909568
## 4                                                                                      5196815
## 5                                                                                      2050048
## 6                                                                                     10543254
##                                                                                            DP05_0064M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population!!White
## 2                                                                                               27696
## 3                                                                                                7192
## 4                                                                                               10284
## 5                                                                                               19415
## 6                                                                                               19389
##                                                                                            DP05_0064PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population!!White
## 2                                                                                                 74.0
## 3                                                                                                 92.2
## 4                                                                                                 84.8
## 5                                                                                                 67.6
## 6                                                                                                 82.3
##                                                                                                   DP05_0064PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population!!White
## 2                                                                                                         0.2
## 3                                                                                                         0.2
## 4                                                                                                         0.2
## 5                                                                                                         0.6
## 6                                                                                                         0.2
##                                                                                                         DP05_0065E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population!!Black or African American
## 2                                                                                                          1952694
## 3                                                                                                           151562
## 4                                                                                                           794984
## 5                                                                                                           337660
## 6                                                                                                          1632035
##                                                                                                                DP05_0065M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Black or African American
## 2                                                                                                                    6946
## 3                                                                                                                    2986
## 4                                                                                                                    4485
## 5                                                                                                                    5928
## 6                                                                                                                    9570
##                                                                                                                DP05_0065PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population!!Black or African American
## 2                                                                                                                     15.3
## 3                                                                                                                      4.8
## 4                                                                                                                     13.0
## 5                                                                                                                     11.1
## 6                                                                                                                     12.7
##                                                                                                                       DP05_0065PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Black or African American
## 2                                                                                                                             0.1
## 3                                                                                                                             0.1
## 4                                                                                                                             0.1
## 5                                                                                                                             0.2
## 6                                                                                                                             0.1
##                                                                                                                 DP05_0066E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population!!American Indian and Alaska Native
## 2                                                                                                                   100555
## 3                                                                                                                    27116
## 4                                                                                                                    79954
## 5                                                                                                                    71817
## 6                                                                                                                    89728
##                                                                                                                        DP05_0066M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population!!American Indian and Alaska Native
## 2                                                                                                                            6939
## 3                                                                                                                            2729
## 4                                                                                                                            4579
## 5                                                                                                                            4490
## 6                                                                                                                            5118
##                                                                                                                        DP05_0066PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population!!American Indian and Alaska Native
## 2                                                                                                                              0.8
## 3                                                                                                                              0.9
## 4                                                                                                                              1.3
## 5                                                                                                                              2.4
## 6                                                                                                                              0.7
##                                                                                                                               DP05_0066PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population!!American Indian and Alaska Native
## 2                                                                                                                                     0.1
## 3                                                                                                                                     0.1
## 4                                                                                                                                     0.1
## 5                                                                                                                                     0.1
## 6                                                                                                                                     0.1
##                                                                                     DP05_0067E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population!!Asian
## 2                                                                                       831487
## 3                                                                                        98900
## 4                                                                                       159166
## 5                                                                                       318010
## 6                                                                                       536235
##                                                                                            DP05_0067M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Asian
## 2                                                                                                4879
## 3                                                                                                2688
## 4                                                                                                2654
## 5                                                                                                4322
## 6                                                                                                4513
##                                                                                            DP05_0067PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population!!Asian
## 2                                                                                                  6.5
## 3                                                                                                  3.1
## 4                                                                                                  2.6
## 5                                                                                                 10.5
## 6                                                                                                  4.2
##                                                                                                   DP05_0067PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Asian
## 2                                                                                                         0.1
## 3                                                                                                         0.1
## 4                                                                                                         0.1
## 5                                                                                                         0.1
## 6                                                                                                         0.1
##                                                                                                                          DP05_0068E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population!!Native Hawaiian and Other Pacific Islander
## 2                                                                                                                             16444
## 3                                                                                                                              6579
## 4                                                                                                                             13760
## 5                                                                                                                             41746
## 6                                                                                                                             18764
##                                                                                                                                 DP05_0068M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Native Hawaiian and Other Pacific Islander
## 2                                                                                                                                     3163
## 3                                                                                                                                     1746
## 4                                                                                                                                     2328
## 5                                                                                                                                     3352
## 6                                                                                                                                     3667
##                                                                                                                                 DP05_0068PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population!!Native Hawaiian and Other Pacific Islander
## 2                                                                                                                                       0.1
## 3                                                                                                                                       0.2
## 4                                                                                                                                       0.2
## 5                                                                                                                                       1.4
## 6                                                                                                                                       0.1
##                                                                                                                                        DP05_0068PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Native Hawaiian and Other Pacific Islander
## 2                                                                                                                                              0.1
## 3                                                                                                                                              0.1
## 4                                                                                                                                              0.1
## 5                                                                                                                                              0.1
## 6                                                                                                                                              0.1
##                                                                                               DP05_0069E
## 1 Estimate!!Race alone or in combination with one or more other races!!Total population!!Some other race
## 2                                                                                                 776129
## 3                                                                                                  37007
## 4                                                                                                  66685
## 5                                                                                                 390057
## 6                                                                                                 355417
##                                                                                                      DP05_0069M
## 1 Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Some other race
## 2                                                                                                         26600
## 3                                                                                                          5555
## 4                                                                                                          7078
## 5                                                                                                         15973
## 6                                                                                                         16623
##                                                                                                      DP05_0069PE
## 1 Percent Estimate!!Race alone or in combination with one or more other races!!Total population!!Some other race
## 2                                                                                                            6.1
## 3                                                                                                            1.2
## 4                                                                                                            1.1
## 5                                                                                                           12.9
## 6                                                                                                            2.8
##                                                                                                             DP05_0069PM
## 1 Percent Margin of Error!!Race alone or in combination with one or more other races!!Total population!!Some other race
## 2                                                                                                                   0.2
## 3                                                                                                                   0.2
## 4                                                                                                                   0.1
## 5                                                                                                                   0.5
## 6                                                                                                                   0.1
##                                                DP05_0070E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population
## 2                                                12741080
## 3                                                 3156145
## 4                                                 6126452
## 5                                                 3034392
## 6                                                12807060
##                                                       DP05_0070M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population
## 2                                                          *****
## 3                                                          *****
## 4                                                          *****
## 5                                                          *****
## 6                                                          *****
##                                                       DP05_0070PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population
## 2                                                        12741080
## 3                                                         3156145
## 4                                                         6126452
## 5                                                         3034392
## 6                                                        12807060
##                                                              DP05_0070PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population
## 2                                                                    (X)
## 3                                                                    (X)
## 4                                                                    (X)
## 5                                                                    (X)
## 6                                                                    (X)
##                                                                                  DP05_0071E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)
## 2                                                                                   2208868
## 3                                                                                    191473
## 4                                                                                    253474
## 5                                                                                    881145
## 6                                                                                    974763
##                                                                                         DP05_0071M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)
## 2                                                                                             1158
## 3                                                                                              901
## 4                                                                                             2044
## 5                                                                                            *****
## 6                                                                                             1237
##                                                                                         DP05_0071PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)
## 2                                                                                              17.3
## 3                                                                                               6.1
## 4                                                                                               4.1
## 5                                                                                              29.0
## 6                                                                                               7.6
##                                                                                                DP05_0071PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)
## 2                                                                                                      0.1
## 3                                                                                                      0.1
## 4                                                                                                      0.1
## 5                                                                                                    *****
## 6                                                                                                      0.1
##                                                                                           DP05_0072E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Mexican
## 2                                                                                            1744028
## 3                                                                                             155179
## 4                                                                                             179787
## 5                                                                                             668365
## 6                                                                                             158286
##                                                                                                  DP05_0072M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Mexican
## 2                                                                                                     18280
## 3                                                                                                      4714
## 4                                                                                                      5745
## 5                                                                                                     11586
## 6                                                                                                     10718
##                                                                                                  DP05_0072PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Mexican
## 2                                                                                                       13.7
## 3                                                                                                        4.9
## 4                                                                                                        2.9
## 5                                                                                                       22.0
## 6                                                                                                        1.2
##                                                                                                         DP05_0072PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Mexican
## 2                                                                                                               0.1
## 3                                                                                                               0.1
## 4                                                                                                               0.1
## 5                                                                                                               0.4
## 6                                                                                                               0.1
##                                                                                                DP05_0073E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Puerto Rican
## 2                                                                                                  206543
## 3                                                                                                    7792
## 4                                                                                                   16816
## 5                                                                                                   25740
## 6                                                                                                  477312
##                                                                                                       DP05_0073M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Puerto Rican
## 2                                                                                                          13313
## 3                                                                                                           2075
## 4                                                                                                           3020
## 5                                                                                                           3589
## 6                                                                                                          13697
##                                                                                                       DP05_0073PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Puerto Rican
## 2                                                                                                             1.6
## 3                                                                                                             0.2
## 4                                                                                                             0.3
## 5                                                                                                             0.8
## 6                                                                                                             3.7
##                                                                                                              DP05_0073PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Puerto Rican
## 2                                                                                                                    0.1
## 3                                                                                                                    0.1
## 4                                                                                                                    0.1
## 5                                                                                                                    0.1
## 6                                                                                                                    0.1
##                                                                                         DP05_0074E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Cuban
## 2                                                                                            27617
## 3                                                                                             1714
## 4                                                                                             8220
## 5                                                                                            35071
## 6                                                                                            24185
##                                                                                                DP05_0074M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Cuban
## 2                                                                                                    3919
## 3                                                                                                     696
## 4                                                                                                    2577
## 5                                                                                                    5849
## 6                                                                                                    3640
##                                                                                                DP05_0074PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Cuban
## 2                                                                                                      0.2
## 3                                                                                                      0.1
## 4                                                                                                      0.1
## 5                                                                                                      1.2
## 6                                                                                                      0.2
##                                                                                                       DP05_0074PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Cuban
## 2                                                                                                             0.1
## 3                                                                                                             0.1
## 4                                                                                                             0.1
## 5                                                                                                             0.2
## 6                                                                                                             0.1
##                                                                                                            DP05_0075E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Other Hispanic or Latino
## 2                                                                                                              230680
## 3                                                                                                               26788
## 4                                                                                                               48651
## 5                                                                                                              151969
## 6                                                                                                              314980
##                                                                                                                   DP05_0075M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Other Hispanic or Latino
## 2                                                                                                                      14103
## 3                                                                                                                       4189
## 4                                                                                                                       5487
## 5                                                                                                                      10271
## 6                                                                                                                      15287
##                                                                                                                   DP05_0075PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Other Hispanic or Latino
## 2                                                                                                                         1.8
## 3                                                                                                                         0.8
## 4                                                                                                                         0.8
## 5                                                                                                                         5.0
## 6                                                                                                                         2.5
##                                                                                                                          DP05_0075PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Other Hispanic or Latino
## 2                                                                                                                                0.1
## 3                                                                                                                                0.1
## 4                                                                                                                                0.1
## 5                                                                                                                                0.3
## 6                                                                                                                                0.1
##                                                                        DP05_0076E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino
## 2                                                                        10532212
## 3                                                                         2964672
## 4                                                                         5872978
## 5                                                                         2153247
## 6                                                                        11832297
##                                                                               DP05_0076M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino
## 2                                                                                   1158
## 3                                                                                    901
## 4                                                                                   2044
## 5                                                                                  *****
## 6                                                                                   1237
##                                                                               DP05_0076PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino
## 2                                                                                    82.7
## 3                                                                                    93.9
## 4                                                                                    95.9
## 5                                                                                    71.0
## 6                                                                                    92.4
##                                                                                      DP05_0076PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino
## 2                                                                                            0.1
## 3                                                                                            0.1
## 4                                                                                            0.1
## 5                                                                                          *****
## 6                                                                                            0.1
##                                                                                     DP05_0077E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!White alone
## 2                                                                                      7760732
## 3                                                                                      2695583
## 4                                                                                      4857174
## 5                                                                                      1469593
## 6                                                                                      9723288
##                                                                                            DP05_0077M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!White alone
## 2                                                                                                3669
## 3                                                                                                2165
## 4                                                                                                2076
## 5                                                                                                1806
## 6                                                                                                3360
##                                                                                            DP05_0077PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!White alone
## 2                                                                                                 60.9
## 3                                                                                                 85.4
## 4                                                                                                 79.3
## 5                                                                                                 48.4
## 6                                                                                                 75.9
##                                                                                                   DP05_0077PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!White alone
## 2                                                                                                         0.1
## 3                                                                                                         0.1
## 4                                                                                                         0.1
## 5                                                                                                         0.1
## 6                                                                                                         0.1
##                                                                                                         DP05_0078E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Black or African American alone
## 2                                                                                                          1759316
## 3                                                                                                           113562
## 4                                                                                                           698641
## 5                                                                                                           266440
## 6                                                                                                          1352804
##                                                                                                                DP05_0078M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Black or African American alone
## 2                                                                                                                    8262
## 3                                                                                                                    4619
## 4                                                                                                                    6145
## 5                                                                                                                    5865
## 6                                                                                                                    9315
##                                                                                                                DP05_0078PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Black or African American alone
## 2                                                                                                                     13.8
## 3                                                                                                                      3.6
## 4                                                                                                                     11.4
## 5                                                                                                                      8.8
## 6                                                                                                                     10.6
##                                                                                                                       DP05_0078PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Black or African American alone
## 2                                                                                                                             0.1
## 3                                                                                                                             0.1
## 4                                                                                                                             0.1
## 5                                                                                                                             0.2
## 6                                                                                                                             0.1
##                                                                                                                 DP05_0079E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!American Indian and Alaska Native alone
## 2                                                                                                                    17215
## 3                                                                                                                     9710
## 4                                                                                                                    23149
## 5                                                                                                                    30185
## 6                                                                                                                    14367
##                                                                                                                        DP05_0079M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!American Indian and Alaska Native alone
## 2                                                                                                                            2351
## 3                                                                                                                             951
## 4                                                                                                                            2507
## 5                                                                                                                            2060
## 6                                                                                                                            1986
##                                                                                                                        DP05_0079PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!American Indian and Alaska Native alone
## 2                                                                                                                              0.1
## 3                                                                                                                              0.3
## 4                                                                                                                              0.4
## 5                                                                                                                              1.0
## 6                                                                                                                              0.1
##                                                                                                                               DP05_0079PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!American Indian and Alaska Native alone
## 2                                                                                                                                     0.1
## 3                                                                                                                                     0.1
## 4                                                                                                                                     0.1
## 5                                                                                                                                     0.1
## 6                                                                                                                                     0.1
##                                                                                     DP05_0080E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Asian alone
## 2                                                                                       711970
## 3                                                                                        79643
## 4                                                                                       120440
## 5                                                                                       244471
## 6                                                                                       450077
##                                                                                            DP05_0080M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Asian alone
## 2                                                                                                6521
## 3                                                                                                3042
## 4                                                                                                3635
## 5                                                                                                5630
## 6                                                                                                5816
##                                                                                            DP05_0080PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Asian alone
## 2                                                                                                  5.6
## 3                                                                                                  2.5
## 4                                                                                                  2.0
## 5                                                                                                  8.1
## 6                                                                                                  3.5
##                                                                                                   DP05_0080PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Asian alone
## 2                                                                                                         0.1
## 3                                                                                                         0.1
## 4                                                                                                         0.1
## 5                                                                                                         0.2
## 6                                                                                                         0.1
##                                                                                                                          DP05_0081E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Native Hawaiian and Other Pacific Islander alone
## 2                                                                                                                              2887
## 3                                                                                                                              2945
## 4                                                                                                                              7095
## 5                                                                                                                             18249
## 6                                                                                                                              3557
##                                                                                                                                 DP05_0081M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Native Hawaiian and Other Pacific Islander alone
## 2                                                                                                                                      697
## 3                                                                                                                                     1388
## 4                                                                                                                                     1376
## 5                                                                                                                                     1393
## 6                                                                                                                                     1479
##                                                                                                                                 DP05_0081PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Native Hawaiian and Other Pacific Islander alone
## 2                                                                                                                                       0.0
## 3                                                                                                                                       0.1
## 4                                                                                                                                       0.1
## 5                                                                                                                                       0.6
## 6                                                                                                                                       0.0
##                                                                                                                                        DP05_0081PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Native Hawaiian and Other Pacific Islander alone
## 2                                                                                                                                              0.1
## 3                                                                                                                                              0.1
## 4                                                                                                                                              0.1
## 5                                                                                                                                              0.1
## 6                                                                                                                                              0.1
##                                                                                               DP05_0082E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Some other race alone
## 2                                                                                                  24310
## 3                                                                                                   4000
## 4                                                                                                   9832
## 5                                                                                                  11810
## 6                                                                                                  21357
##                                                                                                      DP05_0082M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Some other race alone
## 2                                                                                                          3879
## 3                                                                                                          1973
## 4                                                                                                          2191
## 5                                                                                                          3634
## 6                                                                                                          3645
##                                                                                                      DP05_0082PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Some other race alone
## 2                                                                                                            0.2
## 3                                                                                                            0.1
## 4                                                                                                            0.2
## 5                                                                                                            0.4
## 6                                                                                                            0.2
##                                                                                                             DP05_0082PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Some other race alone
## 2                                                                                                                   0.1
## 3                                                                                                                   0.1
## 4                                                                                                                   0.1
## 5                                                                                                                   0.1
## 6                                                                                                                   0.1
##                                                                                           DP05_0083E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races
## 2                                                                                             255782
## 3                                                                                              59229
## 4                                                                                             156647
## 5                                                                                             112499
## 6                                                                                             266847
##                                                                                                  DP05_0083M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races
## 2                                                                                                     10111
## 3                                                                                                      4832
## 4                                                                                                      6711
## 5                                                                                                      8253
## 6                                                                                                     11020
##                                                                                                  DP05_0083PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races
## 2                                                                                                        2.0
## 3                                                                                                        1.9
## 4                                                                                                        2.6
## 5                                                                                                        3.7
## 6                                                                                                        2.1
##                                                                                                         DP05_0083PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races
## 2                                                                                                               0.1
## 3                                                                                                               0.2
## 4                                                                                                               0.1
## 5                                                                                                               0.3
## 6                                                                                                               0.1
##                                                                                                                                DP05_0084E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races including Some other race
## 2                                                                                                                                   11405
## 3                                                                                                                                     493
## 4                                                                                                                                    2330
## 5                                                                                                                                    3740
## 6                                                                                                                                   11356
##                                                                                                                                       DP05_0084M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races including Some other race
## 2                                                                                                                                           2606
## 3                                                                                                                                            321
## 4                                                                                                                                           1060
## 5                                                                                                                                           1741
## 6                                                                                                                                           2873
##                                                                                                                                       DP05_0084PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races including Some other race
## 2                                                                                                                                             0.1
## 3                                                                                                                                             0.0
## 4                                                                                                                                             0.0
## 5                                                                                                                                             0.1
## 6                                                                                                                                             0.1
##                                                                                                                                              DP05_0084PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races including Some other race
## 2                                                                                                                                                    0.1
## 3                                                                                                                                                    0.1
## 4                                                                                                                                                    0.1
## 5                                                                                                                                                    0.1
## 6                                                                                                                                                    0.1
##                                                                                                                                                         DP05_0085E
## 1 Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races excluding Some other race, and Three or more races
## 2                                                                                                                                                           244377
## 3                                                                                                                                                            58736
## 4                                                                                                                                                           154317
## 5                                                                                                                                                           108759
## 6                                                                                                                                                           255491
##                                                                                                                                                                DP05_0085M
## 1 Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races excluding Some other race, and Three or more races
## 2                                                                                                                                                                   10212
## 3                                                                                                                                                                    4738
## 4                                                                                                                                                                    6664
## 5                                                                                                                                                                    8217
## 6                                                                                                                                                                   10346
##                                                                                                                                                                DP05_0085PE
## 1 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races excluding Some other race, and Three or more races
## 2                                                                                                                                                                      1.9
## 3                                                                                                                                                                      1.9
## 4                                                                                                                                                                      2.5
## 5                                                                                                                                                                      3.6
## 6                                                                                                                                                                      2.0
##                                                                                                                                                                       DP05_0085PM
## 1 Percent Margin of Error!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races excluding Some other race, and Three or more races
## 2                                                                                                                                                                             0.1
## 3                                                                                                                                                                             0.2
## 4                                                                                                                                                                             0.1
## 5                                                                                                                                                                             0.3
## 6                                                                                                                                                                             0.1
##                      DP05_0086E                           DP05_0086M
## 1 Estimate!!Total housing units Margin of Error!!Total housing units
## 2                       5376176                                  518
## 3                       1409568                                  354
## 4                       2806296                                  623
## 5                       1268717                                  151
## 6                       5713136                                  439
##                             DP05_0086PE
## 1 Percent Estimate!!Total housing units
## 2                                   (X)
## 3                                   (X)
## 4                                   (X)
## 5                                   (X)
## 6                                   (X)
##                                    DP05_0086PM
## 1 Percent Margin of Error!!Total housing units
## 2                                          (X)
## 3                                          (X)
## 4                                          (X)
## 5                                          (X)
## 6                                          (X)
##                                                                  DP05_0087E
## 1 Estimate!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population
## 2                                                                   9074766
## 3                                                                   2327219
## 4                                                                   4633370
## 5                                                                   2075166
## 6                                                                   9781212
##                                                                         DP05_0087M
## 1 Margin of Error!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population
## 2                                                                            18777
## 3                                                                             6259
## 4                                                                             7810
## 5                                                                             9912
## 6                                                                            13540
##                                                                         DP05_0087PE
## 1 Percent Estimate!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population
## 2                                                                           9074766
## 3                                                                           2327219
## 4                                                                           4633370
## 5                                                                           2075166
## 6                                                                           9781212
##                                                                                DP05_0087PM
## 1 Percent Margin of Error!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population
## 2                                                                                      (X)
## 3                                                                                      (X)
## 4                                                                                      (X)
## 5                                                                                      (X)
## 6                                                                                      (X)
##                                                                        DP05_0088E
## 1 Estimate!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Male
## 2                                                                         4385340
## 3                                                                         1139250
## 4                                                                         2240784
## 5                                                                         1036350
## 6                                                                         4726343
##                                                                               DP05_0088M
## 1 Margin of Error!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Male
## 2                                                                                  12630
## 3                                                                                   3838
## 4                                                                                   5295
## 5                                                                                   6057
## 6                                                                                   8924
##                                                                               DP05_0088PE
## 1 Percent Estimate!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Male
## 2                                                                                    48.3
## 3                                                                                    49.0
## 4                                                                                    48.4
## 5                                                                                    49.9
## 6                                                                                    48.3
##                                                                                      DP05_0088PM
## 1 Percent Margin of Error!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Male
## 2                                                                                            0.1
## 3                                                                                            0.1
## 4                                                                                            0.1
## 5                                                                                            0.2
## 6                                                                                            0.1
##                                                                          DP05_0089E
## 1 Estimate!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Female
## 2                                                                           4689426
## 3                                                                           1187969
## 4                                                                           2392586
## 5                                                                           1038816
## 6                                                                           5054869
##                                                                                 DP05_0089M
## 1 Margin of Error!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Female
## 2                                                                                    12019
## 3                                                                                     4084
## 4                                                                                     5182
## 5                                                                                     5752
## 6                                                                                     8755
##                                                                                 DP05_0089PE
## 1 Percent Estimate!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Female
## 2                                                                                      51.7
## 3                                                                                      51.0
## 4                                                                                      51.6
## 5                                                                                      50.1
## 6                                                                                      51.7
##                                                                                        DP05_0089PM
## 1 Percent Margin of Error!!CITIZEN, VOTING AGE POPULATION!!Citizen, 18 and over population!!Female
## 2                                                                                              0.1
## 3                                                                                              0.1
## 4                                                                                              0.1
## 5                                                                                              0.2
## 6                                                                                              0.1
meta <- meta[,-3]              
head(meta)
##        GEO_ID                                                     id
## 1        NAME                                   Geographic Area Name
## 2  DP05_0001E                Estimate!!SEX AND AGE!!Total population
## 3  DP05_0001M         Margin of Error!!SEX AND AGE!!Total population
## 4 DP05_0001PE        Percent Estimate!!SEX AND AGE!!Total population
## 5 DP05_0001PM Percent Margin of Error!!SEX AND AGE!!Total population
## 6  DP05_0002E          Estimate!!SEX AND AGE!!Total population!!Male
df <- data[-c(1,21,40),-1]
row.names(df) <- NULL
df$NAME <- as.character(paste(df$NAME))
metanames <- meta$GEO_ID
dfnames <- as.factor(colnames(df))
length(metanames)==length(dfnames)
## [1] TRUE
g <- metanames==dfnames
sum(g==TRUE)
## [1] 357
meta$id <- as.character(paste(meta$id))

err <- grep('Error',meta$id)

DF <- df[,-err]
head(DF)
##           NAME DP05_0001E DP05_0001PE DP05_0002E DP05_0002PE DP05_0003E
## 1     Illinois   12741080    12741080    6266062        49.2    6475018
## 2         Iowa    3156145     3156145    1564888        49.6    1591257
## 3     Missouri    6126452     6126452    3003165        49.0    3123287
## 4       Nevada    3034392     3034392    1522374        50.2    1512018
## 5 Pennsylvania   12807060    12807060    6271620        49.0    6535440
## 6         Utah    3161105     3161105    1592457        50.4    1568648
##   DP05_0003PE DP05_0004E DP05_0004PE DP05_0005E DP05_0005PE DP05_0006E
## 1        50.8       96.8         (X)     759456         6.0     762237
## 2        50.4       98.3         (X)     197883         6.3     197454
## 3        51.0       96.2         (X)     370408         6.0     373737
## 4        49.8      100.7         (X)     184539         6.1     188880
## 5        51.0       96.0         (X)     700416         5.5     708163
## 6        49.6      101.5         (X)     250194         7.9     257110
##   DP05_0006PE DP05_0007E DP05_0007PE DP05_0008E DP05_0008PE DP05_0009E
## 1         6.0     838140         6.6     835845         6.6     839026
## 2         6.3     215222         6.8     220659         7.0     220135
## 3         6.1     401199         6.5     391923         6.4     406398
## 4         6.2     201625         6.6     182398         6.0     180376
## 5         5.5     775827         6.1     815621         6.4     812406
## 6         8.1     270952         8.6     250173         7.9     260774
##   DP05_0009PE DP05_0010E DP05_0010PE DP05_0011E DP05_0011PE DP05_0012E
## 1         6.6    1765517        13.9    1644390        12.9    1636054
## 2         7.0     394507        12.5     383617        12.2     369396
## 3         6.6     819132        13.4     742343        12.1     753354
## 4         5.9     442713        14.6     405128        13.4     396167
## 5         6.3    1695073        13.2    1496113        11.7    1659541
## 6         8.2     463344        14.7     437953        13.9     319031
##   DP05_0012PE DP05_0013E DP05_0013PE DP05_0014E DP05_0014PE DP05_0015E
## 1        12.8     855616         6.7     814251         6.4    1143329
## 2        11.7     213657         6.8     205797         6.5     299333
## 3        12.3     419591         6.8     413293         6.7     596623
## 4        13.1     191059         6.3     186387         6.1     291996
## 5        13.0     916749         7.2     894782         7.0    1311159
## 6        10.1     152425         4.8     147852         4.7     212206
##   DP05_0015PE DP05_0016E DP05_0016PE DP05_0017E DP05_0017PE DP05_0018E
## 1         9.0     587651         4.6     259568         2.0       38.3
## 2         9.5     162869         5.2      75616         2.4       38.1
## 3         9.7     313646         5.1     124805         2.0       38.8
## 4         9.6     138844         4.6      44280         1.5       38.2
## 5        10.2     707570         5.5     313640         2.4       40.8
## 6         6.7     103828         3.3      35263         1.1       31.0
##   DP05_0018PE DP05_0019E DP05_0019PE DP05_0020E DP05_0020PE DP05_0021E
## 1         (X)    2855802        22.4   10216304        80.2    9885278
## 2         (X)     733389        23.2    2506580        79.4    2422756
## 3         (X)    1377726        22.5    4907003        80.1    4748726
## 4         (X)     689220        22.7    2420990        79.8    2345172
## 5         (X)    2647617        20.7   10470798        81.8   10159443
## 6         (X)     931831        29.5    2329530        73.7    2229274
##   DP05_0021PE DP05_0022E DP05_0022PE DP05_0023E DP05_0023PE DP05_0024E
## 1        77.6    9379230        73.6    2459839        19.3    1990548
## 2        76.8    2277260        72.2     661366        21.0     537818
## 3        77.5    4505646        73.5    1284321        21.0    1035074
## 4        77.3    2236266        73.7     589051        19.4     475120
## 5        79.3    9635621        75.2    2861918        22.3    2332369
## 6        70.5    2087145        66.0     439430        13.9     351297
##   DP05_0024PE DP05_0025E DP05_0025PE DP05_0026E DP05_0026PE DP05_0027E
## 1        15.6    9885278     9885278    4801941        48.6    5083337
## 2        17.0    2422756     2422756    1188114        49.0    1234642
## 3        16.9    4748726     4748726    2298091        48.4    2450635
## 4        15.7    2345172     2345172    1169070        49.9    1176102
## 5        18.2   10159443    10159443    4919474        48.4    5239969
## 6        11.1    2229274     2229274    1113904        50.0    1115370
##   DP05_0027PE DP05_0028E DP05_0028PE DP05_0029E DP05_0029PE DP05_0030E
## 1        51.4       94.5         (X)    1990548     1990548     869736
## 2        51.0       96.2         (X)     537818      537818     239515
## 3        51.6       93.8         (X)    1035074     1035074     456820
## 4        50.1       99.4         (X)     475120      475120     223916
## 5        51.6       93.9         (X)    2332369     2332369    1020825
## 6        50.0       99.9         (X)     351297      351297     164068
##   DP05_0030PE DP05_0031E DP05_0031PE DP05_0032E DP05_0032PE DP05_0033E
## 1        43.7    1120812        56.3       77.6         (X)   12741080
## 2        44.5     298303        55.5       80.3         (X)    3156145
## 3        44.1     578254        55.9       79.0         (X)    6126452
## 4        47.1     251204        52.9       89.1         (X)    3034392
## 5        43.8    1311544        56.2       77.8         (X)   12807060
## 6        46.7     187229        53.3       87.6         (X)    3161105
##   DP05_0033PE DP05_0034E DP05_0034PE DP05_0035E DP05_0035PE DP05_0036E
## 1    12741080   12400103        97.3     340977         2.7   12400103
## 2     3156145    3086877        97.8      69268         2.2    3086877
## 3     6126452    5952588        97.2     173864         2.8    5952588
## 4     3034392    2878562        94.9     155830         5.1    2878562
## 5    12807060   12473515        97.4     333545         2.6   12473515
## 6     3161105    3059954        96.8     101151         3.2    3059954
##   DP05_0036PE DP05_0037E DP05_0037PE DP05_0038E DP05_0038PE DP05_0039E
## 1        97.3    9135145        71.7    1793079        14.1      35846
## 2        97.8    2846099        90.2     115137         3.6      11494
## 3        97.2    5035197        82.2     704327        11.5      27705
## 4        94.9    1924976        63.4     280385         9.2      44666
## 5        97.4   10256084        80.1    1428406        11.2      21418
## 6        96.8    2708195        85.7      40365         1.3      34678
##   DP05_0039PE DP05_0040E DP05_0040PE DP05_0041E DP05_0041PE DP05_0042E
## 1         0.3       3055         0.0       2651         0.0        135
## 2         0.4        603         0.0        153         0.0        264
## 3         0.5       8373         0.1        462         0.0       1210
## 4         1.5       2626         0.1        512         0.0       2425
## 5         0.2       2569         0.0        351         0.0        302
## 6         1.1        709         0.0          0         0.0      15970
##   DP05_0042PE DP05_0043E DP05_0043PE DP05_0044E DP05_0044PE DP05_0045E
## 1         0.0        222         0.0     717938         5.6     256122
## 2         0.0       1964         0.1      79971         2.5      12415
## 3         0.0        653         0.0     121417         2.0      30435
## 4         0.1        857         0.0     250137         8.2      11123
## 5         0.0        447         0.0     455027         3.6     143539
## 6         0.5       2265         0.1      75898         2.4      12079
##   DP05_0045PE DP05_0046E DP05_0046PE DP05_0047E DP05_0047PE DP05_0048E
## 1         2.0     132447         1.0     124649         1.0      17958
## 2         0.4      13121         0.4       5029         0.2       1494
## 3         0.5      29621         0.5      11302         0.2       2388
## 4         0.4      39196         1.3     129739         4.3      11514
## 5         1.1     119817         0.9      25128         0.2       5056
## 6         0.4      14285         0.5       8034         0.3       6208
##   DP05_0048PE DP05_0049E DP05_0049PE DP05_0050E DP05_0050PE DP05_0051E
## 1         0.1      56597         0.4      35367         0.3      94798
## 2         0.0       6717         0.2      11705         0.4      29490
## 3         0.0      11526         0.2      17208         0.3      18937
## 4         0.4      11750         0.4      17744         0.6      29071
## 5         0.0      39144         0.3      40920         0.3      81423
## 6         0.2       6756         0.2       9663         0.3      18873
##   DP05_0051PE DP05_0052E DP05_0052PE DP05_0053E DP05_0053PE DP05_0054E
## 1         0.7       5317         0.0       1927         0.0        789
## 2         0.9       3463         0.1        541         0.0        561
## 3         0.3       7385         0.1       1844         0.0        226
## 4         1.0      19612         0.6       6472         0.2       5668
## 5         0.6       5008         0.0        935         0.0        746
## 6         0.6      29362         0.9       2090         0.1        836
##   DP05_0054PE DP05_0055E DP05_0055PE DP05_0056E DP05_0056PE DP05_0057E
## 1         0.0        710         0.0       1891         0.0     712778
## 2         0.0        348         0.0       2013         0.1      30713
## 3         0.0       2729         0.0       2586         0.0      56557
## 4         0.2       3528         0.1       3944         0.1     358786
## 5         0.0        766         0.0       2561         0.0     307572
## 6         0.0       8386         0.3      18050         0.6     171456
##   DP05_0057PE DP05_0058E DP05_0058PE DP05_0059E DP05_0059PE DP05_0060E
## 1         5.6     340977         2.7     116872         0.9      35817
## 2         1.0      69268         2.2      30402         1.0       9285
## 3         0.9     173864         2.8      75345         1.2      39150
## 4        11.8     155830         5.1      32463         1.1      14754
## 5         2.4     333545         2.6     148313         1.2      32795
## 6         5.4     101151         3.2      12469         0.4      17190
##   DP05_0060PE DP05_0061E DP05_0061PE DP05_0062E DP05_0062PE DP05_0063E
## 1         0.3      82982         0.7       8368         0.1   12741080
## 2         0.3      13266         0.4       1951         0.1    3156145
## 3         0.6      29126         0.5       4404         0.1    6126452
## 4         0.5      38991         1.3       5393         0.2    3034392
## 5         0.3      55627         0.4      11223         0.1   12807060
## 6         0.5      29698         0.9        988         0.0    3161105
##   DP05_0063PE DP05_0064E DP05_0064PE DP05_0065E DP05_0065PE DP05_0066E
## 1    12741080    9431680        74.0    1952694        15.3     100555
## 2     3156145    2909568        92.2     151562         4.8      27116
## 3     6126452    5196815        84.8     794984        13.0      79954
## 4     3034392    2050048        67.6     337660        11.1      71817
## 5    12807060   10543254        82.3    1632035        12.7      89728
## 6     3161105    2800377        88.6      58241         1.8      56454
##   DP05_0066PE DP05_0067E DP05_0067PE DP05_0068E DP05_0068PE DP05_0069E
## 1         0.8     831487         6.5      16444         0.1     776129
## 2         0.9      98900         3.1       6579         0.2      37007
## 3         1.3     159166         2.6      13760         0.2      66685
## 4         2.4     318010        10.5      41746         1.4     390057
## 5         0.7     536235         4.2      18764         0.1     355417
## 6         1.8     115638         3.7      47609         1.5     191869
##   DP05_0069PE DP05_0070E DP05_0070PE DP05_0071E DP05_0071PE DP05_0072E
## 1         6.1   12741080    12741080    2208868        17.3    1744028
## 2         1.2    3156145     3156145     191473         6.1     155179
## 3         1.1    6126452     6126452     253474         4.1     179787
## 4        12.9    3034392     3034392     881145        29.0     668365
## 5         2.8   12807060    12807060     974763         7.6     158286
## 6         6.1    3161105     3161105     450220        14.2     313226
##   DP05_0072PE DP05_0073E DP05_0073PE DP05_0074E DP05_0074PE DP05_0075E
## 1        13.7     206543         1.6      27617         0.2     230680
## 2         4.9       7792         0.2       1714         0.1      26788
## 3         2.9      16816         0.3       8220         0.1      48651
## 4        22.0      25740         0.8      35071         1.2     151969
## 5         1.2     477312         3.7      24185         0.2     314980
## 6         9.9      12566         0.4       2766         0.1     121662
##   DP05_0075PE DP05_0076E DP05_0076PE DP05_0077E DP05_0077PE DP05_0078E
## 1         1.8   10532212        82.7    7760732        60.9    1759316
## 2         0.8    2964672        93.9    2695583        85.4     113562
## 3         0.8    5872978        95.9    4857174        79.3     698641
## 4         5.0    2153247        71.0    1469593        48.4     266440
## 5         2.5   11832297        92.4    9723288        75.9    1352804
## 6         3.8    2710885        85.8    2459891        77.8      37546
##   DP05_0078PE DP05_0079E DP05_0079PE DP05_0080E DP05_0080PE DP05_0081E
## 1        13.8      17215         0.1     711970         5.6       2887
## 2         3.6       9710         0.3      79643         2.5       2945
## 3        11.4      23149         0.4     120440         2.0       7095
## 4         8.8      30185         1.0     244471         8.1      18249
## 5        10.6      14367         0.1     450077         3.5       3557
## 6         1.2      27959         0.9      74784         2.4      28810
##   DP05_0081PE DP05_0082E DP05_0082PE DP05_0083E DP05_0083PE DP05_0084E
## 1         0.0      24310         0.2     255782         2.0      11405
## 2         0.1       4000         0.1      59229         1.9        493
## 3         0.1       9832         0.2     156647         2.6       2330
## 4         0.6      11810         0.4     112499         3.7       3740
## 5         0.0      21357         0.2     266847         2.1      11356
## 6         0.9       6356         0.2      75539         2.4       2925
##   DP05_0084PE DP05_0085E DP05_0085PE DP05_0086E DP05_0086PE DP05_0087E
## 1         0.1     244377         1.9    5376176         (X)    9074766
## 2         0.0      58736         1.9    1409568         (X)    2327219
## 3         0.0     154317         2.5    2806296         (X)    4633370
## 4         0.1     108759         3.6    1268717         (X)    2075166
## 5         0.1     255491         2.0    5713136         (X)    9781212
## 6         0.1      72614         2.3    1108739         (X)    2087341
##   DP05_0087PE DP05_0088E DP05_0088PE DP05_0089E DP05_0089PE
## 1     9074766    4385340        48.3    4689426        51.7
## 2     2327219    1139250        49.0    1187969        51.0
## 3     4633370    2240784        48.4    2392586        51.6
## 4     2075166    1036350        49.9    1038816        50.1
## 5     9781212    4726343        48.3    5054869        51.7
## 6     2087341    1041497        49.9    1045844        50.1
estimate <- grep('Estimate',meta$id)

Estimate <- meta[estimate,]
head(Estimate)
##         GEO_ID                                                      id
## 2   DP05_0001E                 Estimate!!SEX AND AGE!!Total population
## 4  DP05_0001PE         Percent Estimate!!SEX AND AGE!!Total population
## 6   DP05_0002E           Estimate!!SEX AND AGE!!Total population!!Male
## 8  DP05_0002PE   Percent Estimate!!SEX AND AGE!!Total population!!Male
## 10  DP05_0003E         Estimate!!SEX AND AGE!!Total population!!Female
## 12 DP05_0003PE Percent Estimate!!SEX AND AGE!!Total population!!Female
age <- Estimate[grep('AGE',Estimate$id),]
head(age)
##         GEO_ID                                                      id
## 2   DP05_0001E                 Estimate!!SEX AND AGE!!Total population
## 4  DP05_0001PE         Percent Estimate!!SEX AND AGE!!Total population
## 6   DP05_0002E           Estimate!!SEX AND AGE!!Total population!!Male
## 8  DP05_0002PE   Percent Estimate!!SEX AND AGE!!Total population!!Male
## 10  DP05_0003E         Estimate!!SEX AND AGE!!Total population!!Female
## 12 DP05_0003PE Percent Estimate!!SEX AND AGE!!Total population!!Female
race <- Estimate[grep('RACE',Estimate$id),]
head(race)
##          GEO_ID                                                          id
## 130  DP05_0033E                            Estimate!!RACE!!Total population
## 132 DP05_0033PE                    Percent Estimate!!RACE!!Total population
## 134  DP05_0034E                  Estimate!!RACE!!Total population!!One race
## 136 DP05_0034PE          Percent Estimate!!RACE!!Total population!!One race
## 138  DP05_0035E         Estimate!!RACE!!Total population!!Two or more races
## 140 DP05_0035PE Percent Estimate!!RACE!!Total population!!Two or more races
percentRace <- race[grep('Percent',race$id),]
percentRace$id <- gsub('Percent Estimate!!RACE!!','',percentRace$id)
percentRace
##          GEO_ID
## 132 DP05_0033PE
## 136 DP05_0034PE
## 140 DP05_0035PE
## 144 DP05_0036PE
## 148 DP05_0037PE
## 152 DP05_0038PE
## 156 DP05_0039PE
## 160 DP05_0040PE
## 164 DP05_0041PE
## 168 DP05_0042PE
## 172 DP05_0043PE
## 176 DP05_0044PE
## 180 DP05_0045PE
## 184 DP05_0046PE
## 188 DP05_0047PE
## 192 DP05_0048PE
## 196 DP05_0049PE
## 200 DP05_0050PE
## 204 DP05_0051PE
## 208 DP05_0052PE
## 212 DP05_0053PE
## 216 DP05_0054PE
## 220 DP05_0055PE
## 224 DP05_0056PE
## 228 DP05_0057PE
## 232 DP05_0058PE
## 236 DP05_0059PE
## 240 DP05_0060PE
## 244 DP05_0061PE
## 248 DP05_0062PE
## 280 DP05_0070PE
## 284 DP05_0071PE
## 288 DP05_0072PE
## 292 DP05_0073PE
## 296 DP05_0074PE
## 300 DP05_0075PE
## 304 DP05_0076PE
## 308 DP05_0077PE
## 312 DP05_0078PE
## 316 DP05_0079PE
## 320 DP05_0080PE
## 324 DP05_0081PE
## 328 DP05_0082PE
## 332 DP05_0083PE
## 336 DP05_0084PE
## 340 DP05_0085PE
##                                                                                                                                                                           id
## 132                                                                                                                                                         Total population
## 136                                                                                                                                               Total population!!One race
## 140                                                                                                                                      Total population!!Two or more races
## 144                                                                                                                                               Total population!!One race
## 148                                                                                                                                        Total population!!One race!!White
## 152                                                                                                                    Total population!!One race!!Black or African American
## 156                                                                                                            Total population!!One race!!American Indian and Alaska Native
## 160                                                                                  Total population!!One race!!American Indian and Alaska Native!!Cherokee tribal grouping
## 164                                                                                  Total population!!One race!!American Indian and Alaska Native!!Chippewa tribal grouping
## 168                                                                                    Total population!!One race!!American Indian and Alaska Native!!Navajo tribal grouping
## 172                                                                                     Total population!!One race!!American Indian and Alaska Native!!Sioux tribal grouping
## 176                                                                                                                                        Total population!!One race!!Asian
## 180                                                                                                                          Total population!!One race!!Asian!!Asian Indian
## 184                                                                                                                               Total population!!One race!!Asian!!Chinese
## 188                                                                                                                              Total population!!One race!!Asian!!Filipino
## 192                                                                                                                              Total population!!One race!!Asian!!Japanese
## 196                                                                                                                                Total population!!One race!!Asian!!Korean
## 200                                                                                                                            Total population!!One race!!Asian!!Vietnamese
## 204                                                                                                                           Total population!!One race!!Asian!!Other Asian
## 208                                                                                                   Total population!!One race!!Native Hawaiian and Other Pacific Islander
## 212                                                                                  Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Native Hawaiian
## 216                                                                            Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Guamanian or Chamorro
## 220                                                                                           Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Samoan
## 224                                                                           Total population!!One race!!Native Hawaiian and Other Pacific Islander!!Other Pacific Islander
## 228                                                                                                                              Total population!!One race!!Some other race
## 232                                                                                                                                      Total population!!Two or more races
## 236                                                                                                 Total population!!Two or more races!!White and Black or African American
## 240                                                                                         Total population!!Two or more races!!White and American Indian and Alaska Native
## 244                                                                                                                     Total population!!Two or more races!!White and Asian
## 248                                                                     Total population!!Two or more races!!Black or African American and American Indian and Alaska Native
## 280                                                                                                          Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population
## 284                                                                        Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)
## 288                                                               Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Mexican
## 292                                                          Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Puerto Rican
## 296                                                                 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Cuban
## 300                                              Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Hispanic or Latino (of any race)!!Other Hispanic or Latino
## 304                                                                                  Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino
## 308                                                                     Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!White alone
## 312                                                 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Black or African American alone
## 316                                         Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!American Indian and Alaska Native alone
## 320                                                                     Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Asian alone
## 324                                Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Native Hawaiian and Other Pacific Islander alone
## 328                                                           Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Some other race alone
## 332                                                               Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races
## 336                          Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races including Some other race
## 340 Percent Estimate!!HISPANIC OR LATINO AND RACE!!Total population!!Not Hispanic or Latino!!Two or more races!!Two races excluding Some other race, and Three or more races

Lets get the white, black, asian, native american indian, two or more total, pacific islander, and latino groups.

totalPop <- percentRace[1,]
black <- percentRace[6,]
white <- percentRace[5,]
twoOrMore <- percentRace[3,]
AmericanIndian <- percentRace[7,]
Asian <- percentRace[12,]
pacificIslander <- percentRace[20,]
LatinoHispanic <- percentRace[32,]

totalPop$id <- 'total_state_population'
black$id <- 'percent_black'
white$id <- 'percent_white'
twoOrMore$id <- 'percent_two_or_more'
AmericanIndian$id <- 'percent_Native_American'
Asian$id <- 'percent_Asian'
pacificIslander$id <- 'percent_Pacific_Islander'
LatinoHispanic$id <- 'percent_Latino'

EthnicBackground <- rbind(totalPop,black,white,twoOrMore,AmericanIndian,Asian,pacificIslander,LatinoHispanic)
EthnicBackground
##          GEO_ID                       id
## 132 DP05_0033PE   total_state_population
## 152 DP05_0038PE            percent_black
## 148 DP05_0037PE            percent_white
## 140 DP05_0035PE      percent_two_or_more
## 156 DP05_0039PE  percent_Native_American
## 176 DP05_0044PE            percent_Asian
## 208 DP05_0052PE percent_Pacific_Islander
## 284 DP05_0071PE           percent_Latino
IDs <- EthnicBackground$GEO_ID
class(IDs)
## [1] "factor"
IDs <- as.character(paste(IDs))
DF2 <- DF[,c('NAME',IDs)]
DF2
##              NAME DP05_0033PE DP05_0038PE DP05_0037PE DP05_0035PE DP05_0039PE
## 1        Illinois    12741080        14.1        71.7         2.7         0.3
## 2            Iowa     3156145         3.6        90.2         2.2         0.4
## 3        Missouri     6126452        11.5        82.2         2.8         0.5
## 4          Nevada     3034392         9.2        63.4         5.1         1.5
## 5    Pennsylvania    12807060        11.2        80.1         2.6         0.2
## 6            Utah     3161105         1.3        85.7         3.2         1.1
## 7   West Virginia     1805832         3.8        93.0         1.9         0.1
## 8        Colorado     5695564         4.2        84.1         4.0         1.0
## 9         Georgia    10519475        31.6        58.3         2.7         0.3
## 10          Idaho     1754208         0.7        89.9         3.0         1.3
## 11       Maryland     6042718        30.0        54.7         3.7         0.2
## 12     New Jersey     8908520        13.6        66.9         2.8         0.2
## 13     New Mexico     2095428         2.2        76.4         3.2         9.6
## 14           Ohio    11689442        12.4        81.0         3.1         0.2
## 15         Alaska      737438         3.4        64.4         8.4        15.1
## 16        Florida    21299325        16.0        74.6         2.9         0.3
## 17         Hawaii     1420491         2.0        24.3        24.3         0.2
## 18  Massachusetts     6902149         7.8        77.3         3.4         0.2
## 19 South Carolina     5084127        26.6        67.0         2.4         0.5
## 20          Maine     1338404         1.4        94.3         2.2         0.6
## 21 North Carolina    10383620        21.4        68.4         2.9         1.2
## 22   South Dakota      882235         2.2        84.0         2.7         8.8
## 23        Alabama     4887871        26.7        67.7         2.1         0.5
## 24        Indiana     6691878         9.5        82.8         2.7         0.2
## 25       Kentucky     4468402         7.9        86.7         2.4         0.2
## 26      Louisiana     4659978        32.4        61.7         2.3         0.6
## 27      Tennessee     6770010        16.8        77.3         2.2         0.3
## 28        Vermont      626299         1.2        94.1         2.0         0.3
## 29     Washington     7535591         3.9        74.8         6.0         1.3
## 30       Michigan     9995915        13.8        78.3         2.9         0.5
## 31       Nebraska     1929268         4.7        86.4         3.1         1.0
## 32  New Hampshire     1356458         1.7        92.4         2.2         0.3
## 33       Oklahoma     3943079         7.3        72.2         7.7         7.8
## 34         Oregon     4190713         2.0        83.9         4.7         1.2
## 35   Rhode Island     1057315         6.7        80.7         3.1         0.4
## 36      Wisconsin     5813568         6.4        85.3         2.5         0.9
## 37        Wyoming      577737         0.6        91.5         2.4         2.8
## 38       Arkansas     3013825        15.2        76.5         2.9         0.7
## 39     California    39557045         5.8        59.5         5.1         0.8
## 40       Delaware      967171        22.5        68.2         2.7         0.5
## 41         Kansas     2911510         5.9        84.0         3.7         0.9
## 42      Minnesota     5611179         6.6        82.5         3.1         1.1
## 43    Mississippi     2986530        38.0        58.1         1.5         0.4
## 44        Montana     1062305         0.5        88.6         3.1         6.4
## 45       Virginia     8517685        19.2        67.4         4.1         0.3
## 46        Arizona     7171646         4.7        78.0         4.0         4.6
## 47    Connecticut     3572665        11.0        75.2         3.4         0.3
## 48       New York    19542209        15.7        63.3         3.3         0.4
## 49   North Dakota      760077         3.4        85.7         2.3         5.4
## 50          Texas    28701845        12.3        73.5         2.7         0.5
##    DP05_0044PE DP05_0052PE DP05_0071PE
## 1          5.6         0.0        17.3
## 2          2.5         0.1         6.1
## 3          2.0         0.1         4.1
## 4          8.2         0.6        29.0
## 5          3.6         0.0         7.6
## 6          2.4         0.9        14.2
## 7          0.7         0.0         1.4
## 8          3.2         0.1        21.7
## 9          4.1         0.1         9.7
## 10         1.5         0.2        12.7
## 11         6.3         0.1        10.4
## 12         9.7         0.0        20.6
## 13         1.6         0.1        49.1
## 14         2.3         0.0         3.9
## 15         6.3         1.1         7.2
## 16         2.8         0.1        26.1
## 17        37.6        10.2        10.7
## 18         6.8         0.0        12.3
## 19         1.6         0.1         5.8
## 20         1.2         0.0         1.7
## 21         3.0         0.1         9.6
## 22         1.7         0.0         3.9
## 23         1.3         0.0         4.3
## 24         2.3         0.1         7.1
## 25         1.5         0.1         3.6
## 26         1.6         0.0         5.1
## 27         1.8         0.1         5.5
## 28         1.9         0.0         2.0
## 29         8.8         0.7        12.9
## 30         3.3         0.0         5.2
## 31         2.4         0.1        11.1
## 32         2.7         0.0         3.9
## 33         2.1         0.1        10.9
## 34         4.6         0.4        13.3
## 35         3.4         0.1        15.9
## 36         2.8         0.0         6.9
## 37         1.0         0.2        10.0
## 38         1.6         0.3         7.6
## 39        14.7         0.4        39.3
## 40         4.0         0.1         9.5
## 41         2.8         0.1        12.0
## 42         4.9         0.0         5.5
## 43         0.9         0.0         2.9
## 44         0.8         0.1         3.9
## 45         6.5         0.1         9.5
## 46         3.3         0.2        31.6
## 47         4.6         0.0        16.5
## 48         8.5         0.0        19.2
## 49         1.8         0.0         3.6
## 50         5.0         0.1        39.6
colnames(DF2) <- c('state',EthnicBackground$id)
DF2
##             state total_state_population percent_black percent_white
## 1        Illinois               12741080          14.1          71.7
## 2            Iowa                3156145           3.6          90.2
## 3        Missouri                6126452          11.5          82.2
## 4          Nevada                3034392           9.2          63.4
## 5    Pennsylvania               12807060          11.2          80.1
## 6            Utah                3161105           1.3          85.7
## 7   West Virginia                1805832           3.8          93.0
## 8        Colorado                5695564           4.2          84.1
## 9         Georgia               10519475          31.6          58.3
## 10          Idaho                1754208           0.7          89.9
## 11       Maryland                6042718          30.0          54.7
## 12     New Jersey                8908520          13.6          66.9
## 13     New Mexico                2095428           2.2          76.4
## 14           Ohio               11689442          12.4          81.0
## 15         Alaska                 737438           3.4          64.4
## 16        Florida               21299325          16.0          74.6
## 17         Hawaii                1420491           2.0          24.3
## 18  Massachusetts                6902149           7.8          77.3
## 19 South Carolina                5084127          26.6          67.0
## 20          Maine                1338404           1.4          94.3
## 21 North Carolina               10383620          21.4          68.4
## 22   South Dakota                 882235           2.2          84.0
## 23        Alabama                4887871          26.7          67.7
## 24        Indiana                6691878           9.5          82.8
## 25       Kentucky                4468402           7.9          86.7
## 26      Louisiana                4659978          32.4          61.7
## 27      Tennessee                6770010          16.8          77.3
## 28        Vermont                 626299           1.2          94.1
## 29     Washington                7535591           3.9          74.8
## 30       Michigan                9995915          13.8          78.3
## 31       Nebraska                1929268           4.7          86.4
## 32  New Hampshire                1356458           1.7          92.4
## 33       Oklahoma                3943079           7.3          72.2
## 34         Oregon                4190713           2.0          83.9
## 35   Rhode Island                1057315           6.7          80.7
## 36      Wisconsin                5813568           6.4          85.3
## 37        Wyoming                 577737           0.6          91.5
## 38       Arkansas                3013825          15.2          76.5
## 39     California               39557045           5.8          59.5
## 40       Delaware                 967171          22.5          68.2
## 41         Kansas                2911510           5.9          84.0
## 42      Minnesota                5611179           6.6          82.5
## 43    Mississippi                2986530          38.0          58.1
## 44        Montana                1062305           0.5          88.6
## 45       Virginia                8517685          19.2          67.4
## 46        Arizona                7171646           4.7          78.0
## 47    Connecticut                3572665          11.0          75.2
## 48       New York               19542209          15.7          63.3
## 49   North Dakota                 760077           3.4          85.7
## 50          Texas               28701845          12.3          73.5
##    percent_two_or_more percent_Native_American percent_Asian
## 1                  2.7                     0.3           5.6
## 2                  2.2                     0.4           2.5
## 3                  2.8                     0.5           2.0
## 4                  5.1                     1.5           8.2
## 5                  2.6                     0.2           3.6
## 6                  3.2                     1.1           2.4
## 7                  1.9                     0.1           0.7
## 8                  4.0                     1.0           3.2
## 9                  2.7                     0.3           4.1
## 10                 3.0                     1.3           1.5
## 11                 3.7                     0.2           6.3
## 12                 2.8                     0.2           9.7
## 13                 3.2                     9.6           1.6
## 14                 3.1                     0.2           2.3
## 15                 8.4                    15.1           6.3
## 16                 2.9                     0.3           2.8
## 17                24.3                     0.2          37.6
## 18                 3.4                     0.2           6.8
## 19                 2.4                     0.5           1.6
## 20                 2.2                     0.6           1.2
## 21                 2.9                     1.2           3.0
## 22                 2.7                     8.8           1.7
## 23                 2.1                     0.5           1.3
## 24                 2.7                     0.2           2.3
## 25                 2.4                     0.2           1.5
## 26                 2.3                     0.6           1.6
## 27                 2.2                     0.3           1.8
## 28                 2.0                     0.3           1.9
## 29                 6.0                     1.3           8.8
## 30                 2.9                     0.5           3.3
## 31                 3.1                     1.0           2.4
## 32                 2.2                     0.3           2.7
## 33                 7.7                     7.8           2.1
## 34                 4.7                     1.2           4.6
## 35                 3.1                     0.4           3.4
## 36                 2.5                     0.9           2.8
## 37                 2.4                     2.8           1.0
## 38                 2.9                     0.7           1.6
## 39                 5.1                     0.8          14.7
## 40                 2.7                     0.5           4.0
## 41                 3.7                     0.9           2.8
## 42                 3.1                     1.1           4.9
## 43                 1.5                     0.4           0.9
## 44                 3.1                     6.4           0.8
## 45                 4.1                     0.3           6.5
## 46                 4.0                     4.6           3.3
## 47                 3.4                     0.3           4.6
## 48                 3.3                     0.4           8.5
## 49                 2.3                     5.4           1.8
## 50                 2.7                     0.5           5.0
##    percent_Pacific_Islander percent_Latino
## 1                       0.0           17.3
## 2                       0.1            6.1
## 3                       0.1            4.1
## 4                       0.6           29.0
## 5                       0.0            7.6
## 6                       0.9           14.2
## 7                       0.0            1.4
## 8                       0.1           21.7
## 9                       0.1            9.7
## 10                      0.2           12.7
## 11                      0.1           10.4
## 12                      0.0           20.6
## 13                      0.1           49.1
## 14                      0.0            3.9
## 15                      1.1            7.2
## 16                      0.1           26.1
## 17                     10.2           10.7
## 18                      0.0           12.3
## 19                      0.1            5.8
## 20                      0.0            1.7
## 21                      0.1            9.6
## 22                      0.0            3.9
## 23                      0.0            4.3
## 24                      0.1            7.1
## 25                      0.1            3.6
## 26                      0.0            5.1
## 27                      0.1            5.5
## 28                      0.0            2.0
## 29                      0.7           12.9
## 30                      0.0            5.2
## 31                      0.1           11.1
## 32                      0.0            3.9
## 33                      0.1           10.9
## 34                      0.4           13.3
## 35                      0.1           15.9
## 36                      0.0            6.9
## 37                      0.2           10.0
## 38                      0.3            7.6
## 39                      0.4           39.3
## 40                      0.1            9.5
## 41                      0.1           12.0
## 42                      0.0            5.5
## 43                      0.0            2.9
## 44                      0.1            3.9
## 45                      0.1            9.5
## 46                      0.2           31.6
## 47                      0.0           16.5
## 48                      0.0           19.2
## 49                      0.0            3.6
## 50                      0.1           39.6
Ethnicities <- DF2[order(DF2$state),]
row.names(Ethnicities) <- NULL
Ethnicities
##             state total_state_population percent_black percent_white
## 1         Alabama                4887871          26.7          67.7
## 2          Alaska                 737438           3.4          64.4
## 3         Arizona                7171646           4.7          78.0
## 4        Arkansas                3013825          15.2          76.5
## 5      California               39557045           5.8          59.5
## 6        Colorado                5695564           4.2          84.1
## 7     Connecticut                3572665          11.0          75.2
## 8        Delaware                 967171          22.5          68.2
## 9         Florida               21299325          16.0          74.6
## 10        Georgia               10519475          31.6          58.3
## 11         Hawaii                1420491           2.0          24.3
## 12          Idaho                1754208           0.7          89.9
## 13       Illinois               12741080          14.1          71.7
## 14        Indiana                6691878           9.5          82.8
## 15           Iowa                3156145           3.6          90.2
## 16         Kansas                2911510           5.9          84.0
## 17       Kentucky                4468402           7.9          86.7
## 18      Louisiana                4659978          32.4          61.7
## 19          Maine                1338404           1.4          94.3
## 20       Maryland                6042718          30.0          54.7
## 21  Massachusetts                6902149           7.8          77.3
## 22       Michigan                9995915          13.8          78.3
## 23      Minnesota                5611179           6.6          82.5
## 24    Mississippi                2986530          38.0          58.1
## 25       Missouri                6126452          11.5          82.2
## 26        Montana                1062305           0.5          88.6
## 27       Nebraska                1929268           4.7          86.4
## 28         Nevada                3034392           9.2          63.4
## 29  New Hampshire                1356458           1.7          92.4
## 30     New Jersey                8908520          13.6          66.9
## 31     New Mexico                2095428           2.2          76.4
## 32       New York               19542209          15.7          63.3
## 33 North Carolina               10383620          21.4          68.4
## 34   North Dakota                 760077           3.4          85.7
## 35           Ohio               11689442          12.4          81.0
## 36       Oklahoma                3943079           7.3          72.2
## 37         Oregon                4190713           2.0          83.9
## 38   Pennsylvania               12807060          11.2          80.1
## 39   Rhode Island                1057315           6.7          80.7
## 40 South Carolina                5084127          26.6          67.0
## 41   South Dakota                 882235           2.2          84.0
## 42      Tennessee                6770010          16.8          77.3
## 43          Texas               28701845          12.3          73.5
## 44           Utah                3161105           1.3          85.7
## 45        Vermont                 626299           1.2          94.1
## 46       Virginia                8517685          19.2          67.4
## 47     Washington                7535591           3.9          74.8
## 48  West Virginia                1805832           3.8          93.0
## 49      Wisconsin                5813568           6.4          85.3
## 50        Wyoming                 577737           0.6          91.5
##    percent_two_or_more percent_Native_American percent_Asian
## 1                  2.1                     0.5           1.3
## 2                  8.4                    15.1           6.3
## 3                  4.0                     4.6           3.3
## 4                  2.9                     0.7           1.6
## 5                  5.1                     0.8          14.7
## 6                  4.0                     1.0           3.2
## 7                  3.4                     0.3           4.6
## 8                  2.7                     0.5           4.0
## 9                  2.9                     0.3           2.8
## 10                 2.7                     0.3           4.1
## 11                24.3                     0.2          37.6
## 12                 3.0                     1.3           1.5
## 13                 2.7                     0.3           5.6
## 14                 2.7                     0.2           2.3
## 15                 2.2                     0.4           2.5
## 16                 3.7                     0.9           2.8
## 17                 2.4                     0.2           1.5
## 18                 2.3                     0.6           1.6
## 19                 2.2                     0.6           1.2
## 20                 3.7                     0.2           6.3
## 21                 3.4                     0.2           6.8
## 22                 2.9                     0.5           3.3
## 23                 3.1                     1.1           4.9
## 24                 1.5                     0.4           0.9
## 25                 2.8                     0.5           2.0
## 26                 3.1                     6.4           0.8
## 27                 3.1                     1.0           2.4
## 28                 5.1                     1.5           8.2
## 29                 2.2                     0.3           2.7
## 30                 2.8                     0.2           9.7
## 31                 3.2                     9.6           1.6
## 32                 3.3                     0.4           8.5
## 33                 2.9                     1.2           3.0
## 34                 2.3                     5.4           1.8
## 35                 3.1                     0.2           2.3
## 36                 7.7                     7.8           2.1
## 37                 4.7                     1.2           4.6
## 38                 2.6                     0.2           3.6
## 39                 3.1                     0.4           3.4
## 40                 2.4                     0.5           1.6
## 41                 2.7                     8.8           1.7
## 42                 2.2                     0.3           1.8
## 43                 2.7                     0.5           5.0
## 44                 3.2                     1.1           2.4
## 45                 2.0                     0.3           1.9
## 46                 4.1                     0.3           6.5
## 47                 6.0                     1.3           8.8
## 48                 1.9                     0.1           0.7
## 49                 2.5                     0.9           2.8
## 50                 2.4                     2.8           1.0
##    percent_Pacific_Islander percent_Latino
## 1                       0.0            4.3
## 2                       1.1            7.2
## 3                       0.2           31.6
## 4                       0.3            7.6
## 5                       0.4           39.3
## 6                       0.1           21.7
## 7                       0.0           16.5
## 8                       0.1            9.5
## 9                       0.1           26.1
## 10                      0.1            9.7
## 11                     10.2           10.7
## 12                      0.2           12.7
## 13                      0.0           17.3
## 14                      0.1            7.1
## 15                      0.1            6.1
## 16                      0.1           12.0
## 17                      0.1            3.6
## 18                      0.0            5.1
## 19                      0.0            1.7
## 20                      0.1           10.4
## 21                      0.0           12.3
## 22                      0.0            5.2
## 23                      0.0            5.5
## 24                      0.0            2.9
## 25                      0.1            4.1
## 26                      0.1            3.9
## 27                      0.1           11.1
## 28                      0.6           29.0
## 29                      0.0            3.9
## 30                      0.0           20.6
## 31                      0.1           49.1
## 32                      0.0           19.2
## 33                      0.1            9.6
## 34                      0.0            3.6
## 35                      0.0            3.9
## 36                      0.1           10.9
## 37                      0.4           13.3
## 38                      0.0            7.6
## 39                      0.1           15.9
## 40                      0.1            5.8
## 41                      0.0            3.9
## 42                      0.1            5.5
## 43                      0.1           39.6
## 44                      0.9           14.2
## 45                      0.0            2.0
## 46                      0.1            9.5
## 47                      0.7           12.9
## 48                      0.0            1.4
## 49                      0.0            6.9
## 50                      0.2           10.0
write.csv(Ethnicities, 'race_distribution_2018.csv',row.names=FALSE)

Merge the state licensing excel file with this csv file to add in the demographic race data per state.

stateREQs <- read.csv('stateLicensingRequirements.csv', sep=',', header=TRUE, na.strings=c('',' ','NA'))
colnames(stateREQs)
##  [1] "state"                                    
##  [2] "massageBoard"                             
##  [3] "licenseByReciprocity"                     
##  [4] "proofOtherOrAllStateLicense"              
##  [5] "stateResidencyProof"                      
##  [6] "passportSizePhoto"                        
##  [7] "driversLicensePhotoCopy"                  
##  [8] "nameChangeProof"                          
##  [9] "socialSecurityCopy"                       
## [10] "Hours"                                    
## [11] "MBLEX_or_NCBTMB"                          
## [12] "goodHealthClearance"                      
## [13] "BoardBackgroundCheckFee"                  
## [14] "stateApplyingBackgroundCheck"             
## [15] "DOJ_backgroundCheck"                      
## [16] "applicationCost"                          
## [17] "licensingCost"                            
## [18] "licenseRenewalFee"                        
## [19] "CPR_certification"                        
## [20] "licensingETA"                             
## [21] "healthReferences"                         
## [22] "CEU"                                      
## [23] "timeLicenseValidYears"                    
## [24] "liabilityInsurance"                       
## [25] "schoolTranscripts"                        
## [26] "MBLEX_transcript"                         
## [27] "notes"                                    
## [28] "notes2"                                   
## [29] "notes3"                                   
## [30] "notes4"                                   
## [31] "citiesGreaterThan300k_orTop3"             
## [32] "LMT_medianJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyMedianPayRangeAdvertised_Indeed"
## [34] "LMT_AnualMedianPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityMedianHomeValue"          
## [36] "median2018IncomeByState"
stateREQs <- stateREQs[,1:36]
colnames(stateREQs)
##  [1] "state"                                    
##  [2] "massageBoard"                             
##  [3] "licenseByReciprocity"                     
##  [4] "proofOtherOrAllStateLicense"              
##  [5] "stateResidencyProof"                      
##  [6] "passportSizePhoto"                        
##  [7] "driversLicensePhotoCopy"                  
##  [8] "nameChangeProof"                          
##  [9] "socialSecurityCopy"                       
## [10] "Hours"                                    
## [11] "MBLEX_or_NCBTMB"                          
## [12] "goodHealthClearance"                      
## [13] "BoardBackgroundCheckFee"                  
## [14] "stateApplyingBackgroundCheck"             
## [15] "DOJ_backgroundCheck"                      
## [16] "applicationCost"                          
## [17] "licensingCost"                            
## [18] "licenseRenewalFee"                        
## [19] "CPR_certification"                        
## [20] "licensingETA"                             
## [21] "healthReferences"                         
## [22] "CEU"                                      
## [23] "timeLicenseValidYears"                    
## [24] "liabilityInsurance"                       
## [25] "schoolTranscripts"                        
## [26] "MBLEX_transcript"                         
## [27] "notes"                                    
## [28] "notes2"                                   
## [29] "notes3"                                   
## [30] "notes4"                                   
## [31] "citiesGreaterThan300k_orTop3"             
## [32] "LMT_medianJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyMedianPayRangeAdvertised_Indeed"
## [34] "LMT_AnualMedianPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityMedianHomeValue"          
## [36] "median2018IncomeByState"
Ethnicities$state <- as.factor(Ethnicities$state)
StateLicensing <- merge(stateREQs,Ethnicities, by.x='state',by.y='state')
dim(StateLicensing)
## [1] 50 44
colnames(StateLicensing)
##  [1] "state"                                    
##  [2] "massageBoard"                             
##  [3] "licenseByReciprocity"                     
##  [4] "proofOtherOrAllStateLicense"              
##  [5] "stateResidencyProof"                      
##  [6] "passportSizePhoto"                        
##  [7] "driversLicensePhotoCopy"                  
##  [8] "nameChangeProof"                          
##  [9] "socialSecurityCopy"                       
## [10] "Hours"                                    
## [11] "MBLEX_or_NCBTMB"                          
## [12] "goodHealthClearance"                      
## [13] "BoardBackgroundCheckFee"                  
## [14] "stateApplyingBackgroundCheck"             
## [15] "DOJ_backgroundCheck"                      
## [16] "applicationCost"                          
## [17] "licensingCost"                            
## [18] "licenseRenewalFee"                        
## [19] "CPR_certification"                        
## [20] "licensingETA"                             
## [21] "healthReferences"                         
## [22] "CEU"                                      
## [23] "timeLicenseValidYears"                    
## [24] "liabilityInsurance"                       
## [25] "schoolTranscripts"                        
## [26] "MBLEX_transcript"                         
## [27] "notes"                                    
## [28] "notes2"                                   
## [29] "notes3"                                   
## [30] "notes4"                                   
## [31] "citiesGreaterThan300k_orTop3"             
## [32] "LMT_medianJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyMedianPayRangeAdvertised_Indeed"
## [34] "LMT_AnualMedianPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityMedianHomeValue"          
## [36] "median2018IncomeByState"                  
## [37] "total_state_population"                   
## [38] "percent_black"                            
## [39] "percent_white"                            
## [40] "percent_two_or_more"                      
## [41] "percent_Native_American"                  
## [42] "percent_Asian"                            
## [43] "percent_Pacific_Islander"                 
## [44] "percent_Latino"

We added the demographics to the state licensing requirements and facts csv version of the excel version.

Now lets add in the fields from our Indeed web scrape to update the columns 32-34 of the StateLicensing table.We added them in manually before, but now that a table was made with the copy of the indeed web scrape script that uses the modified writeIndeedJobData5Pages() using the original getIndeedJobData5Pages(). We can update the table on the fly as needed as long as the Indeed site doesn’t change its layout. This file is the statesRates.csv file made in the ‘copy-indeed-webscrape-function-altered.Rmd’ script.

statesRates <- read.csv('statesRates.csv', sep=',',header=TRUE, na.strings=c('',' ','NA'),
                       stringsAsFactors = FALSE)
head(statesRates)
##   state jobsListed MinHourlySalary MaxHourlySalary MinAnnualSalary
## 1    AK         39        15.00000        15.00000        40000.00
## 2    AL         88        14.68750        53.93750        25000.00
## 3    AR         73              NA              NA        35000.00
## 4    AZ        212        14.61792        76.93396        39622.64
## 5    CA        223        14.36099        85.91928        35640.52
## 6    CO        241        11.34191        68.46473        25000.00
##   MaxAnnualSalary avgHourly avgAnualSalary
## 1       120000.00  15.00000       80000.00
## 2        50000.00  34.31250       37500.00
## 3        50000.00        NA       42500.00
## 4       100070.75  45.77594       69846.70
## 5        97261.44  50.14013       66450.98
## 6        62000.00  39.90332       43500.00
statesOrdered <- statesRates[order(statesRates$state),]
head(statesOrdered)
##   state jobsListed MinHourlySalary MaxHourlySalary MinAnnualSalary
## 1    AK         39        15.00000        15.00000        40000.00
## 2    AL         88        14.68750        53.93750        25000.00
## 3    AR         73              NA              NA        35000.00
## 4    AZ        212        14.61792        76.93396        39622.64
## 5    CA        223        14.36099        85.91928        35640.52
## 6    CO        241        11.34191        68.46473        25000.00
##   MaxAnnualSalary avgHourly avgAnualSalary
## 1       120000.00  15.00000       80000.00
## 2        50000.00  34.31250       37500.00
## 3        50000.00        NA       42500.00
## 4       100070.75  45.77594       69846.70
## 5        97261.44  50.14013       66450.98
## 6        62000.00  39.90332       43500.00

When ordering by the state abbreviations, the order isn’t the same as by the state spelled out. So lets compare the two and adjust changes.

statesOrdered$state
##  [1] "AK" "AL" "AR" "AZ" "CA" "CO" "CT" "DE" "FL" "GA" "HI" "IA" "ID" "IL" "IN"
## [16] "KS" "KY" "LA" "MA" "MD" "ME" "MI" "MN" "MO" "MS" "MT" "NC" "ND" "NE" "NH"
## [31] "NJ" "NM" "NV" "NY" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT" "VA"
## [46] "VT" "WA" "WI" "WV" "WY" NA

The statesOrdered has an NA, lets remove it.

statesOrdered <- statesOrdered[1:50,]
states <- c("Alaska"  ,"Alabama"     ,      "Arkansas"     ,     "Arizona"     ,    "California",    
 "Colorado"    ,   "Connecticut"  ,  "Delaware"     ,  "Florida"    ,    "Georgia"  ,     
"Hawaii"   ,     "Iowa"   , "Idaho"   ,       "Illinois"  ,     "Indiana"        ,       
 "Kansas"   ,      "Kentucky",       "Louisiana" ,  "Massachusetts",  "Maryland" , "Maine",     
  "Michigan"  ,     "Minnesota"   ,  "Missouri"  , "Mississippi"    ,    
"Montana"       , "North Carolina","North Dakota" ,"Nebraska"   ,  "New Hampshire" , "New Jersey", "New Mexico"     , "Nevada"       ,      
"New York"    ,      "Ohio"       ,   
"Oklahoma"      , "Oregon"       ,  "Pennsylvania"   ,"Rhode Island",   "South Carolina",
"South Dakota"  , "Tennessee"     , "Texas"          ,"Utah"       , "Virginia",   "Vermont",   
 "Washington" ,"Wisconsin" ,  "West Virginia"  ,   "Wyoming" )

states
##  [1] "Alaska"         "Alabama"        "Arkansas"       "Arizona"       
##  [5] "California"     "Colorado"       "Connecticut"    "Delaware"      
##  [9] "Florida"        "Georgia"        "Hawaii"         "Iowa"          
## [13] "Idaho"          "Illinois"       "Indiana"        "Kansas"        
## [17] "Kentucky"       "Louisiana"      "Massachusetts"  "Maryland"      
## [21] "Maine"          "Michigan"       "Minnesota"      "Missouri"      
## [25] "Mississippi"    "Montana"        "North Carolina" "North Dakota"  
## [29] "Nebraska"       "New Hampshire"  "New Jersey"     "New Mexico"    
## [33] "Nevada"         "New York"       "Ohio"           "Oklahoma"      
## [37] "Oregon"         "Pennsylvania"   "Rhode Island"   "South Carolina"
## [41] "South Dakota"   "Tennessee"      "Texas"          "Utah"          
## [45] "Virginia"       "Vermont"        "Washington"     "Wisconsin"     
## [49] "West Virginia"  "Wyoming"
statesOrdered$stateName <- states
statesOrdered <- statesOrdered[,c(1,9,2:8)]
statesOrdered <- statesOrdered[order(statesOrdered$stateName),]
head(statesOrdered)
##   state  stateName jobsListed MinHourlySalary MaxHourlySalary MinAnnualSalary
## 2    AL    Alabama         88        14.68750        53.93750        25000.00
## 1    AK     Alaska         39        15.00000        15.00000        40000.00
## 4    AZ    Arizona        212        14.61792        76.93396        39622.64
## 3    AR   Arkansas         73              NA              NA        35000.00
## 5    CA California        223        14.36099        85.91928        35640.52
## 6    CO   Colorado        241        11.34191        68.46473        25000.00
##   MaxAnnualSalary avgHourly avgAnualSalary
## 2        50000.00  34.31250       37500.00
## 1       120000.00  15.00000       80000.00
## 4       100070.75  45.77594       69846.70
## 3        50000.00        NA       42500.00
## 5        97261.44  50.14013       66450.98
## 6        62000.00  39.90332       43500.00

Lets make sure the stateName of the statesOrdered and the state of the StateLicensing tables are identical before updating the table with the latest job information from Indeed.

as.factor(statesOrdered$stateName)==StateLicensing$state
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE

That checks out, so we can now update the information with the latest data.

StateLicensing$LMT_AnualMedianPayAdvertised_Indeed <- statesOrdered$avgAnualSalary
StateLicensing$LMT_HourlyMedianPayRangeAdvertised_Indeed <- statesOrdered$avgHourly
StateLicensing$LMT_medianJobsListed_IndeedFirst5pages <- statesOrdered$jobsListed
colnames(StateLicensing)
##  [1] "state"                                    
##  [2] "massageBoard"                             
##  [3] "licenseByReciprocity"                     
##  [4] "proofOtherOrAllStateLicense"              
##  [5] "stateResidencyProof"                      
##  [6] "passportSizePhoto"                        
##  [7] "driversLicensePhotoCopy"                  
##  [8] "nameChangeProof"                          
##  [9] "socialSecurityCopy"                       
## [10] "Hours"                                    
## [11] "MBLEX_or_NCBTMB"                          
## [12] "goodHealthClearance"                      
## [13] "BoardBackgroundCheckFee"                  
## [14] "stateApplyingBackgroundCheck"             
## [15] "DOJ_backgroundCheck"                      
## [16] "applicationCost"                          
## [17] "licensingCost"                            
## [18] "licenseRenewalFee"                        
## [19] "CPR_certification"                        
## [20] "licensingETA"                             
## [21] "healthReferences"                         
## [22] "CEU"                                      
## [23] "timeLicenseValidYears"                    
## [24] "liabilityInsurance"                       
## [25] "schoolTranscripts"                        
## [26] "MBLEX_transcript"                         
## [27] "notes"                                    
## [28] "notes2"                                   
## [29] "notes3"                                   
## [30] "notes4"                                   
## [31] "citiesGreaterThan300k_orTop3"             
## [32] "LMT_medianJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyMedianPayRangeAdvertised_Indeed"
## [34] "LMT_AnualMedianPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityMedianHomeValue"          
## [36] "median2018IncomeByState"                  
## [37] "total_state_population"                   
## [38] "percent_black"                            
## [39] "percent_white"                            
## [40] "percent_two_or_more"                      
## [41] "percent_Native_American"                  
## [42] "percent_Asian"                            
## [43] "percent_Pacific_Islander"                 
## [44] "percent_Latino"

We should change the names of those columns to say ‘avg’ instead of ‘median’.

colnames(StateLicensing)[32:34] <- gsub('[mM]edian','Avg',colnames(StateLicensing)[32:34])
colnames(StateLicensing)
##  [1] "state"                                 
##  [2] "massageBoard"                          
##  [3] "licenseByReciprocity"                  
##  [4] "proofOtherOrAllStateLicense"           
##  [5] "stateResidencyProof"                   
##  [6] "passportSizePhoto"                     
##  [7] "driversLicensePhotoCopy"               
##  [8] "nameChangeProof"                       
##  [9] "socialSecurityCopy"                    
## [10] "Hours"                                 
## [11] "MBLEX_or_NCBTMB"                       
## [12] "goodHealthClearance"                   
## [13] "BoardBackgroundCheckFee"               
## [14] "stateApplyingBackgroundCheck"          
## [15] "DOJ_backgroundCheck"                   
## [16] "applicationCost"                       
## [17] "licensingCost"                         
## [18] "licenseRenewalFee"                     
## [19] "CPR_certification"                     
## [20] "licensingETA"                          
## [21] "healthReferences"                      
## [22] "CEU"                                   
## [23] "timeLicenseValidYears"                 
## [24] "liabilityInsurance"                    
## [25] "schoolTranscripts"                     
## [26] "MBLEX_transcript"                      
## [27] "notes"                                 
## [28] "notes2"                                
## [29] "notes3"                                
## [30] "notes4"                                
## [31] "citiesGreaterThan300k_orTop3"          
## [32] "LMT_AvgJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyAvgPayRangeAdvertised_Indeed"
## [34] "LMT_AnualAvgPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityMedianHomeValue"       
## [36] "median2018IncomeByState"               
## [37] "total_state_population"                
## [38] "percent_black"                         
## [39] "percent_white"                         
## [40] "percent_two_or_more"                   
## [41] "percent_Native_American"               
## [42] "percent_Asian"                         
## [43] "percent_Pacific_Islander"              
## [44] "percent_Latino"

The Zillow data was also added manually from the find3zillowCitiesFunctionMedian2BRHomeValues.Rmd file that used a downloaded Zillow dataset on 2 bedroom zillow home value index value per city. The file is ‘updatedZillow2BR.csv’ made from our copy-find3zillowCitiesFunctionMean2BRHomeValues.Rmd script.

zillowData <- read.csv('updatedZillow2BR-10.csv',sep=',', header=TRUE, na.strings=c('',' ','NA'))
head(zillowData)
##   State X6.30.2020
## 1    AK   244501.7
## 2    AL   104537.1
## 3    AR   114929.8
## 4    AZ   240336.3
## 5    CA   669171.6
## 6    CO   327365.4
zillowData$State
##  [1] AK AL AR AZ CA CO CT DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS
## [26] MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY
## 50 Levels: AK AL AR AZ CA CO CT DE FL GA HI IA ID IL IN KS KY LA MA MD ... WY
zillowData$stateName <- states
zillowData
##    State X6.30.2020      stateName
## 1     AK  244501.67         Alaska
## 2     AL  104537.10        Alabama
## 3     AR  114929.76       Arkansas
## 4     AZ  240336.29        Arizona
## 5     CA  669171.59     California
## 6     CO  327365.43       Colorado
## 7     CT  212252.40    Connecticut
## 8     DE  215976.06       Delaware
## 9     FL  215245.23        Florida
## 10    GA  192060.49        Georgia
## 11    HI  574836.56         Hawaii
## 12    IA  129324.62           Iowa
## 13    ID  238004.33          Idaho
## 14    IL  202689.33       Illinois
## 15    IN  125366.69        Indiana
## 16    KS  152226.63         Kansas
## 17    KY  193124.32       Kentucky
## 18    LA  141609.86      Louisiana
## 19    MA  537437.75  Massachusetts
## 20    MD  207428.66       Maryland
## 21    ME  301941.27          Maine
## 22    MI  107764.58       Michigan
## 23    MN  252568.04      Minnesota
## 24    MO  143279.22       Missouri
## 25    MS   81255.42    Mississippi
## 26    MT  240545.87        Montana
## 27    NC  166565.93 North Carolina
## 28    ND  160193.50   North Dakota
## 29    NE  192748.95       Nebraska
## 30    NH  227562.85  New Hampshire
## 31    NJ  259979.79     New Jersey
## 32    NM  180789.56     New Mexico
## 33    NV  264014.69         Nevada
## 34    NY  637718.65       New York
## 35    OH  102083.29           Ohio
## 36    OK  109105.35       Oklahoma
## 37    OR  364129.81         Oregon
## 38    PA  172920.62   Pennsylvania
## 39    RI  252537.90   Rhode Island
## 40    SC  181933.17 South Carolina
## 41    SD  164059.75   South Dakota
## 42    TN  177130.29      Tennessee
## 43    TX  195904.48          Texas
## 44    UT  319213.45           Utah
## 45    VA  252271.37       Virginia
## 46    VT  193815.55        Vermont
## 47    WA  417702.86     Washington
## 48    WI  170618.96      Wisconsin
## 49    WV   82370.00  West Virginia
## 50    WY  240742.71        Wyoming
zOrdered <- zillowData[order(zillowData$stateName),]
zOrdered
##    State X6.30.2020      stateName
## 2     AL  104537.10        Alabama
## 1     AK  244501.67         Alaska
## 4     AZ  240336.29        Arizona
## 3     AR  114929.76       Arkansas
## 5     CA  669171.59     California
## 6     CO  327365.43       Colorado
## 7     CT  212252.40    Connecticut
## 8     DE  215976.06       Delaware
## 9     FL  215245.23        Florida
## 10    GA  192060.49        Georgia
## 11    HI  574836.56         Hawaii
## 13    ID  238004.33          Idaho
## 14    IL  202689.33       Illinois
## 15    IN  125366.69        Indiana
## 12    IA  129324.62           Iowa
## 16    KS  152226.63         Kansas
## 17    KY  193124.32       Kentucky
## 18    LA  141609.86      Louisiana
## 21    ME  301941.27          Maine
## 20    MD  207428.66       Maryland
## 19    MA  537437.75  Massachusetts
## 22    MI  107764.58       Michigan
## 23    MN  252568.04      Minnesota
## 25    MS   81255.42    Mississippi
## 24    MO  143279.22       Missouri
## 26    MT  240545.87        Montana
## 29    NE  192748.95       Nebraska
## 33    NV  264014.69         Nevada
## 30    NH  227562.85  New Hampshire
## 31    NJ  259979.79     New Jersey
## 32    NM  180789.56     New Mexico
## 34    NY  637718.65       New York
## 27    NC  166565.93 North Carolina
## 28    ND  160193.50   North Dakota
## 35    OH  102083.29           Ohio
## 36    OK  109105.35       Oklahoma
## 37    OR  364129.81         Oregon
## 38    PA  172920.62   Pennsylvania
## 39    RI  252537.90   Rhode Island
## 40    SC  181933.17 South Carolina
## 41    SD  164059.75   South Dakota
## 42    TN  177130.29      Tennessee
## 43    TX  195904.48          Texas
## 44    UT  319213.45           Utah
## 46    VT  193815.55        Vermont
## 45    VA  252271.37       Virginia
## 47    WA  417702.86     Washington
## 49    WV   82370.00  West Virginia
## 48    WI  170618.96      Wisconsin
## 50    WY  240742.71        Wyoming
zillowOrdered <- zOrdered[,2:3]
colnames(zillowOrdered)[1] <- 'zillow2BR_2020May_10cities'
zillowOrdered
##    zillow2BR_2020May_10cities      stateName
## 2                   104537.10        Alabama
## 1                   244501.67         Alaska
## 4                   240336.29        Arizona
## 3                   114929.76       Arkansas
## 5                   669171.59     California
## 6                   327365.43       Colorado
## 7                   212252.40    Connecticut
## 8                   215976.06       Delaware
## 9                   215245.23        Florida
## 10                  192060.49        Georgia
## 11                  574836.56         Hawaii
## 13                  238004.33          Idaho
## 14                  202689.33       Illinois
## 15                  125366.69        Indiana
## 12                  129324.62           Iowa
## 16                  152226.63         Kansas
## 17                  193124.32       Kentucky
## 18                  141609.86      Louisiana
## 21                  301941.27          Maine
## 20                  207428.66       Maryland
## 19                  537437.75  Massachusetts
## 22                  107764.58       Michigan
## 23                  252568.04      Minnesota
## 25                   81255.42    Mississippi
## 24                  143279.22       Missouri
## 26                  240545.87        Montana
## 29                  192748.95       Nebraska
## 33                  264014.69         Nevada
## 30                  227562.85  New Hampshire
## 31                  259979.79     New Jersey
## 32                  180789.56     New Mexico
## 34                  637718.65       New York
## 27                  166565.93 North Carolina
## 28                  160193.50   North Dakota
## 35                  102083.29           Ohio
## 36                  109105.35       Oklahoma
## 37                  364129.81         Oregon
## 38                  172920.62   Pennsylvania
## 39                  252537.90   Rhode Island
## 40                  181933.17 South Carolina
## 41                  164059.75   South Dakota
## 42                  177130.29      Tennessee
## 43                  195904.48          Texas
## 44                  319213.45           Utah
## 46                  193815.55        Vermont
## 45                  252271.37       Virginia
## 47                  417702.86     Washington
## 49                   82370.00  West Virginia
## 48                  170618.96      Wisconsin
## 50                  240742.71        Wyoming
StateLicensing$state==zillowOrdered$stateName
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE

Everything checks out so we can now update our zillow 2 bedroom median home values per state to the mean values per state instead. Some of the top 3 cities of population weren’t in the Zillow data, such as AL.

StateLicensing$Zillow_2BR_3cityMedianHomeValue <- zillowOrdered$zillow2BR_2020May
colnames(StateLicensing)[35] <- 'Zillow_2BR_3cityAverageHomeValue'
colnames(StateLicensing)
##  [1] "state"                                 
##  [2] "massageBoard"                          
##  [3] "licenseByReciprocity"                  
##  [4] "proofOtherOrAllStateLicense"           
##  [5] "stateResidencyProof"                   
##  [6] "passportSizePhoto"                     
##  [7] "driversLicensePhotoCopy"               
##  [8] "nameChangeProof"                       
##  [9] "socialSecurityCopy"                    
## [10] "Hours"                                 
## [11] "MBLEX_or_NCBTMB"                       
## [12] "goodHealthClearance"                   
## [13] "BoardBackgroundCheckFee"               
## [14] "stateApplyingBackgroundCheck"          
## [15] "DOJ_backgroundCheck"                   
## [16] "applicationCost"                       
## [17] "licensingCost"                         
## [18] "licenseRenewalFee"                     
## [19] "CPR_certification"                     
## [20] "licensingETA"                          
## [21] "healthReferences"                      
## [22] "CEU"                                   
## [23] "timeLicenseValidYears"                 
## [24] "liabilityInsurance"                    
## [25] "schoolTranscripts"                     
## [26] "MBLEX_transcript"                      
## [27] "notes"                                 
## [28] "notes2"                                
## [29] "notes3"                                
## [30] "notes4"                                
## [31] "citiesGreaterThan300k_orTop3"          
## [32] "LMT_AvgJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyAvgPayRangeAdvertised_Indeed"
## [34] "LMT_AnualAvgPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityAverageHomeValue"      
## [36] "median2018IncomeByState"               
## [37] "total_state_population"                
## [38] "percent_black"                         
## [39] "percent_white"                         
## [40] "percent_two_or_more"                   
## [41] "percent_Native_American"               
## [42] "percent_Asian"                         
## [43] "percent_Pacific_Islander"              
## [44] "percent_Latino"

Now, we can write our table out to csv. We manually put in the 2018 median household income per state from data.census.gov, but we can update that later or as needed when more relevant data is available. That was two years ago, and there should be 2020 data soon because of the 2020 census.

Because this will be the same table but with added and updated columns, we should name it something else to keep separate from the original table with fewer columns.

write.csv(StateLicensing,'stateLicensingDemographicsAddedAndUpdated.csv',row.names=FALSE)

Note that the original csv file stateLicensingRequirements.csv has to be manually input for the changes, then use this script to add the demographics, updated Zillow 2BR home values, and update the average Indeed pay rates and job listings. Don’t make changes in the file just written out or else they will be lost if modifying the state by state licensing requirements of the first variables.


Now, lets add in the data on the alternate jobs available for a massage therapist looking to move to another state and work as a massage therapist, but needing alternate work to pay bills while waiting for license approval.

I have gathered the information on job title for the first five web pages of job listings on Indeed for similar jobs to a massage therapist or that might not need any license to work as. These jobs are: nanny, server, personal trainer, security, data science, house cleaner, warehouse worker, and cashier. The data scientist job is more relevant to me specifically, but some people could possibly have experience as a coder or computer programmer and statistical analyst to land a job in data science without the intense and rigorous education required in machine learning that I went through. It is not likely, but some people do make it to similar jobs with just a couple months to years of proving they are qualified as computer programmers and coders. So, we will assume that is the case, and that companies don’t want to pay higher salaries to arrogant top educated and possibly difficult to work with graduates and would rather pay motivated and slightly proven but coachable males and females from team building backgrounds or sports competitive athletes used to the heirarchical structure of ‘yes sir and mam’ to their directors at lower wages than a professional, skilled, and educated in the background theory that could possibly question the director’s motives, authority, and decisions, and possibly leak the lack of sound leadership within the company to something as viral as a social media site.

So, without further a do, lets start, shall we?

We will import the data sets individually for each of the 50 states’ counts, and salaries be it hourly, annual, or both from our top three populated cities of each state.

house cleaner:

houseCleaner <- read.csv('./Alternate Jobs Each State Indeed/statesRates-house cleaner.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
houseCleaner$stateName <- states
houseCleaner <- houseCleaner[,c(1,10,2:9)]
head(houseCleaner)
##   state  stateName jobsListed   jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska          4 house cleaner       10.000000       14.000000
## 2    AL    Alabama         72 house cleaner        8.738971        9.856618
## 3    AR   Arkansas         36 house cleaner       12.636364       15.000000
## 4    AZ    Arizona        171 house cleaner       10.556433       23.935673
## 5    CA California        216 house cleaner       11.579630       29.375000
## 6    CO   Colorado        217 house cleaner       12.000000       23.525346
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA 12.000000             NA
## 2           17000           20000  9.297794          18500
## 3              NA              NA 13.818182             NA
## 4              NA              NA 17.246053             NA
## 5           40600           40600 20.477315          40600
## 6           20000           30000 17.762673          25000

nanny:

nanny <- read.csv('./Alternate Jobs Each State Indeed/statesRates-nanny.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
nanny$stateName <- states
nanny <- nanny[,c(1,10,2:9)]
head(nanny)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska         23       nanny       10.347826        15.30435
## 2    AL    Alabama         42       nanny       10.666667        16.38095
## 3    AR   Arkansas         81       nanny        9.308642        16.88889
## 4    AZ    Arizona        182       nanny       10.000000        25.00000
## 5    CA California        199       nanny       10.000000        40.85427
## 6    CO   Colorado        157       nanny       10.000000        25.89172
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA  12.82609             NA
## 2              NA              NA  13.52381             NA
## 3              NA              NA  13.09877             NA
## 4           33000           35000  17.50000          34000
## 5           65000          110000  25.42714          87500
## 6              NA              NA  17.94586             NA

cashier:

cashier <- read.csv('./Alternate Jobs Each State Indeed/statesRates-cashier.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
cashier$stateName <- states
cashier <- cashier[,c(1,10,2:9)]
head(cashier)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        103     cashier       10.269663        15.19101
## 2    AL    Alabama        183     cashier        7.959016        13.42077
## 3    AR   Arkansas        190     cashier        8.559211        12.07895
## 4    AZ    Arizona        217     cashier       10.751152        15.83871
## 5    CA California        227     cashier       13.004405        20.00000
## 6    CO   Colorado        212     cashier       10.306604        18.63679
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA  12.73034             NA
## 2              NA              NA  10.68989             NA
## 3              NA              NA  10.31908             NA
## 4              NA              NA  13.29493             NA
## 5              NA              NA  16.50220             NA
## 6              NA              NA  14.47170             NA

personal trainer:

personalTrainer <- read.csv('./Alternate Jobs Each State Indeed/statesRates-personal trainer.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
personalTrainer$stateName <- states
personalTrainer <- personalTrainer[,c(1,10,2:9)]
head(personalTrainer)
##   state  stateName jobsListed      jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska         47 personal trainer              NA              NA
## 2    AL    Alabama         92 personal trainer        8.650602        51.74699
## 3    AR   Arkansas         72 personal trainer       15.888889        27.55556
## 4    AZ    Arizona        168 personal trainer        9.517857        35.86310
## 5    CA California        190 personal trainer       13.178947        50.02105
## 6    CO   Colorado        196 personal trainer       12.336735        43.07653
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        35000.00        60000.00        NA       47500.00
## 2        40000.00        50000.00  30.19880       45000.00
## 3        50000.00        50000.00  21.72222       50000.00
## 4        31882.84        83681.57  22.69048       57782.20
## 5        31210.53        90894.74  31.60000       61052.63
## 6        49222.36        66696.85  27.70663       57959.61

security:

security <- read.csv('./Alternate Jobs Each State Indeed/statesRates-security.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
security$stateName <- states
security <- security[,c(1,10,2:9)]
head(security)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        169    security       13.709467        20.00592
## 2    AL    Alabama        212    security        7.818396        14.27358
## 3    AR   Arkansas        199    security        9.276382        12.86809
## 4    AZ    Arizona        221    security       12.000000        26.16109
## 5    CA California        230    security       13.856087        25.96522
## 6    CO   Colorado        234    security       12.316239        24.99897
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        65119.07        150000.0  16.85769      107559.53
## 2        23170.14        150000.0  11.04599       86585.07
## 3        25658.97        204271.4  11.07224      114965.17
## 4        29674.76         73751.1  19.08054       51712.93
## 5        55979.92        107132.8  19.91065       81556.37
## 6        36821.15        136095.5  18.65761       86458.35
server <- read.csv('./Alternate Jobs Each State Indeed/statesRates-server.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
server$stateName <- states
server <- server[,c(1,10,2:9)]
head(server)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska         73      server       10.026849        10.52000
## 2    AL    Alabama        220      server        8.643182        25.24545
## 3    AR   Arkansas        197      server        8.000000        18.47619
## 4    AZ    Arizona        221      server        9.000000        22.81448
## 5    CA California        224      server       12.343750        29.91071
## 6    CO   Colorado        225      server        9.077200        32.33333
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA  10.27342             NA
## 2              NA              NA  16.94432             NA
## 3              NA              NA  13.23810             NA
## 4              NA              NA  15.90724             NA
## 5           55000           75000  21.12723          65000
## 6              NA              NA  20.70527             NA

warehouse worker:

warehouseWorker <- read.csv('./Alternate Jobs Each State Indeed/statesRates-warehouse worker.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
warehouseWorker$stateName <- states
warehouseWorker <- warehouseWorker[,c(1,10,2:9)]
head(warehouseWorker)
##   state  stateName jobsListed      jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        206 warehouse worker       11.907767        32.19903
## 2    AL    Alabama        219 warehouse worker        9.221461        17.84932
## 3    AR   Arkansas        212 warehouse worker        9.702830        21.47830
## 4    AZ    Arizona        235 warehouse worker       11.405319        27.69255
## 5    CA California        243 warehouse worker       13.012346        32.50198
## 6    CO   Colorado        250 warehouse worker       11.672000        22.19608
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        52697.00        61420.00  22.05340       57058.50
## 2        50000.00        55000.00  13.53539       52500.00
## 3              NA              NA  15.59057             NA
## 4        45000.00        55000.00  19.54894       50000.00
## 5        37556.68        60359.91  22.75716       48958.29
## 6        25519.46        48776.00  16.93404       37147.73

data scientist:

dataScientist <- read.csv('./Alternate Jobs Each State Indeed/statesRates-data scientist.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
dataScientist$stateName <- states
dataScientist <- dataScientist[,c(1,10,2:9)]
head(dataScientist)
##   state  stateName jobsListed    jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska         37 data scientist              NA              NA
## 2    AL    Alabama        122 data scientist              NA              NA
## 3    AR   Arkansas         70 data scientist              NA              NA
## 4    AZ    Arizona        183 data scientist        45.00000        50.00000
## 5    CA California        231 data scientist        12.79545        35.02597
## 6    CO   Colorado        194 data scientist        16.00000        18.00000
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        89345.30        162810.8        NA       126078.1
## 2       102923.16        160000.0        NA       131461.6
## 3        88068.19        160000.0        NA       124034.1
## 4        75991.25        130854.2  47.50000       103422.7
## 5        81558.44        159653.7  23.91071       120606.1
## 6        91666.98        160000.0  17.00000       125833.5

tutor:

tutor <- read.csv('./Alternate Jobs Each State Indeed/statesRates-tutor.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
tutor$stateName <- states
tutor <- tutor[,c(1,10,2:9)]
head(tutor)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        142       tutor        11.84109        29.10891
## 2    AL    Alabama        201       tutor        11.34109        25.00000
## 3    AR   Arkansas        112       tutor        10.53571        14.10714
## 4    AZ    Arizona        214       tutor        11.65421        43.73832
## 5    CA California        217       tutor        12.66359        71.70507
## 6    CO   Colorado        207       tutor        12.85507        37.14976
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA  20.47500             NA
## 2        21623.00           38100  18.17055        29861.5
## 3              NA              NA  12.32143             NA
## 4        40979.59           58000  27.69626        49489.8
## 5        50000.00           50000  42.18433        50000.0
## 6        25000.00           36750  25.00242        30875.0

clerical:

clerical <- read.csv('./Alternate Jobs Each State Indeed/statesRates-clerical.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
clerical$stateName <- states
clerical <- clerical[,c(1,10,2:9)]
head(clerical)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        211    clerical       10.625592        30.51005
## 2    AL    Alabama        223    clerical        8.336323        19.00897
## 3    AR   Arkansas        222    clerical       10.084459        19.32432
## 4    AZ    Arizona        226    clerical       11.340708        27.77336
## 5    CA California        225    clerical       12.986667        36.22613
## 6    CO   Colorado        243    clerical       11.349794        32.10469
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        33277.43        79972.38  20.56782       56624.91
## 2        25087.93        62713.78  13.67265       43900.86
## 3        23959.70        73183.76  14.70439       48571.73
## 4        30937.42        64084.62  19.55704       47511.02
## 5        38617.78        81268.33  24.60640       59943.06
## 6        22628.77        64479.38  21.72724       43554.08

teacher:

teacher <- read.csv('./Alternate Jobs Each State Indeed/statesRates-teacher.csv', header=TRUE,
                            na.strings=c('',' ','NA'), sep=',')
teacher$stateName <- states
teacher <- teacher[,c(1,10,2:9)]
head(teacher)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        194     teacher       13.865979        34.71134
## 2    AL    Alabama        213     teacher        7.771127        31.05634
## 3    AR   Arkansas        178     teacher       11.280899        24.86517
## 4    AZ    Arizona        245     teacher       12.624490        55.10204
## 5    CA California        236     teacher       13.038136        63.00847
## 6    CO   Colorado        247     teacher       12.631579        27.12551
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        48329.08        80488.00  24.28866       64408.54
## 2        45346.45        59773.06  19.41373       52559.76
## 3        34494.17        53737.70  18.07303       44115.93
## 4        20194.35        64451.22  33.86327       42322.79
## 5        26761.02        78625.00  38.02331       52693.01
## 6        20485.83        83157.89  19.87854       51821.86

Lets get only the columns needed.

dataScientist2 <- dataScientist[,c(2,3,10)]
colnames(dataScientist2)[2:3] <- paste('dataScientist',colnames(dataScientist2)[2:3],sep='_')
dataScientist2$dataScientist_avgHourly <- (dataScientist2$dataScientist_avgAnualSalary/52)/40
dataScientist2 <- dataScientist2[,c(1,2,4,3)]
head(dataScientist2)
##    stateName dataScientist_jobsListed dataScientist_avgHourly
## 1     Alaska                       37                60.61445
## 2    Alabama                      122                63.20268
## 3   Arkansas                       70                59.63178
## 4    Arizona                      183                49.72246
## 5 California                      231                57.98368
## 6   Colorado                      194                60.49687
##   dataScientist_avgAnualSalary
## 1                     126078.1
## 2                     131461.6
## 3                     124034.1
## 4                     103422.7
## 5                     120606.1
## 6                     125833.5
warehouseWorker2 <- warehouseWorker[,c(2,3,9)]
colnames(warehouseWorker2)[2:3] <- paste('warehouse',colnames(warehouseWorker2)[2:3],
                                         sep='_')
warehouseWorker2$warehouse_avgAnnualSalary <- warehouseWorker2$warehouse_avgHourly*52*40
head(warehouseWorker2)
##    stateName warehouse_jobsListed warehouse_avgHourly warehouse_avgAnnualSalary
## 1     Alaska                  206            22.05340                  45871.07
## 2    Alabama                  219            13.53539                  28153.61
## 3   Arkansas                  212            15.59057                  32428.38
## 4    Arizona                  235            19.54894                  40661.79
## 5 California                  243            22.75716                  47334.89
## 6   Colorado                  250            16.93404                  35222.80
nanny2 <- nanny[,c(2,3,9)]
colnames(nanny2)[2:3] <- paste('nanny',colnames(nanny2)[2:3],
                                         sep='_')
nanny2$nanny_avgAnnualSalary <- nanny2$nanny_avgHourly*52*40
head(nanny2)
##    stateName nanny_jobsListed nanny_avgHourly nanny_avgAnnualSalary
## 1     Alaska               23        12.82609              26678.26
## 2    Alabama               42        13.52381              28129.52
## 3   Arkansas               81        13.09877              27245.43
## 4    Arizona              182        17.50000              36400.00
## 5 California              199        25.42714              52888.44
## 6   Colorado              157        17.94586              37327.39
personalTrainer2 <- personalTrainer[,c(2,3,9)]
colnames(personalTrainer2)[2:3] <- paste('personalTrainer',colnames(personalTrainer2)[2:3],
                                         sep='_')
personalTrainer2$personalTrainer_avgAnnualSalary <-
                          personalTrainer2$personalTrainer_avgHourly*52*40
head(personalTrainer2)
##    stateName personalTrainer_jobsListed personalTrainer_avgHourly
## 1     Alaska                         47                        NA
## 2    Alabama                         92                  30.19880
## 3   Arkansas                         72                  21.72222
## 4    Arizona                        168                  22.69048
## 5 California                        190                  31.60000
## 6   Colorado                        196                  27.70663
##   personalTrainer_avgAnnualSalary
## 1                              NA
## 2                        62813.49
## 3                        45182.22
## 4                        47196.19
## 5                        65728.00
## 6                        57629.80
security2 <- security[,c(2,3,9)]
colnames(security2)[2:3] <- paste('security',colnames(security2)[2:3],
                                         sep='_')
security2$security_avgAnnualSalary <- security2$security_avgHourly*52*40
head(security2)
##    stateName security_jobsListed security_avgHourly security_avgAnnualSalary
## 1     Alaska                 169           16.85769                 35064.00
## 2    Alabama                 212           11.04599                 22975.66
## 3   Arkansas                 199           11.07224                 23030.25
## 4    Arizona                 221           19.08054                 39687.53
## 5 California                 230           19.91065                 41414.16
## 6   Colorado                 234           18.65761                 38807.82
houseCleaner2 <- houseCleaner[,c(2,3,9)]
colnames(houseCleaner2)[2:3] <- paste('houseCleaner',colnames(houseCleaner2)[2:3],
                                         sep='_')
houseCleaner2$houseCleaner_avgAnnualSalary <- houseCleaner2$houseCleaner_avgHourly*52*40
head(houseCleaner2)
##    stateName houseCleaner_jobsListed houseCleaner_avgHourly
## 1     Alaska                       4              12.000000
## 2    Alabama                      72               9.297794
## 3   Arkansas                      36              13.818182
## 4    Arizona                     171              17.246053
## 5 California                     216              20.477315
## 6   Colorado                     217              17.762673
##   houseCleaner_avgAnnualSalary
## 1                     24960.00
## 2                     19339.41
## 3                     28741.82
## 4                     35871.79
## 5                     42592.81
## 6                     36946.36
server2 <- server[,c(2,3,9)]
colnames(server2)[2:3] <- paste('server',colnames(server2)[2:3],
                                         sep='_')
server2$server_avgAnnualSalary <- server2$server_avgHourly*52*40
head(server2)
##    stateName server_jobsListed server_avgHourly server_avgAnnualSalary
## 1     Alaska                73         10.27342               21368.72
## 2    Alabama               220         16.94432               35244.18
## 3   Arkansas               197         13.23810               27535.24
## 4    Arizona               221         15.90724               33087.06
## 5 California               224         21.12723               43944.64
## 6   Colorado               225         20.70527               43066.95
cashier2 <- cashier[,c(2,3,9)]
colnames(cashier2)[2:3] <- paste('cashier',colnames(cashier2)[2:3],
                                         sep='_')
cashier2$cashier_avgAnnualSalary <- cashier2$cashier_avgHourly*52*40
head(cashier2)
##    stateName cashier_jobsListed cashier_avgHourly cashier_avgAnnualSalary
## 1     Alaska                103          12.73034                26479.10
## 2    Alabama                183          10.68989                22234.97
## 3   Arkansas                190          10.31908                21463.68
## 4    Arizona                217          13.29493                27653.46
## 5 California                227          16.50220                34324.58
## 6   Colorado                212          14.47170                30101.13
tutor2 <- tutor[,c(2,3,9)]
colnames(tutor2)[2:3] <- paste('tutor',colnames(tutor2)[2:3],
                                         sep='_')
tutor2$tutor_avgAnnualSalary <- tutor2$tutor_avgHourly*52*40
head(tutor2)
##    stateName tutor_jobsListed tutor_avgHourly tutor_avgAnnualSalary
## 1     Alaska              142        20.47500              42588.00
## 2    Alabama              201        18.17055              37794.74
## 3   Arkansas              112        12.32143              25628.57
## 4    Arizona              214        27.69626              57608.22
## 5 California              217        42.18433              87743.41
## 6   Colorado              207        25.00242              52005.02
clerical2 <- clerical[,c(2,3,9)]
colnames(clerical2)[2:3] <- paste('clerical',colnames(clerical2)[2:3],
                                         sep='_')
clerical2$clerical_avgAnnualSalary <- clerical2$clerical_avgHourly*52*40
head(clerical2)
##    stateName clerical_jobsListed clerical_avgHourly clerical_avgAnnualSalary
## 1     Alaska                 211           20.56782                 42781.07
## 2    Alabama                 223           13.67265                 28439.10
## 3   Arkansas                 222           14.70439                 30585.14
## 4    Arizona                 226           19.55704                 40678.63
## 5 California                 225           24.60640                 51181.31
## 6   Colorado                 243           21.72724                 45192.67
teacher2 <- teacher[,c(2,3,10)]
colnames(teacher2)[2:3] <- paste('teacher',colnames(teacher2)[2:3],sep='_')
teacher2$teacher_avgHourly <- (teacher2$teacher_avgAnualSalary/52)/40
teacher2 <- teacher2[,c(1,2,4,3)]
head(teacher2)
##    stateName teacher_jobsListed teacher_avgHourly teacher_avgAnualSalary
## 1     Alaska                194          30.96564               64408.54
## 2    Alabama                213          25.26911               52559.76
## 3   Arkansas                178          21.20958               44115.93
## 4    Arizona                245          20.34749               42322.79
## 5 California                236          25.33318               52693.01
## 6   Colorado                247          24.91436               51821.86

Lets add these new columns to our data table StateLicensing one at a time.

slr <- merge(StateLicensing,cashier2, by.x='state', by.y='stateName')
slr <- merge(slr, server2, by.x='state', by.y='stateName')
slr <- merge(slr, personalTrainer2, by.x='state', by.y='stateName')
slr <- merge(slr, houseCleaner2, by.x='state', by.y='stateName')
slr <- merge(slr, warehouseWorker2, by.x='state', by.y='stateName')
slr <- merge(slr, security2, by.x='state', by.y='stateName')
slr <- merge(slr, nanny2, by.x='state', by.y='stateName')
slr <- merge(slr, clerical2, by.x='state', by.y='stateName')
slr <- merge(slr, tutor2, by.x='state', by.y='stateName')
slr <- merge(slr, teacher2, by.x='state', by.y='stateName')
slr <- merge(slr, dataScientist2, by.x='state', by.y='stateName')


colnames(slr)
##  [1] "state"                                 
##  [2] "massageBoard"                          
##  [3] "licenseByReciprocity"                  
##  [4] "proofOtherOrAllStateLicense"           
##  [5] "stateResidencyProof"                   
##  [6] "passportSizePhoto"                     
##  [7] "driversLicensePhotoCopy"               
##  [8] "nameChangeProof"                       
##  [9] "socialSecurityCopy"                    
## [10] "Hours"                                 
## [11] "MBLEX_or_NCBTMB"                       
## [12] "goodHealthClearance"                   
## [13] "BoardBackgroundCheckFee"               
## [14] "stateApplyingBackgroundCheck"          
## [15] "DOJ_backgroundCheck"                   
## [16] "applicationCost"                       
## [17] "licensingCost"                         
## [18] "licenseRenewalFee"                     
## [19] "CPR_certification"                     
## [20] "licensingETA"                          
## [21] "healthReferences"                      
## [22] "CEU"                                   
## [23] "timeLicenseValidYears"                 
## [24] "liabilityInsurance"                    
## [25] "schoolTranscripts"                     
## [26] "MBLEX_transcript"                      
## [27] "notes"                                 
## [28] "notes2"                                
## [29] "notes3"                                
## [30] "notes4"                                
## [31] "citiesGreaterThan300k_orTop3"          
## [32] "LMT_AvgJobsListed_IndeedFirst5pages"   
## [33] "LMT_HourlyAvgPayRangeAdvertised_Indeed"
## [34] "LMT_AnualAvgPayAdvertised_Indeed"      
## [35] "Zillow_2BR_3cityAverageHomeValue"      
## [36] "median2018IncomeByState"               
## [37] "total_state_population"                
## [38] "percent_black"                         
## [39] "percent_white"                         
## [40] "percent_two_or_more"                   
## [41] "percent_Native_American"               
## [42] "percent_Asian"                         
## [43] "percent_Pacific_Islander"              
## [44] "percent_Latino"                        
## [45] "cashier_jobsListed"                    
## [46] "cashier_avgHourly"                     
## [47] "cashier_avgAnnualSalary"               
## [48] "server_jobsListed"                     
## [49] "server_avgHourly"                      
## [50] "server_avgAnnualSalary"                
## [51] "personalTrainer_jobsListed"            
## [52] "personalTrainer_avgHourly"             
## [53] "personalTrainer_avgAnnualSalary"       
## [54] "houseCleaner_jobsListed"               
## [55] "houseCleaner_avgHourly"                
## [56] "houseCleaner_avgAnnualSalary"          
## [57] "warehouse_jobsListed"                  
## [58] "warehouse_avgHourly"                   
## [59] "warehouse_avgAnnualSalary"             
## [60] "security_jobsListed"                   
## [61] "security_avgHourly"                    
## [62] "security_avgAnnualSalary"              
## [63] "nanny_jobsListed"                      
## [64] "nanny_avgHourly"                       
## [65] "nanny_avgAnnualSalary"                 
## [66] "clerical_jobsListed"                   
## [67] "clerical_avgHourly"                    
## [68] "clerical_avgAnnualSalary"              
## [69] "tutor_jobsListed"                      
## [70] "tutor_avgHourly"                       
## [71] "tutor_avgAnnualSalary"                 
## [72] "teacher_jobsListed"                    
## [73] "teacher_avgHourly"                     
## [74] "teacher_avgAnualSalary"                
## [75] "dataScientist_jobsListed"              
## [76] "dataScientist_avgHourly"               
## [77] "dataScientist_avgAnualSalary"

Lets now write this data table out to csv.

write.csv(slr,'stateLicensingDemographicsAddedAndUpdated.csv', row.names=FALSE)

Lets plot some of this data to get a good sense of what the job outlook is like compared to massage therapy for other professions.

numberOfJobs <- slr[,c(1,32,45,48,51,54,57,60,63,66,69,72,75)]
numberOfJobs
##             state LMT_AvgJobsListed_IndeedFirst5pages cashier_jobsListed
## 1         Alabama                                  88                183
## 2          Alaska                                  39                103
## 3         Arizona                                 212                217
## 4        Arkansas                                  73                190
## 5      California                                 223                227
## 6        Colorado                                 241                212
## 7     Connecticut                                 203                204
## 8        Delaware                                 159                203
## 9         Florida                                 222                225
## 10        Georgia                                 105                180
## 11         Hawaii                                  99                136
## 12          Idaho                                 203                200
## 13       Illinois                                 226                221
## 14        Indiana                                 109                211
## 15           Iowa                                 152                212
## 16         Kansas                                 179                213
## 17       Kentucky                                 123                214
## 18      Louisiana                                 110                204
## 19          Maine                                  73                139
## 20       Maryland                                 237                209
## 21  Massachusetts                                 229                221
## 22       Michigan                                 237                232
## 23      Minnesota                                 187                210
## 24    Mississippi                                  93                204
## 25       Missouri                                 190                214
## 26        Montana                                  46                196
## 27       Nebraska                                 169                195
## 28         Nevada                                 230                208
## 29  New Hampshire                                 139                187
## 30     New Jersey                                 236                232
## 31     New Mexico                                 162                184
## 32       New York                                 196                209
## 33 North Carolina                                 203                217
## 34   North Dakota                                  46                211
## 35           Ohio                                 235                227
## 36       Oklahoma                                 192                211
## 37         Oregon                                 171                181
## 38   Pennsylvania                                 227                226
## 39   Rhode Island                                 215                211
## 40 South Carolina                                 176                215
## 41   South Dakota                                  56                134
## 42      Tennessee                                 174                214
## 43          Texas                                 234                224
## 44           Utah                                 224                222
## 45        Vermont                                  70                187
## 46       Virginia                                 177                209
## 47     Washington                                 218                200
## 48  West Virginia                                  61                178
## 49      Wisconsin                                 166                197
## 50        Wyoming                                  35                175
##    server_jobsListed personalTrainer_jobsListed houseCleaner_jobsListed
## 1                220                         92                      72
## 2                 73                         47                       4
## 3                221                        168                     171
## 4                197                         72                      36
## 5                224                        190                     216
## 6                225                        196                     217
## 7                217                        211                     127
## 8                201                        157                     284
## 9                224                        200                     194
## 10               200                        103                     155
## 11               144                         38                      27
## 12               211                         87                     198
## 13               233                        206                     195
## 14               208                         96                      84
## 15               202                         82                     106
## 16               227                        172                     168
## 17               195                         67                      85
## 18               220                         87                      85
## 19               119                         28                     113
## 20               227                        229                     224
## 21               215                        207                     178
## 22               236                        175                     186
## 23               230                        150                     153
## 24               198                         82                      82
## 25               227                        147                     152
## 26               189                         18                      17
## 27               229                        146                     142
## 28               215                        187                     198
## 29               216                        183                     206
## 30               240                        237                     227
## 31               209                        102                      70
## 32               215                        135                     175
## 33               227                        164                     198
## 34               199                         27                     125
## 35               227                        194                     207
## 36               225                        133                      76
## 37               188                        123                     128
## 38               228                        211                     186
## 39               228                        192                     199
## 40               230                        184                     204
## 41               155                         33                      36
## 42               218                        152                     192
## 43               229                        199                     205
## 44               220                        162                     199
## 45               164                          4                      89
## 46               241                        198                     202
## 47               204                        133                     178
## 48               206                         52                      27
## 49               222                        141                      89
## 50               147                         17                      19
##    warehouse_jobsListed security_jobsListed nanny_jobsListed
## 1                   219                 212               42
## 2                   206                 169               23
## 3                   235                 221              182
## 4                   212                 199               81
## 5                   243                 230              199
## 6                   250                 234              157
## 7                   233                 223              172
## 8                   221                 222              133
## 9                   233                 228              173
## 10                  202                 220              104
## 11                  219                 216               48
## 12                  234                 215              102
## 13                  242                 232              195
## 14                  233                 217               72
## 15                  227                 209               42
## 16                  233                 222              104
## 17                  240                 218               87
## 18                  224                 216               28
## 19                  143                 134               23
## 20                  240                 228              164
## 21                  244                 232              160
## 22                  246                 240               91
## 23                  233                 225              133
## 24                  223                 206               62
## 25                  225                 210              119
## 26                  199                 197               13
## 27                  236                 222               97
## 28                  228                 226              132
## 29                  240                 221              101
## 30                  230                 238              211
## 31                  224                 236               62
## 32                  232                 222              102
## 33                  229                 210              150
## 34                  222                 206               19
## 35                  253                 245              117
## 36                  227                 213               97
## 37                  236                 225               62
## 38                  232                 230              161
## 39                  253                 225              162
## 40                  239                 201               77
## 41                  220                 153               13
## 42                  230                 223              113
## 43                  224                 234              166
## 44                  254                 227              127
## 45                  233                 194               32
## 46                  229                 229              166
## 47                  238                 227              126
## 48                  196                 214               22
## 49                  234                 225               94
## 50                  164                 152               14
##    clerical_jobsListed tutor_jobsListed teacher_jobsListed
## 1                  223              201                213
## 2                  211              142                194
## 3                  226              214                245
## 4                  222              112                178
## 5                  225              217                236
## 6                  243              207                247
## 7                  233              204                239
## 8                  219              192                242
## 9                  236              220                225
## 10                 224              164                217
## 11                 230              167                231
## 12                 224              209                219
## 13                 228              222                242
## 14                 229              181                226
## 15                 236              171                190
## 16                 231              207                239
## 17                 218              200                203
## 18                 227              200                219
## 19                 165              118                150
## 20                 234              225                249
## 21                 228              212                231
## 22                 235              211                247
## 23                 233              225                225
## 24                 222              186                216
## 25                 234              213                222
## 26                 232              125                174
## 27                 233              212                230
## 28                 230              219                230
## 29                 224              190                239
## 30                 233              224                242
## 31                 222              178                218
## 32                 226              209                230
## 33                 223              205                233
## 34                 223              173                193
## 35                 226              215                246
## 36                 224              202                222
## 37                 230              180                223
## 38                 228              203                235
## 39                 243              217                238
## 40                 231              216                222
## 41                 215               72                164
## 42                 238              198                232
## 43                 227              223                234
## 44                 226              203                216
## 45                 219              111                209
## 46                 234              204                223
## 47                 237              193                231
## 48                 222               75                209
## 49                 238              215                238
## 50                 198              123                160
##    dataScientist_jobsListed
## 1                       122
## 2                        37
## 3                       183
## 4                        70
## 5                       231
## 6                       194
## 7                       226
## 8                       161
## 9                       174
## 10                       95
## 11                      117
## 12                       94
## 13                      207
## 14                       91
## 15                      105
## 16                      133
## 17                       96
## 18                       38
## 19                       36
## 20                      239
## 21                      214
## 22                      152
## 23                      146
## 24                       27
## 25                      148
## 26                       38
## 27                       74
## 28                       49
## 29                      159
## 30                      234
## 31                      161
## 32                      144
## 33                      167
## 34                       20
## 35                      205
## 36                       98
## 37                       96
## 38                      182
## 39                      179
## 40                       78
## 41                       29
## 42                      152
## 43                      207
## 44                      175
## 45                       35
## 46                      219
## 47                      178
## 48                       37
## 49                      142
## 50                       31
gg <- ggplot(numberOfJobs, aes(x=numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages))
gg <- gg + geom_histogram(binwidth=2, colour="black", 
                          aes(y=..density.., fill=..count..))
gg <- gg + stat_function(fun=dnorm,
                         color="red",
                         args=list(mean=mean(numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages), 
                                  sd=sd(numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages)))

gg

avg <- mean(numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages)
m <- min(numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages)
M <- max(numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages)

ggplot(data = numberOfJobs, aes(y=numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages, x=numberOfJobs$state)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_y_continuous(breaks=c(m,avg,M),labels=c(m,avg,M))+
  scale_fill_brewer(palette='Paired') +
  geom_hline(yintercept=mean(numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages), linetype="dashed", color = "red")+
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('LMT Average Job Listings in the US Top 3 Cities of each State')+
  ylab(NULL)+
  xlab(NULL)

Lets look at those states whose job listings on Indeed are more than the US average job listings for licensed massage therapists.

moreThanAvgLMT <- subset(numberOfJobs, numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages>avg)
moreThanAvgLMT$state
##  [1] Arizona        California     Colorado       Connecticut    Florida       
##  [6] Idaho          Illinois       Kansas         Maryland       Massachusetts 
## [11] Michigan       Minnesota      Missouri       Nebraska       Nevada        
## [16] New Jersey     New Mexico     New York       North Carolina Ohio          
## [21] Oklahoma       Oregon         Pennsylvania   Rhode Island   South Carolina
## [26] Tennessee      Texas          Utah           Virginia       Washington    
## [31] Wisconsin     
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

The above list of 31 states look like heavily populated states, such as CA, CO, NY, and TX.

Now, lets see which states have fewer than the US average number of job listings for LMT on Indeed.

lessThanAvgLMT <- subset(numberOfJobs, numberOfJobs$LMT_AvgJobsListed_IndeedFirst5pages<avg)
lessThanAvgLMT$state
##  [1] Alabama       Alaska        Arkansas      Delaware      Georgia      
##  [6] Hawaii        Indiana       Iowa          Kentucky      Louisiana    
## [11] Maine         Mississippi   Montana       New Hampshire North Dakota 
## [16] South Dakota  Vermont       West Virginia Wyoming      
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

From the above, Alaska and many southern and sierra mountain range north mid-western states as well as Hawaii don’t have as many job listings for massage therapists as the more city or urban states do. Surprising Georgia is on this list, as that state has a large somewhat urban population and high pay for LMTs on average compared to other states. Lets look at the pay visually for the 50 states to see this claim just made as true or false.

payRates <- slr[,c(1,33,46,49,52,55,58,61,64,67,70,73,76)]
payRates
##             state LMT_HourlyAvgPayRangeAdvertised_Indeed cashier_avgHourly
## 1         Alabama                               34.31250          10.68989
## 2          Alaska                               15.00000          12.73034
## 3         Arizona                               45.77594          13.29493
## 4        Arkansas                                     NA          10.31908
## 5      California                               50.14013          16.50220
## 6        Colorado                               39.90332          14.47170
## 7     Connecticut                               40.91872          13.45760
## 8        Delaware                               32.42857          12.17488
## 9         Florida                               35.71622          10.75333
## 10        Georgia                               69.00000          10.25000
## 11         Hawaii                               37.00000          14.36029
## 12          Idaho                               37.50000          10.29250
## 13       Illinois                               36.60398          12.74717
## 14        Indiana                               39.93578          10.77310
## 15           Iowa                               27.45066          11.07193
## 16         Kansas                               35.00000          11.10681
## 17       Kentucky                               34.44118          10.93049
## 18      Louisiana                               37.50000          10.16115
## 19          Maine                               37.57534          13.50000
## 20       Maryland                               52.82278          13.82775
## 21  Massachusetts                               35.38428          16.37783
## 22       Michigan                               46.81435          12.71552
## 23      Minnesota                               41.74599          12.95000
## 24    Mississippi                               44.00000          10.01532
## 25       Missouri                               30.24737          11.12652
## 26        Montana                                9.00000          11.60630
## 27       Nebraska                               45.81679          11.10513
## 28         Nevada                               66.72609          14.41346
## 29  New Hampshire                               24.79856          11.74398
## 30     New Jersey                               61.79025          12.26810
## 31     New Mexico                               39.39815          11.47011
## 32       New York                               53.36709          15.12440
## 33 North Carolina                               48.08867          11.09389
## 34   North Dakota                               24.00000          11.75118
## 35           Ohio                               36.28298          11.92225
## 36       Oklahoma                               49.03385          10.67654
## 37         Oregon                               38.45322          14.31077
## 38   Pennsylvania                               39.76846          11.38350
## 39   Rhode Island                               42.62500          14.25000
## 40 South Carolina                               43.51136          11.34128
## 41   South Dakota                               26.25000          10.70780
## 42      Tennessee                               33.76724          15.01227
## 43          Texas                               38.29487          12.91629
## 44           Utah                               40.96652          12.56892
## 45        Vermont                               20.50000          12.41711
## 46       Virginia                               36.86441          10.96950
## 47     Washington                               45.15138          14.84650
## 48  West Virginia                               21.94262           9.95927
## 49      Wisconsin                               43.26105          11.04721
## 50        Wyoming                               41.15385          11.88977
##    server_avgHourly personalTrainer_avgHourly houseCleaner_avgHourly
## 1          16.94432                  30.19880               9.297794
## 2          10.27342                        NA              12.000000
## 3          15.90724                  22.69048              17.246053
## 4          13.23810                  21.72222              13.818182
## 5          21.12723                  31.60000              20.477315
## 6          20.70527                  27.70663              17.762673
## 7          20.16359                  45.78673              16.081693
## 8          13.61692                  46.75725              13.996479
## 9          21.64286                  30.85095              16.649485
## 10         13.93250                  25.36364              16.848387
## 11         18.37500                        NA              14.148148
## 12         17.02547                  21.50000              15.500000
## 13         18.20352                  43.00000              18.730769
## 14         15.66526                  33.81034              15.000000
## 15         13.69059                  24.69512              12.580189
## 16         22.12930                  13.89680              15.099702
## 17         15.85897                  22.50000              14.250000
## 18         11.32823                  22.10920              13.772727
## 19         17.87395                        NA              15.825221
## 20         16.23128                  40.39847              18.959821
## 21         17.10930                  34.84300              17.127107
## 22         19.99153                  31.87405              14.908602
## 23         14.79209                  37.79433              15.550000
## 24         10.10038                  23.67073              11.274390
## 25         14.77313                  15.14966              14.902303
## 26         10.83862                        NA              13.096154
## 27         23.50218                  28.44178              11.696303
## 28         15.39977                  44.48930              18.378788
## 29         12.00000                  29.95902              16.327670
## 30         17.15417                  54.89662              20.500000
## 31         12.62500                  24.88235              14.000000
## 32         15.78791                  27.10000              17.942857
## 33         13.94934                  28.55183              14.888889
## 34         13.83920                        NA              12.901408
## 35         24.68998                  29.37113              14.995169
## 36         14.25269                  19.61170              13.032895
## 37         14.66822                  30.24390              18.128125
## 38         13.18695                  36.90284              19.354839
## 39         22.55702                  22.50000              17.500000
## 40         15.60978                  41.95652              13.691176
## 41         10.28085                  12.50000              12.781250
## 42         12.90138                  20.52961              14.997396
## 43         15.86845                  39.51256              17.951220
## 44         16.73750                  33.97685              16.728643
## 45         14.79268                  20.50000              13.000000
## 46         14.12500                  23.32071              14.236386
## 47         17.79289                  52.67669              17.491573
## 48         13.99393                  15.50000              13.000000
## 49         14.16385                  28.43972              14.480519
## 50         11.09789                        NA              17.250000
##    warehouse_avgHourly security_avgHourly nanny_avgHourly clerical_avgHourly
## 1             13.53539           11.04599        13.52381           13.67265
## 2             22.05340           16.85769        12.82609           20.56782
## 3             19.54894           19.08054        17.50000           19.55704
## 4             15.59057           11.07224        13.09877           14.70439
## 5             22.75716           19.91065        25.42714           24.60640
## 6             16.93404           18.65761        17.94586           21.72724
## 7             16.90558           17.17265        27.50000           22.07189
## 8             16.25572           13.94595        16.89474           28.58333
## 9             16.82897           17.14105        19.43642           17.81222
## 10            16.55272           19.70227        15.58173           18.71873
## 11            18.30502           18.73727        12.50000           19.37413
## 12            15.36970           11.41558        22.25000           15.33482
## 13            18.54959           16.25216        22.38462           18.52632
## 14            16.55472           13.40783        15.07639           15.61869
## 15            17.93797           16.47557        14.91667           16.50000
## 16            17.74560           17.59349        13.77885           17.45134
## 17            17.43719           14.96385        15.30172           15.20050
## 18            15.53125           14.76903        13.00000           15.05121
## 19            17.84965           14.76119        15.00000           20.17212
## 20            17.19008           18.58303        20.17073           27.50000
## 21            21.00494           16.65248        21.48438           22.15570
## 22            19.34045           19.51150        15.00000           18.11202
## 23            17.04024           16.12196        19.69549           21.06867
## 24            14.70188           11.50728        11.38710           15.71284
## 25            16.28622           15.50419        14.93277           18.85609
## 26            17.73500           14.30015        11.53846           19.13897
## 27            16.47742           19.13288        16.03093           17.80687
## 28            17.94079           15.99558        13.58712           18.51300
## 29            14.32500           20.23077        17.34653           20.00223
## 30            16.87174           18.72269        25.00000           32.59442
## 31            16.81938           16.03072        12.80645           14.87838
## 32            17.79267           16.79971        21.29510           33.63274
## 33            18.41157           17.46190        20.22000           16.85233
## 34            18.03914           15.35922         9.00000           18.55605
## 35            18.40326           13.38776        17.28632           17.00177
## 36            16.84573           18.42723        13.51546           14.47154
## 37            18.45729           18.34527        20.38710           19.82030
## 38            17.94224           17.72826        16.57453           17.38070
## 39            17.80213           17.75000        18.50000           20.26778
## 40            16.08368           14.17164        13.60390           17.28139
## 41            16.80909           17.67020        12.50000           13.71523
## 42            15.53950           14.07063        15.08850           15.98101
## 43            15.85268           18.76361        16.61747           18.98899
## 44            17.03445           18.05507        15.29528           18.78277
## 45            17.83906           16.84304        15.50000           15.47774
## 46            17.87773           16.36358        16.50000           15.45139
## 47            21.63210           19.30753        24.16667           23.29329
## 48            14.98406           11.31484        11.02273           28.92399
## 49            28.55556           15.06667        16.14894           20.75840
## 50            16.02293           18.92308              NA           14.15566
##    tutor_avgHourly teacher_avgHourly dataScientist_avgHourly
## 1         18.17055          25.26911                63.20268
## 2         20.47500          30.96564                60.61445
## 3         27.69626          20.34749                49.72246
## 4         12.32143          21.20958                59.63178
## 5         42.18433          25.33318                57.98368
## 6         25.00242          24.91436                60.49687
## 7         45.77819          29.89668                55.92059
## 8         21.69253          26.97374                59.37948
## 9         26.42118          23.12273                60.19286
## 10        15.99695          29.56272                57.69231
## 11        21.94000          24.57585                55.32177
## 12        20.00000          24.75018                64.90385
## 13        22.79505          23.78119                55.06044
## 14        17.71823          24.19220                58.78250
## 15        22.99107          20.00285                64.90385
## 16        18.47464          26.42352                54.00481
## 17        19.10638          24.82924                48.92048
## 18        22.34500          22.15002                65.08823
## 19        23.69492          27.46056                64.90385
## 20        36.61667          31.59383                56.39881
## 21        38.85613          23.99374                62.15178
## 22        17.58175          25.71203                64.90385
## 23        26.75000          23.65966                64.90385
## 24        16.99194          28.94959                64.90385
## 25        27.08451          24.69061                52.36881
## 26              NA          25.85343                64.90385
## 27        25.10345          19.71154                64.90385
## 28        19.71804          25.86531                64.90385
## 29        23.34211          27.54287                60.42876
## 30        59.07366          30.25475                80.39789
## 31        20.00000          31.96516                59.07340
## 32        43.22344          22.22748                68.92841
## 33        19.85000          18.39623                49.98561
## 34        21.50000          28.36887                64.90385
## 35        19.82326          18.24373                59.84002
## 36        29.20891          18.39014                64.90385
## 37        17.48348          28.09377                64.90385
## 38        25.16872          19.01989                48.43305
## 39        22.67512          22.96835                64.90385
## 40        19.82870          22.48870                60.58296
## 41              NA          28.51522                64.90385
## 42        19.17929          23.95844                61.85611
## 43        22.69507          23.38367                61.77597
## 44        19.47660          20.07991                55.21154
## 45        16.00000          26.55992                64.90385
## 46        20.01471          13.69036                56.49038
## 47        26.33420          30.24264                74.37227
## 48              NA          26.72927                64.90385
## 49        18.42326          24.39003                63.19705
## 50        10.41774          30.64207                60.76752
avgPay <- round(mean(payRates$LMT_HourlyAvgPayRangeAdvertised_Indeed,na.rm=TRUE),2)
mPay <- min(payRates$LMT_HourlyAvgPayRangeAdvertised_Indeed,na.rm=TRUE)
MPay <- max(payRates$LMT_HourlyAvgPayRangeAdvertised_Indeed,na.rm=TRUE)

ggplot(data = numberOfJobs, aes(y=payRates$LMT_HourlyAvgPayRangeAdvertised_Indeed, x=payRates$state)) +
  geom_bar(stat='identity', position=position_dodge(), na.rm=TRUE)+
  scale_y_continuous(breaks=c(mPay,avgPay,MPay),labels=c(mPay,avgPay,MPay))+
  scale_fill_brewer(palette='Paired') +
  geom_hline(yintercept=mean(payRates$LMT_HourlyAvgPayRangeAdvertised_Indeed, na.rm=TRUE), linetype="dashed", color = "red")+
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('LMT Average Hourly Pay in the US Top 3 Cities of each State')+
  ylab(NULL)+
  xlab(NULL)

Lets see what states are paying their massage therapists more than the US average. Visually, above we can see Georgia does, and that GA is also in the list of the states with less than the average number of LMT job listings in the US per state. This logically indicates there is a demand for massage therapists in these states, and that the businesses offering massage therapy need LMTs and are willing to offer them more pay.

morePayThanAvgLMT <- subset(payRates, payRates$LMT_HourlyAvgPayRangeAdvertised_Indeed > avgPay)
morePayThanAvgLMT$state
##  [1] Arizona        California     Colorado       Connecticut    Georgia       
##  [6] Indiana        Maryland       Michigan       Minnesota      Mississippi   
## [11] Nebraska       Nevada         New Jersey     New Mexico     New York      
## [16] North Carolina Oklahoma       Pennsylvania   Rhode Island   South Carolina
## [21] Utah           Washington     Wisconsin      Wyoming       
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

Lets see which states offer more than the national LMT average hourly pay and are also in the list of states with less than the national average number of LMT job listings.

fewListings <- lessThanAvgLMT$state
morePayAdvertised <- morePayThanAvgLMT$state

demandStatesLMT <- fewListings %in% morePayAdvertised
demanded <- fewListings[demandStatesLMT]
demanded
## [1] Georgia     Indiana     Mississippi Wyoming    
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

The above states have a demand for massage therapists because they have fewer listings advertised on Indeed, but are willing to pay more than the national average for massage therapists. Those states are Georgia, Indiana, Mississippi, and Wyoming.

Using this same logic, it is fair to say those states that have a higher than average demand for massage therapists and also more pay than average for massage therapists must also be states where the cost of living is higher than normal. Lets look at those states and compare their home values for a two bedroom Zillow listed price from our larger data table called slr.

moreListings <- moreThanAvgLMT$state

highCostStates <- moreListings %in% morePayAdvertised
highLivingCost <- moreListings[highCostStates]
highLivingCost
##  [1] Arizona        California     Colorado       Connecticut    Maryland      
##  [6] Michigan       Minnesota      Nebraska       Nevada         New Jersey    
## [11] New Mexico     New York       North Carolina Oklahoma       Pennsylvania  
## [16] Rhode Island   South Carolina Utah           Washington     Wisconsin     
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

There are 20 states that are listed as possible high cost of living states because we are making the assumption that those states with higher than average pay for LMTs and higher than average job listings for LMT are in high cost of living states. We can verify this by looking at the two bedroom homes for sale in all states and get the average to compare to these 20 states.

avgHomePrice <- round(mean(slr$Zillow_2BR_3cityAverageHomeValue),2)
mHomePrice <- round(min(slr$Zillow_2BR_3cityAverageHomeValue),2)
MHomePrice <- round(max(slr$Zillow_2BR_3cityAverageHomeValue),2)

ggplot(data = numberOfJobs, aes(y=slr$Zillow_2BR_3cityAverageHomeValue, x=slr$state)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_y_continuous(breaks=c(mHomePrice,avgHomePrice,MHomePrice),
                     labels=c(mHomePrice,avgHomePrice,MHomePrice))+
  scale_fill_brewer(palette='Paired') +
  geom_hline(yintercept=avgHomePrice, linetype="dashed", color = "red")+
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('Zillow 2 Bedroom Home Value in the US Top 3 Cities of each State')+
  ylab(NULL)+
  xlab(NULL)

Lets see exactly which states have higher priced homes than the national average.

expensiveHomes <- subset(slr,slr$Zillow_2BR_3cityAverageHomeValue>avgHomePrice)
e <- expensiveHomes$state
e
##  [1] Alaska        Arizona       California    Colorado      Hawaii       
##  [6] Idaho         Maine         Massachusetts Minnesota     Montana      
## [11] Nevada        New Jersey    New York      Oregon        Rhode Island 
## [16] Utah          Virginia      Washington    Wyoming      
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

There are 22 states with higher priced homes than the national average from the list produced above.

Lets see if those states are also in the list of states with high living costs.

expensive <- expensiveHomes$state %in% highLivingCost
expensiveHomes <- e[expensive]
expensiveHomes
##  [1] Arizona      California   Colorado     Minnesota    Nevada      
##  [6] New Jersey   New York     Rhode Island Utah         Washington  
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

There are 10 states with expensive homes compared to the national average home price, and that also have higher pay advertised for LMTs and more advertised job listings for LMTs in the three most populated cities in each state according to the first five web pages of Indeed.

Lets see which states have lower priced homes than the national average but also have higher pay advertised for LMTs and more job listings advertised for LMTs.

inexpensiveHomes <- subset(slr,slr$Zillow_2BR_3cityAverageHomeValue < avgHomePrice)
inexpensive <- inexpensiveHomes$state 

notExpensive <- inexpensive %in% highLivingCost
affordable <- inexpensive[notExpensive]
affordable
##  [1] Connecticut    Maryland       Michigan       Nebraska       New Mexico    
##  [6] North Carolina Oklahoma       Pennsylvania   South Carolina Wisconsin     
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

We have a couple lists we generated, one for the higher priced states that also pay more for LMTs and have more jobs available called ‘expensiveHomes’, and another list that is the list of states that aren’t as expensive but also pay more for LMTs and have more jobs available for LMTs called ‘affordable’ that we can compare other factors in our large dataset called slr. We also have a third list called ‘demanded’ that lists those states that don’t have as many jobs available as the national average for LMTs but pays more than the national average. Lets see if those states are in our list of states with a higher than national average home according to Zillow’s two bedroom home values that was named ‘e’ for expensive homes by state.

demanded
## [1] Georgia     Indiana     Mississippi Wyoming    
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming
demanded %in% e
## [1] FALSE FALSE FALSE  TRUE

We can see none of the demand for LMT states are in the list of states with expensive homes or homes with higher than average two bedroom home values.

So, we actually have four lists: e is the list of states with expensive homes, demanded is our list of states with demand has influenced LMT pay to higher for LMTs than the national average, expensiveHomes is our list of states with high cost of living based on higher home values and that also pay more and have more jobs available for LMTs, and our 4th list is the affordable list of lower cost of living by home price less than national average but also that has higher pay and more jobs available for LMTs than the national average.

Lets look at the demographics of the states that are in our affordable list and compare to the demographics or our expensiveHomes list to get an idea of the diversity.

demographics <- subset(slr, slr$state %in% affordable)
demographics2 <- demographics[,c(1,37:44)]
demographics2
##             state total_state_population percent_black percent_white
## 7     Connecticut                3572665          11.0          75.2
## 20       Maryland                6042718          30.0          54.7
## 22       Michigan                9995915          13.8          78.3
## 27       Nebraska                1929268           4.7          86.4
## 31     New Mexico                2095428           2.2          76.4
## 33 North Carolina               10383620          21.4          68.4
## 36       Oklahoma                3943079           7.3          72.2
## 38   Pennsylvania               12807060          11.2          80.1
## 40 South Carolina                5084127          26.6          67.0
## 49      Wisconsin                5813568           6.4          85.3
##    percent_two_or_more percent_Native_American percent_Asian
## 7                  3.4                     0.3           4.6
## 20                 3.7                     0.2           6.3
## 22                 2.9                     0.5           3.3
## 27                 3.1                     1.0           2.4
## 31                 3.2                     9.6           1.6
## 33                 2.9                     1.2           3.0
## 36                 7.7                     7.8           2.1
## 38                 2.6                     0.2           3.6
## 40                 2.4                     0.5           1.6
## 49                 2.5                     0.9           2.8
##    percent_Pacific_Islander percent_Latino
## 7                       0.0           16.5
## 20                      0.1           10.4
## 22                      0.0            5.2
## 27                      0.1           11.1
## 31                      0.1           49.1
## 33                      0.1            9.6
## 36                      0.1           10.9
## 38                      0.0            7.6
## 40                      0.1            5.8
## 49                      0.0            6.9

Lets look at this above chart of affordable states for LMTs compared to the demographics of CA.

CA_demog <- subset(slr, slr$state=='California')
CA_demog2 <- CA_demog[,c(1,37:44)]
CA_demog2
##        state total_state_population percent_black percent_white
## 5 California               39557045           5.8          59.5
##   percent_two_or_more percent_Native_American percent_Asian
## 5                 5.1                     0.8          14.7
##   percent_Pacific_Islander percent_Latino
## 5                      0.4           39.3

When comparing demographics of percent race to population, it could be similar in fashion to looking for an alternate planet similar to Earth in a vast universe. But we can see the state with a closer distribution of the population by Asian, Latino, Black, and two or more races is New York. The other states that are affordable in our list of 10 when compared to CA, a high cost of living state, don’t really compare similarly as far as race distribution goes. Lets look at how a few of our alternate jobs from these 10 states compare to CA next.

altjobs_aff <- demographics[,c(1,32,45,48,51,54,57,60,63,66,69,72,75)]
CA_altjobs <- CA_demog[,c(1,32,45,48,51,54,57,60,63,66,69,72,75)]
altjobs_aff
##             state LMT_AvgJobsListed_IndeedFirst5pages cashier_jobsListed
## 7     Connecticut                                 203                204
## 20       Maryland                                 237                209
## 22       Michigan                                 237                232
## 27       Nebraska                                 169                195
## 31     New Mexico                                 162                184
## 33 North Carolina                                 203                217
## 36       Oklahoma                                 192                211
## 38   Pennsylvania                                 227                226
## 40 South Carolina                                 176                215
## 49      Wisconsin                                 166                197
##    server_jobsListed personalTrainer_jobsListed houseCleaner_jobsListed
## 7                217                        211                     127
## 20               227                        229                     224
## 22               236                        175                     186
## 27               229                        146                     142
## 31               209                        102                      70
## 33               227                        164                     198
## 36               225                        133                      76
## 38               228                        211                     186
## 40               230                        184                     204
## 49               222                        141                      89
##    warehouse_jobsListed security_jobsListed nanny_jobsListed
## 7                   233                 223              172
## 20                  240                 228              164
## 22                  246                 240               91
## 27                  236                 222               97
## 31                  224                 236               62
## 33                  229                 210              150
## 36                  227                 213               97
## 38                  232                 230              161
## 40                  239                 201               77
## 49                  234                 225               94
##    clerical_jobsListed tutor_jobsListed teacher_jobsListed
## 7                  233              204                239
## 20                 234              225                249
## 22                 235              211                247
## 27                 233              212                230
## 31                 222              178                218
## 33                 223              205                233
## 36                 224              202                222
## 38                 228              203                235
## 40                 231              216                222
## 49                 238              215                238
##    dataScientist_jobsListed
## 7                       226
## 20                      239
## 22                      152
## 27                       74
## 31                      161
## 33                      167
## 36                       98
## 38                      182
## 40                       78
## 49                      142

There are less nanny, personal training, house cleaning, and data science jobs in the affordable states than in CA. While there are more cashier, server, and teaching jobs in the affordable states than in CA. The number of tutoring, clerical, warehouse, and security jobs are similar in available jobs.

CA_altjobs
##        state LMT_AvgJobsListed_IndeedFirst5pages cashier_jobsListed
## 5 California                                 223                227
##   server_jobsListed personalTrainer_jobsListed houseCleaner_jobsListed
## 5               224                        190                     216
##   warehouse_jobsListed security_jobsListed nanny_jobsListed clerical_jobsListed
## 5                  243                 230              199                 225
##   tutor_jobsListed teacher_jobsListed dataScientist_jobsListed
## 5              217                236                      231

Now, lets compare CA to our list of expensive states for demographics and alternate jobs available. CA is in our list of expensive states, so we don’t have to do separate table chart comparisons.

expensiveDemog <- subset(slr, slr$state %in% expensiveHomes)
expensiveDemog2 <- expensiveDemog[,c(1,37:44)]
expensiveDemog2
##           state total_state_population percent_black percent_white
## 3       Arizona                7171646           4.7          78.0
## 5    California               39557045           5.8          59.5
## 6      Colorado                5695564           4.2          84.1
## 23    Minnesota                5611179           6.6          82.5
## 28       Nevada                3034392           9.2          63.4
## 30   New Jersey                8908520          13.6          66.9
## 32     New York               19542209          15.7          63.3
## 39 Rhode Island                1057315           6.7          80.7
## 44         Utah                3161105           1.3          85.7
## 47   Washington                7535591           3.9          74.8
##    percent_two_or_more percent_Native_American percent_Asian
## 3                  4.0                     4.6           3.3
## 5                  5.1                     0.8          14.7
## 6                  4.0                     1.0           3.2
## 23                 3.1                     1.1           4.9
## 28                 5.1                     1.5           8.2
## 30                 2.8                     0.2           9.7
## 32                 3.3                     0.4           8.5
## 39                 3.1                     0.4           3.4
## 44                 3.2                     1.1           2.4
## 47                 6.0                     1.3           8.8
##    percent_Pacific_Islander percent_Latino
## 3                       0.2           31.6
## 5                       0.4           39.3
## 6                       0.1           21.7
## 23                      0.0            5.5
## 28                      0.6           29.0
## 30                      0.0           20.6
## 32                      0.0           19.2
## 39                      0.1           15.9
## 44                      0.9           14.2
## 47                      0.7           12.9

From the above data, the closest state in comparison to diversity to CA is NV or Nevada. The next state would be Colorado or Washington.

Now, we will compare the alternate jobs available in our list of expensive states that includes CA.

altJobs_expStates <- expensiveDemog[,c(1,32,45,48,51,54,57,60,63,66,69,72,75)]
altJobs_expStates
##           state LMT_AvgJobsListed_IndeedFirst5pages cashier_jobsListed
## 3       Arizona                                 212                217
## 5    California                                 223                227
## 6      Colorado                                 241                212
## 23    Minnesota                                 187                210
## 28       Nevada                                 230                208
## 30   New Jersey                                 236                232
## 32     New York                                 196                209
## 39 Rhode Island                                 215                211
## 44         Utah                                 224                222
## 47   Washington                                 218                200
##    server_jobsListed personalTrainer_jobsListed houseCleaner_jobsListed
## 3                221                        168                     171
## 5                224                        190                     216
## 6                225                        196                     217
## 23               230                        150                     153
## 28               215                        187                     198
## 30               240                        237                     227
## 32               215                        135                     175
## 39               228                        192                     199
## 44               220                        162                     199
## 47               204                        133                     178
##    warehouse_jobsListed security_jobsListed nanny_jobsListed
## 3                   235                 221              182
## 5                   243                 230              199
## 6                   250                 234              157
## 23                  233                 225              133
## 28                  228                 226              132
## 30                  230                 238              211
## 32                  232                 222              102
## 39                  253                 225              162
## 44                  254                 227              127
## 47                  238                 227              126
##    clerical_jobsListed tutor_jobsListed teacher_jobsListed
## 3                  226              214                245
## 5                  225              217                236
## 6                  243              207                247
## 23                 233              225                225
## 28                 230              219                230
## 30                 233              224                242
## 32                 226              209                230
## 39                 243              217                238
## 44                 226              203                216
## 47                 237              193                231
##    dataScientist_jobsListed
## 3                       183
## 5                       231
## 6                       194
## 23                      146
## 28                       49
## 30                      234
## 32                      144
## 39                      179
## 44                      175
## 47                      178

For the most part, the expensive states have about the same distribution of available jobs alternative to LMT work, except some states have noticeably less nanny and personal training jobs. Arizona and Washington have less personal training jobs, while Nevada, Rhode Island, and Washington have less nanny jobs. And there are far less house cleaning jobs in Connecticut than any other state that is expensive. Also, there are not as many data science jobs available in Nevada as any other expensive state.

Lets now plot the number of available jobs by category in CA compared to New Jersey and New York. New Jersey is an expensive state and New York is not so expensive compared to the average home value of the three top populated cities in each state.

NY_altJobs <- subset(altJobs_expStates, altJobs_expStates$state=='New York')
CA_altJobs <- subset(altJobs_expStates, altJobs_expStates$state=='California')
NJ_altJobs <- subset(altJobs_expStates, altJobs_expStates$state=='New Jersey')

NY_tidyJobs <- gather(NY_altJobs,key="jobTitle", value="jobsListed",2:13, na.rm=TRUE)
NY_tidyJobs$jobTitle <- gsub('_.*$','',NY_tidyJobs$jobTitle, perl=TRUE)

CA_tidyJobs <- gather(CA_altJobs,key="jobTitle", value="jobsListed",2:13, na.rm=TRUE)
CA_tidyJobs$jobTitle <- gsub('_.*$','',CA_tidyJobs$jobTitle, perl=TRUE)

NJ_tidyJobs <- gather(NJ_altJobs,key="jobTitle", value="jobsListed",2:13, na.rm=TRUE)
NJ_tidyJobs$jobTitle <- gsub('_.*$','',NJ_tidyJobs$jobTitle, perl=TRUE)
ggplot(data = CA_tidyJobs, aes(y=CA_tidyJobs$jobsListed, x=CA_tidyJobs$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('CA Alternate and LMT Jobs Advertised')+
  ylab(NULL)+
  xlab(NULL)

There are more warehouse and security jobs available on Indeed than the other listed jobs in CA. In comparison to other job categories available in CA, there are less tutor, nanny, and LMT jobs available than other comparative jobs.

ggplot(data = NY_tidyJobs, aes(y=NY_tidyJobs$jobsListed, x=NY_tidyJobs$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('NY Alternate and LMT Jobs Advertised')+
  ylab(NULL)+
  xlab(NULL)

New York has more clerical, teaching, and warehouse jobs available than other jobs in NY, but has far less personal training and nanny jobs available than CA did.

ggplot(data = NJ_tidyJobs, aes(y=NJ_tidyJobs$jobsListed, x=NJ_tidyJobs$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('NJ Alternate and LMT Jobs Advertised')+
  ylab(NULL)+
  xlab(NULL)

AZ has more teacher and warehouse jobs available just like NY than other jobs in the state from our categories of alternate jobs to LMT. There are as many LMT jobs available as there are security, clerical, cashier, and server.

Now, lets compare the pay to each of these states of CA, NY, and NV. To see how LMTs get paid compared to these alternative jobs in those states.

NY_pay <- subset(slr, slr$state=='New York')
NY_pay2 <- NY_pay[,c(1,34,47,50,53,56,59,62,65,68,71,74,77)]
CA_pay <- subset(slr, slr$state=='California')
CA_pay2 <- CA_pay[,c(1,34,47,50,53,56,59,62,65,68,71,74,77)]
AZ_pay <- subset(slr, slr$state=='Arizona')
AZ_pay2 <- AZ_pay[,c(1,34,47,50,53,56,59,62,65,68,71,74,77)]

NY_PAY <- gather(NY_pay2,key='jobTitle',value='AnnualPay',2:13)
NY_PAY$jobTitle <- gsub('_.*$','',NY_PAY$jobTitle)
CA_PAY <- gather(CA_pay2,key='jobTitle',value='AnnualPay',2:13)
CA_PAY$jobTitle <- gsub('_.*$','',CA_PAY$jobTitle)
AZ_PAY <- gather(AZ_pay2, key='jobTitle',value='AnnualPay',2:13)
AZ_PAY$jobTitle <- gsub('_.*$','',AZ_PAY$jobTitle)
ggplot(data = CA_PAY, aes(y=CA_PAY$AnnualPay, x=CA_PAY$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  geom_hline(yintercept=mean(CA_pay$median2018IncomeByState), linetype="dashed", color = "red")+
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('CA Alternate and LMT Jobs Advertised Annual Pay with Median CA pay')+
  ylab(NULL)+
  xlab(NULL)

ggplot(data = NY_PAY, aes(y=NY_PAY$AnnualPay, x=NY_PAY$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  geom_hline(yintercept=mean(NY_pay$median2018IncomeByState), linetype="dashed", color = "red")+
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('NY Alternate and LMT Jobs Advertised Annual Pay')+
  ylab(NULL)+
  xlab(NULL)

ggplot(data = AZ_PAY, aes(y=AZ_PAY$AnnualPay, x=AZ_PAY$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  geom_hline(yintercept=mean(AZ_pay$median2018IncomeByState), linetype="dashed", color = "red")+
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('AZ Alternate and LMT Jobs Advertised Annual Pay')+
  ylab(NULL)+
  xlab(NULL)

Lets summarize the pay for each comparative job to that of the number of jobs available. In each state, there were more warehouse jobs available than most other jobs in our categories selected, but this role is on the low end of the annual pay scale compared to those other jobs available. In all jobs, data scientist pays the most in CA, AZ, and NY. LMT pays more than clerical in AZ or CA but not in NY. In CA, nannys get paid more than LMTs and so do personal trainers. In NY, security pays more than LMTs but not in CA or AZ. Also, tutors get paid more than teachers in NY and CA, but almost the same but less than in AZ.

Those are interesting findings for those three states. Data hasn’t been analyzed on the actual requirements to get licensed as a massage therapist in each state, because the table hasn’t been filled in. Each state has to be handled separately by finding each requirement from their massage board website of each state, and if not available or not intuitively navigated to from their home page, then emailed and asked about each specific requirements on cost, hours required, continuing education, time to process, distribution of hours, license by endorsement or reciprocity available, etc. It is being added to as time and desire permits on a motivational need. I haven’t found a table of these requirements on any internet search, but did find something close with American Massage Therapy Association’s listing of schools and state requirements that lacked a date updated or sources to validate and the other variables sought.

It would now be interesting to separately use our function from another script to pull in the jobs in our same wellness market of licensed massage therapists. Such as chiropractors, physical therapists, keep the personal trainer data, and add estheticians or skin care or medical spa jobs maybe by just searching for those jobs, as well as resort spas. This would add value to how effective our decision would be to move to a state to earn more, live better, or even open up a business in massage therapy that would do well based on evidence gathered from other top cities in each state and home values alongside the diversity indicated by percent race in population of the state. finding and replacing the job search sought in the scripts that are similar in file name to ‘copy-indeed-webscrape-function-Alt-jobs-dataScientist.Rmd’ in the github repository mentioned at the beginning of this script will get you the information you need in about 10-15 minutes. As it goes through the first five web page job listings on Indeed for 150 cities or the three most populated cities in each of the 50 US states.


Lets look at some other salaries from other professions, that reflect the state of our economy. I have ran the function to pull the wage information and number of jobs listed for nurses, medical doctors, chiropractors, physical therapists, estheticians, medical spa technicians, and personal assistants. Lets see what our data tells us in a state by state comparison.

nurses <- read.csv('./Alternate Jobs Each State Indeed/statesRates-nurse.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
personalAssistants <- read.csv('./Alternate Jobs Each State Indeed/statesRates-personal assistant.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
chiropractor <- read.csv('./Alternate Jobs Each State Indeed/statesRates-chiropractor.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
physicalTherapist <- read.csv('./Alternate Jobs Each State Indeed/statesRates-physical therapist.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
esthetician <- read.csv('./Alternate Jobs Each State Indeed/statesRates-esthetician.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
medicalSpaEsthetician <- read.csv('./Alternate Jobs Each State Indeed/statesRates-medical spa technician.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
medicalDoctor <- read.csv('./Alternate Jobs Each State Indeed/statesRates-medical doctor.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
yogaInstructor <- read.csv('./Alternate Jobs Each State Indeed/statesRates-yoga Instructor.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
pilatesInstructor <- read.csv('./Alternate Jobs Each State Indeed/statesRates-pilates Instructor.csv', sep=',',
                   header=TRUE, na.strings=c('',' ','NA'))
nurses$stateName <- states
nurses <- nurses[,c(1,10,2:9)]
head(nurses)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        231       nurse        27.35931        78.75758
## 2    AL    Alabama        238       nurse        16.07983        36.43277
## 3    AR   Arkansas        260       nurse        18.36923        38.13077
## 4    AZ    Arizona        248       nurse        20.34677        63.25806
## 5    CA California        234       nurse        21.66667        86.66667
## 6    CO   Colorado        254       nurse        19.64567        78.70079
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        44345.73        152497.1  53.05844       98421.42
## 2        50879.47        138256.3  26.25630       94567.88
## 3        45058.82        133460.2  28.25000       89259.51
## 4        34455.23        151675.0  41.80242       93065.11
## 5        69662.00        161812.7  54.16667      115737.33
## 6        46538.89        117747.5  49.17323       82143.21
personalAssistants$stateName <- states
personalAssistants <- personalAssistants[,c(1,10,2:9)]
head(personalAssistants)
##   state  stateName jobsListed        jobSearched MinHourlySalary
## 1    AK     Alaska        107 personal assistant        11.88131
## 2    AL    Alabama        179 personal assistant         8.00000
## 3    AR   Arkansas        128 personal assistant         9.31250
## 4    AZ    Arizona        210 personal assistant        11.00000
## 5    CA California        223 personal assistant        11.33632
## 6    CO   Colorado        209 personal assistant        12.26555
##   MaxHourlySalary MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        28.91252        31988.57       145588.57  20.39692       88788.57
## 2        19.62570        34018.08        69055.93  13.81285       51537.01
## 3        17.25625        45464.50        78900.69  13.28438       62182.59
## 4        26.03138        37234.52        91642.61  18.51569       64438.57
## 5        33.34081        33221.35       165794.13  22.33857       99507.74
## 6        27.33244        29429.28       122039.61  19.79900       75734.44
chiropractor$stateName <- states
chiropractor <- chiropractor[,c(1,10,2:9)]
head(chiropractor)
##   state  stateName jobsListed  jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska         36 chiropractor              NA              NA
## 2    AL    Alabama         42 chiropractor        12.25000        77.50000
## 3    AR   Arkansas         27 chiropractor        12.47826        13.52174
## 4    AZ    Arizona        155 chiropractor        12.00000        34.60993
## 5    CA California        205 chiropractor        12.93659        46.23415
## 6    CO   Colorado        197 chiropractor        12.67005        67.56345
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        50000.00        132777.8        NA       91388.89
## 2        50000.00         80000.0  44.87500       65000.00
## 3        50000.00         80000.0  13.00000       65000.00
## 4        37264.52        211903.2  23.30496      124583.87
## 5        45038.85        133287.1  29.58537       89162.96
## 6        45000.00        125076.1  40.11675       85038.07
physicalTherapist$stateName <- states
physicalTherapist <- physicalTherapist[,c(1,10,2:9)]
head(physicalTherapist)
##   state  stateName jobsListed        jobSearched MinHourlySalary
## 1    AK     Alaska         87 physical therapist              NA
## 2    AL    Alabama        215 physical therapist        35.26718
## 3    AR   Arkansas        179 physical therapist        42.00000
## 4    AZ    Arizona        231 physical therapist        13.88312
## 5    CA California        215 physical therapist        26.83023
## 6    CO   Colorado        215 physical therapist        34.55349
##   MaxHourlySalary MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA        45627.00       115000.00        NA       80313.50
## 2        47.10401        62941.00       102606.00  41.18560       82773.50
## 3        60.00000              NA              NA  51.00000             NA
## 4        59.67177        60382.17        97547.77  36.77745       78964.97
## 5        89.76726        49542.50       138781.65  58.29874       94162.07
## 6        86.04651        47231.63       107740.00  60.30000       77485.81
esthetician$stateName <- states
esthetician <- esthetician[,c(1,10,2:9)]
head(esthetician)
##   state  stateName jobsListed jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska         28 esthetician        20.00000        25.00000
## 2    AL    Alabama         88 esthetician        13.93182        39.45455
## 3    AR   Arkansas         47 esthetician        15.00000        15.00000
## 4    AZ    Arizona        211 esthetician        14.25118        43.83886
## 5    CA California        219 esthetician        13.29224       115.52511
## 6    CO   Colorado        186 esthetician        11.93548        60.77957
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA  22.50000             NA
## 2        28000.00        35000.00  26.69318       31500.00
## 3        30000.00        45000.00  15.00000       37500.00
## 4        17500.00        70000.00  29.04502       43750.00
## 5        21155.25        78493.15  64.40868       49824.20
## 6        35155.91        50000.00  36.35753       42577.96
medicalSpaEsthetician$stateName <- states
medicalSpaEsthetician <- medicalSpaEsthetician[,c(1,10,2:9)]
head(medicalSpaEsthetician)
##   state  stateName jobsListed            jobSearched MinHourlySalary
## 1    AK     Alaska         10 medical spa technician        25.00000
## 2    AL    Alabama         29 medical spa technician        13.86207
## 3    AR   Arkansas         40 medical spa technician        25.00000
## 4    AZ    Arizona        170 medical spa technician        14.80588
## 5    CA California         72 medical spa technician        16.87500
## 6    CO   Colorado        159 medical spa technician        14.48113
##   MaxHourlySalary MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              38              NA              NA  31.50000             NA
## 2              38              NA              NA  25.93103             NA
## 3              38           45000           75000  31.50000          60000
## 4              38              NA              NA  26.40294             NA
## 5              38              NA              NA  27.43750             NA
## 6              38           36000           50000  26.24057          43000
medicalDoctor$stateName <- states
medicalDoctor <- medicalDoctor[,c(1,10,2:9)]
head(medicalDoctor)
##   state  stateName jobsListed    jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska        203 medical doctor       29.908867        45.87931
## 2    AL    Alabama        235 medical doctor        8.668085        73.68085
## 3    AR   Arkansas        204 medical doctor       11.000000       200.00000
## 4    AZ    Arizona        232 medical doctor       11.663793        28.31897
## 5    CA California        233 medical doctor       13.100858       162.87554
## 6    CO   Colorado        237 medical doctor       12.000000        38.73325
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1        42123.19        457881.8  37.89409      250002.48
## 2        46086.99        414697.9  41.17447      230392.43
## 3        48433.39        374019.6 105.50000      211226.50
## 4        34491.32        182974.1  19.99138      108732.73
## 5        52008.58        129334.8  87.98820       90671.67
## 6        37155.54        192524.9  25.36662      114840.22
yogaInstructor$stateName <- states
yogaInstructor <- yogaInstructor[,c(1,10,2:9)]
yogaInstructor$avgAnualSalary <- yogaInstructor$avgHourly*40*52
head(yogaInstructor)
##   state  stateName jobsListed     jobSearched MinHourlySalary MaxHourlySalary
## 1    AK     Alaska          4 yoga instructor              NA              NA
## 2    AL    Alabama         27 yoga instructor        25.00000        72.60870
## 3    AR   Arkansas         20 yoga instructor        10.00000       100.00000
## 4    AZ    Arizona        152 yoga instructor        21.21711        93.68421
## 5    CA California        209 yoga instructor        15.00000       100.00000
## 6    CO   Colorado        155 yoga instructor        15.01935       100.00000
##   MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1              NA              NA        NA             NA
## 2              NA              NA  48.80435       101513.0
## 3              NA              NA  55.00000       114400.0
## 4              NA              NA  57.45066       119497.4
## 5           36000          145266  57.50000       119600.0
## 6              NA              NA  57.50968       119620.1
pilatesInstructor$stateName <- states[2:50]
pilatesInstructor <- pilatesInstructor[,c(1,10,2:9)]
head(pilatesInstructor)
##   state   stateName jobsListed        jobSearched MinHourlySalary
## 1    AL     Alabama         31 pilates instructor        25.00000
## 2    AR    Arkansas          9 pilates instructor        25.00000
## 3    AZ     Arizona        111 pilates instructor        12.00000
## 4    CA  California        198 pilates instructor        14.77778
## 5    CO    Colorado        157 pilates instructor        19.45363
## 6    CT Connecticut        159 pilates instructor        19.64151
##   MaxHourlySalary MinAnnualSalary MaxAnnualSalary avgHourly avgAnualSalary
## 1             100              NA              NA  62.50000             NA
## 2             100              NA              NA  62.50000             NA
## 3             100              NA              NA  56.00000             NA
## 4             100           36000           55000  57.38889          45500
## 5             100              NA              NA  59.72682             NA
## 6             100              NA              NA  59.82075             NA

Lets combine these jobs to the slr dataset.

nurses2 <- nurses[,c(2,3,9,10)]
personalAssistants2 <- personalAssistants[,c(2,3,9,10)]
chiropractor2 <- chiropractor[,c(2,3,9,10)]
physicalTherapist2 <- physicalTherapist[,c(2,3,9,10)]
esthetician2 <- esthetician[,c(2,3,9,10)]
medicalSpaEsthetician2 <- medicalSpaEsthetician[,c(2,3,9,10)]
medicalDoctor2 <- medicalDoctor[,c(2,3,9,10)]
yogaInstructor2 <- yogaInstructor[,c(2,3,9,10)]
pilatesInstructor2 <- pilatesInstructor[,c(2,3,9,10)]
nurses2$avgAnualSalary <- ifelse(nurses2$avgAnualSalary,nurses2$avgAnualSalary,
                                 nurses2$avgHourly*40*52)
colnames(nurses2)[2:4] <- paste('nurses',colnames(nurses2)[2:4])

personalAssistants2$avgAnualSalary <- ifelse(personalAssistants2$avgAnualSalary,
                                             personalAssistants2$avgAnualSalary,
                                             personalAssistants2$avgHourly*40*52)
colnames(personalAssistants2)[2:4] <- paste('personalAssistant',colnames(personalAssistants2)[2:4])

chiropractor2$avgAnualSalary <- chiropractor2$avgHourly*40*52
colnames(chiropractor2)[2:4] <- paste('chiropractor',colnames(chiropractor2)[2:4])

physicalTherapist2$avgAnualSalary <- physicalTherapist2$avgHourly*40*52
colnames(physicalTherapist2)[2:4] <- paste('physicalTherapist',colnames(physicalTherapist2)[2:4])

esthetician2$avgAnualSalary <- esthetician2$avgHourly*40*52
colnames(esthetician2)[2:4] <- paste('esthetician',colnames(esthetician2)[2:4])

medicalSpaEsthetician2$avgAnualSalary <- medicalSpaEsthetician2$avgHourly*40*52
colnames(medicalSpaEsthetician2)[2:4] <- paste('medicalSpaEsthetician',colnames(medicalSpaEsthetician2)[2:4])

medicalDoctor2$avgAnualSalary <- ifelse(medicalDoctor2$avgAnualSalary,
                                        medicalDoctor2$avgAnualSalary,
                                        medicalDoctor2$avgHourly*40*52)
colnames(medicalDoctor2)[2:4] <- paste('medicalDoctor',colnames(medicalDoctor2)[2:4])
colnames(yogaInstructor2)[2:4] <- paste('yogaInstructor',colnames(yogaInstructor2)[2:4])
pilatesInstructor2$avgAnualSalary <- pilatesInstructor2$avgHourly*40*52
colnames(pilatesInstructor2)[2:4] <- paste('pilatesInstructor',colnames(pilatesInstructor2)[2:4])

Combine these other jobs into a table with the slr data table.

slr2 <- merge(slr, nurses2, by.x='state',by.y='stateName')
slr2 <- merge(slr2,personalAssistants2, by.x='state',by.y='stateName')
slr2 <- merge(slr2, chiropractor2, by.x='state',by.y='stateName')
slr2 <- merge(slr2, physicalTherapist2, by.x='state', by.y='stateName')
slr2 <- merge(slr2, esthetician2, by.x='state', by.y='stateName')
slr2 <- merge(slr2, medicalSpaEsthetician2, by.x='state', by.y='stateName')
slr2 <- merge(slr2, medicalDoctor2, by.x='state',by.y='stateName')
slr2 <- merge(slr2, yogaInstructor2, by.x='state',by.y='stateName')
slr2 <- merge(slr2, pilatesInstructor2, by.x='state', by.y='stateName',all.x=TRUE)
write.csv(slr2,'stateLicensingDemographicsAddedAndUpdated.csv', row.names=FALSE)

Number of jobs listed and average annual salary in each category by state’s top three populated cities:

jbl <- grep('jobsListed',colnames(slr2))
listedJobsAll <- slr2[,c(1,32,jbl)]

ansy <- grep('avgAn',colnames(slr2))
avgSalaryAll <- slr2[,c(1,34,ansy)]
colnames(listedJobsAll) <- gsub('_.*$','',colnames(listedJobsAll),perl=TRUE)
colnames(listedJobsAll) <- gsub(' jobsListed','',colnames(listedJobsAll))
listedJobsAll
##             state LMT cashier server personalTrainer houseCleaner warehouse
## 1         Alabama  88     183    220              92           72       219
## 2          Alaska  39     103     73              47            4       206
## 3         Arizona 212     217    221             168          171       235
## 4        Arkansas  73     190    197              72           36       212
## 5      California 223     227    224             190          216       243
## 6        Colorado 241     212    225             196          217       250
## 7     Connecticut 203     204    217             211          127       233
## 8        Delaware 159     203    201             157          284       221
## 9         Florida 222     225    224             200          194       233
## 10        Georgia 105     180    200             103          155       202
## 11         Hawaii  99     136    144              38           27       219
## 12          Idaho 203     200    211              87          198       234
## 13       Illinois 226     221    233             206          195       242
## 14        Indiana 109     211    208              96           84       233
## 15           Iowa 152     212    202              82          106       227
## 16         Kansas 179     213    227             172          168       233
## 17       Kentucky 123     214    195              67           85       240
## 18      Louisiana 110     204    220              87           85       224
## 19          Maine  73     139    119              28          113       143
## 20       Maryland 237     209    227             229          224       240
## 21  Massachusetts 229     221    215             207          178       244
## 22       Michigan 237     232    236             175          186       246
## 23      Minnesota 187     210    230             150          153       233
## 24    Mississippi  93     204    198              82           82       223
## 25       Missouri 190     214    227             147          152       225
## 26        Montana  46     196    189              18           17       199
## 27       Nebraska 169     195    229             146          142       236
## 28         Nevada 230     208    215             187          198       228
## 29  New Hampshire 139     187    216             183          206       240
## 30     New Jersey 236     232    240             237          227       230
## 31     New Mexico 162     184    209             102           70       224
## 32       New York 196     209    215             135          175       232
## 33 North Carolina 203     217    227             164          198       229
## 34   North Dakota  46     211    199              27          125       222
## 35           Ohio 235     227    227             194          207       253
## 36       Oklahoma 192     211    225             133           76       227
## 37         Oregon 171     181    188             123          128       236
## 38   Pennsylvania 227     226    228             211          186       232
## 39   Rhode Island 215     211    228             192          199       253
## 40 South Carolina 176     215    230             184          204       239
## 41   South Dakota  56     134    155              33           36       220
## 42      Tennessee 174     214    218             152          192       230
## 43          Texas 234     224    229             199          205       224
## 44           Utah 224     222    220             162          199       254
## 45        Vermont  70     187    164               4           89       233
## 46       Virginia 177     209    241             198          202       229
## 47     Washington 218     200    204             133          178       238
## 48  West Virginia  61     178    206              52           27       196
## 49      Wisconsin 166     197    222             141           89       234
## 50        Wyoming  35     175    147              17           19       164
##    security nanny clerical tutor teacher dataScientist nurses personalAssistant
## 1       212    42      223   201     213           122    238               179
## 2       169    23      211   142     194            37    231               107
## 3       221   182      226   214     245           183    248               210
## 4       199    81      222   112     178            70    260               128
## 5       230   199      225   217     236           231    234               223
## 6       234   157      243   207     247           194    254               209
## 7       223   172      233   204     239           226    233               221
## 8       222   133      219   192     242           161    241               181
## 9       228   173      236   220     225           174    245               228
## 10      220   104      224   164     217            95    235               170
## 11      216    48      230   167     231           117    234               177
## 12      215   102      224   209     219            94    247               195
## 13      232   195      228   222     242           207    259               212
## 14      217    72      229   181     226            91    249               170
## 15      209    42      236   171     190           105    249               148
## 16      222   104      231   207     239           133    236               196
## 17      218    87      218   200     203            96    228               183
## 18      216    28      227   200     219            38    249               179
## 19      134    23      165   118     150            36    170                98
## 20      228   164      234   225     249           239    242               233
## 21      232   160      228   212     231           214    247               221
## 22      240    91      235   211     247           152    245               217
## 23      225   133      233   225     225           146    245               196
## 24      206    62      222   186     216            27    234               178
## 25      210   119      234   213     222           148    244               202
## 26      197    13      232   125     174            38    245               118
## 27      222    97      233   212     230            74    254               166
## 28      226   132      230   219     230            49    242               216
## 29      221   101      224   190     239           159    240               192
## 30      238   211      233   224     242           234    230               226
## 31      236    62      222   178     218           161    240               193
## 32      222   102      226   209     230           144    261               210
## 33      210   150      223   205     233           167    243               216
## 34      206    19      223   173     193            20    246               152
## 35      245   117      226   215     246           205    234               221
## 36      213    97      224   202     222            98    238               203
## 37      225    62      230   180     223            96    244               169
## 38      230   161      228   203     235           182    240               228
## 39      225   162      243   217     238           179    239               206
## 40      201    77      231   216     222            78    244               229
## 41      153    13      215    72     164            29    230               128
## 42      223   113      238   198     232           152    253               218
## 43      234   166      227   223     234           207    246               226
## 44      227   127      226   203     216           175    229               230
## 45      194    32      219   111     209            35    239               118
## 46      229   166      234   204     223           219    268               228
## 47      227   126      237   193     231           178    262               198
## 48      214    22      222    75     209            37    236               179
## 49      225    94      238   215     238           142    245               192
## 50      152    14      198   123     160            31    228                93
##    chiropractor physicalTherapist esthetician medicalSpaEsthetician
## 1            42               215          88                    29
## 2            36                87          28                    10
## 3           155               231         211                   170
## 4            27               179          47                    40
## 5           205               215         219                    72
## 6           197               215         186                   159
## 7           126               234         195                    44
## 8           115               193         144                    32
## 9           192               225         184                   124
## 10           89               208          74                    71
## 11           31               174          68                    33
## 12          129               217          72                    36
## 13          214               212         221                   143
## 14           87               153          94                    52
## 15           76               125          42                    22
## 16           51               212         164                   118
## 17           77               201          62                    25
## 18           32               200         118                    12
## 19           36                75          57                    41
## 20          210               247         200                   169
## 21          108               222         199                    74
## 22          207               220         147                   112
## 23          175               205         171                   129
## 24           19               190         195                    36
## 25          118               222         170                    83
## 26           25               111           8                    41
## 27           39               150          57                    30
## 28          126               207         184                   115
## 29           60               187         153                    52
## 30          226               254         247                   183
## 31           31               179          52                    41
## 32           44               219         202                    79
## 33          156               219         195                    70
## 34           18                75          22                    10
## 35          151               212         201                    40
## 36           91               231         117                    81
## 37          147               203          91                    69
## 38          175               197         181                    62
## 39           62               202         191                    39
## 40           61               216         187                    84
## 41           12               108          18                    22
## 42          114               203         188                   119
## 43          192               222         225                   191
## 44          140               166         204                    76
## 45           42               121          12                    22
## 46          107               198         206                   150
## 47          160               171         179                   112
## 48           15                89          21                    11
## 49          104               164         112                    41
## 50           14               104          32                    10
##    medicalDoctor yogaInstructor pilatesInstructor
## 1            235             27                31
## 2            203              4                NA
## 3            232            152               111
## 4            204             20                 9
## 5            233            209               198
## 6            237            155               157
## 7            234            151               159
## 8            223             72                42
## 9            234            173               116
## 10           217             84                74
## 11           205             48                28
## 12           203            110                81
## 13           226            179               168
## 14           218             57                56
## 15           238             21                17
## 16           231            134               102
## 17           223             26                18
## 18           220             42                14
## 19           141             16                13
## 20           234            197               174
## 21           230            132               122
## 22           231            138                82
## 23           228            129               122
## 24           221             36                17
## 25           232            124                72
## 26           219              8                 8
## 27           217            120                62
## 28           226             47                16
## 29           225             55                55
## 30           231            196               168
## 31           220            102                72
## 32           230             89                82
## 33           227            118               122
## 34           204             13                 4
## 35           236            137               133
## 36           228            131               113
## 37           206             81                63
## 38           228            121               108
## 39           240            140                67
## 40           222             97                67
## 41           192             14                 4
## 42           223             71                23
## 43           223            171               189
## 44           222             70                52
## 45           201             30                 8
## 46           225             77               112
## 47           234            148               113
## 48           206             12                 8
## 49           232             40                42
## 50           187              8                 8
colnames(avgSalaryAll) <- gsub('_.*$','',colnames(avgSalaryAll))
colnames(avgSalaryAll) <- gsub(' .*$','',colnames(avgSalaryAll))
avgSalaryAll
##             state      LMT  cashier   server personalTrainer houseCleaner
## 1         Alabama 37500.00 22234.97 35244.18        62813.49     19339.41
## 2          Alaska 80000.00 26479.10 21368.72              NA     24960.00
## 3         Arizona 69846.70 27653.46 33087.06        47196.19     35871.79
## 4        Arkansas 42500.00 21463.68 27535.24        45182.22     28741.82
## 5      California 66450.98 34324.58 43944.64        65728.00     42592.81
## 6        Colorado 43500.00 30101.13 43066.95        57629.80     36946.36
## 7     Connecticut 45000.00 27991.80 41940.28        95236.40     33449.92
## 8        Delaware 41600.00 25323.74 28323.18        97255.07     29112.68
## 9         Florida 59075.88 22366.93 45017.14        64169.98     34630.93
## 10        Georgia 42500.00 21320.00 28979.60        52756.36     35044.65
## 11         Hawaii 97500.00 29869.41 38220.00              NA     29428.15
## 12          Idaho       NA 21408.40 35412.99        44720.00     32240.00
## 13       Illinois 57920.35 26514.12 37863.32        89440.00     38960.00
## 14        Indiana 73166.67 22408.06 32583.75        70325.52     31200.00
## 15           Iowa 42068.42 23029.62 28476.44        51365.85     26166.79
## 16         Kansas 47486.36 23102.16 46028.93        28905.35     31407.38
## 17       Kentucky 81500.00 22735.42 32986.67        46800.00     29640.00
## 18      Louisiana 97500.00 21135.20 23562.72        45987.13     28647.27
## 19          Maine       NA 28080.00 37177.82              NA     32916.46
## 20       Maryland 54739.08 28761.72 33761.06        84028.82     39436.43
## 21  Massachusetts 54198.10 34065.88 35587.35        72473.43     35624.38
## 22       Michigan 55641.35 26448.28 41582.37        66298.02     31009.89
## 23      Minnesota 66724.96 26936.00 30767.54        78612.20     32344.00
## 24    Mississippi 47727.95 20831.86 21008.79        49235.12     23450.73
## 25       Missouri 45416.15 23143.16 30728.11        31511.29     30996.79
## 26        Montana       NA 24141.10 22544.34              NA     27240.00
## 27       Nebraska 48386.79 23098.67 48884.54        59158.90     24328.31
## 28         Nevada 76647.83 29980.00 32031.52        92537.75     38227.88
## 29  New Hampshire 49199.64 24427.49 24960.00        62314.75     33961.55
## 30     New Jersey 68595.34 25517.66 35680.67       114184.98     42640.00
## 31     New Mexico 42542.50 23857.83 26260.00        51755.29     29120.00
## 32       New York 60724.49 31458.76 32838.85        56368.00     37321.14
## 33 North Carolina 71884.24 23075.30 29014.63        59387.80     30968.89
## 34   North Dakota 45569.00 24442.46 28785.53              NA     26834.93
## 35           Ohio 50376.85 24798.27 51355.15        61091.96     31189.95
## 36       Oklahoma 42470.80 22207.20 29645.59        40792.34     27108.42
## 37         Oregon 97500.00 29766.41 30509.89        62907.32     37706.50
## 38   Pennsylvania 41992.19 23677.67 27428.86        76757.91     40258.06
## 39   Rhode Island 44686.03 29640.00 46918.60        46800.00     36400.00
## 40 South Carolina       NA 23589.86 32468.35        87269.57     28477.65
## 41   South Dakota       NA 22272.22 21384.17        26000.00     26585.00
## 42      Tennessee 55739.94 31225.51 26834.86        42701.58     31194.58
## 43          Texas 55427.35 26865.89 33006.38        82186.13     37338.54
## 44           Utah 42634.82 26143.35 34814.00        70671.85     34795.58
## 45        Vermont       NA 25827.59 30768.78        42640.00     27040.00
## 46       Virginia 78988.50 22816.56 29380.00        48507.07     29611.68
## 47     Washington 77003.42 30880.72 37009.22       109567.52     36382.47
## 48  West Virginia       NA 20715.28 29107.38        32240.00     27040.00
## 49      Wisconsin 42375.30 22978.19 29460.81        59154.61     30119.48
## 50        Wyoming       NA 24730.72 23083.62              NA     35880.00
##    warehouse security    nanny clerical     tutor  teacher dataScientist
## 1   28153.61 22975.66 28129.52 28439.10  37794.74 52559.76      131461.6
## 2   45871.07 35064.00 26678.26 42781.07  42588.00 64408.54      126078.1
## 3   40661.79 39687.53 36400.00 40678.63  57608.22 42322.79      103422.7
## 4   32428.38 23030.25 27245.43 30585.14  25628.57 44115.93      124034.1
## 5   47334.89 41414.16 52888.44 51181.31  87743.41 52693.01      120606.1
## 6   35222.80 38807.82 37327.39 45192.67  52005.02 51821.86      125833.5
## 7   35163.61 35719.10 57200.00 45909.53  95218.63 62185.10      116314.8
## 8   33811.91 29007.57 35141.05 59453.33  45120.45 56105.37      123509.3
## 9   35004.26 35653.39 40427.75 37049.43  54956.06 48095.28      125201.1
## 10  34429.66 40980.73 32410.00 38934.95  33273.66 61490.47      120000.0
## 11  38074.45 38973.52 26000.00 40298.19  45635.20 51117.77      115069.3
## 12  31968.98 23744.41 46280.00 31896.43  41600.00 51480.38      135000.0
## 13  38583.14 33804.48 46560.00 38534.74  47413.69 49464.88      114525.7
## 14  34433.82 27888.29 31358.89 32486.88  36853.92 50319.77      122267.6
## 15  37310.99 34269.19 31026.67 34320.00  47821.43 41605.92      135000.0
## 16  36910.85 36594.46 28660.00 36298.79  38427.25 54960.91      112330.0
## 17  36269.35 31124.81 31827.59 31617.05  39741.28 51644.82      101754.6
## 18  32305.00 30719.58 27040.00 31306.52  46477.60 46072.04      135383.5
## 19  37127.27 30703.28 31200.00 41958.01  49285.42 57117.97      135000.0
## 20  35755.37 38652.69 41955.12 57200.00  76162.67 65715.16      117309.5
## 21  43690.27 34637.16 44687.50 46083.86  80820.75 49906.98      129275.7
## 22  40228.13 40583.92 31200.00 37673.00  36570.05 53481.01      135000.0
## 23  35443.69 33533.67 40966.62 43822.83  55640.00 49212.10      135000.0
## 24  30579.92 23935.15 23685.16 32682.70  35343.23 60215.15      135000.0
## 25  33875.34 32248.72 31060.17 39220.67  56335.77 51356.47      108927.1
## 26  36888.80 29744.32 24000.00 39809.05        NA 53775.14      135000.0
## 27  34273.02 39796.40 33344.33 37038.28  52215.17 41000.00      135000.0
## 28  37316.84 33270.80 28261.21 38507.04  41013.52 53799.85      135000.0
## 29  29796.00 42080.00 36080.79 41604.64  48551.58 57289.16      125691.8
## 30  35093.22 38943.19 52000.00 67796.39 122873.21 62929.87      167227.6
## 31  34984.30 33343.90 26637.42 30947.03  41600.00 66487.53      122872.7
## 32  37008.76 34943.39 44293.80 69956.11  89904.77 46233.16      143371.1
## 33  38296.07 36320.76 42057.60 35052.85  41288.00 38264.15      103970.1
## 34  37521.42 31947.18 18720.00 38596.59  44720.00 59007.25      135000.0
## 35  38278.78 27846.53 35955.56 35363.68  41232.37 37946.95      124467.2
## 36  35039.11 38328.64 28112.16 30100.80  60754.53 38251.50      135000.0
## 37  38391.16 38158.15 42405.16 41226.23  36365.64 58435.04      135000.0
## 38  37319.86 36874.78 34475.03 36151.86  52350.94 39561.37      100740.7
## 39  37028.44 36920.00 38480.00 42156.98  47164.24 47774.16      135000.0
## 40  33454.06 29477.01 28296.10 35945.28  41243.70 46776.50      126012.6
## 41  34962.91 36754.01 26000.00 28527.68        NA 59311.67      135000.0
## 42  32322.16 29266.91 31384.07 33240.50  39892.93 49833.55      128660.7
## 43  32973.57 39028.31 34564.34 39497.09  47205.74 48638.03      128494.0
## 44  35431.65 37554.54 31814.17 39068.15  40511.33 41766.20      114840.0
## 45  37105.24 35033.53 32240.00 32193.70  33280.00 55244.64      135000.0
## 46  37185.68 34036.25 34320.00 32138.89  41630.59 28475.95      117500.0
## 47  44994.77 40159.67 50266.67 48450.05  54775.13 62904.69      154694.3
## 48  31166.84 23534.86 22927.27 60161.89        NA 55596.89      135000.0
## 49  59395.56 31338.67 33589.79 43177.48  38320.37 50731.25      131449.9
## 50  33327.69 39360.00       NA 29443.77  21668.90 63735.50      126396.4
##       nurses personalAssistant chiropractor physicalTherapist esthetician
## 1   94567.88          51537.01     93340.00          85666.05    55521.82
## 2   98421.42          88788.57           NA                NA    46800.00
## 3   93065.11          64438.57     48474.33          76497.09    60413.65
## 4   89259.51          62182.59     27040.00         106080.00    31200.00
## 5  115737.33          99507.74     61537.56         121261.39   133970.05
## 6   82143.21          75734.44     83442.84         125424.00    75623.66
## 7   90638.61          77819.00    110668.24          77437.84    68720.00
## 8  140545.64          83724.20     74635.83         100629.01    72672.00
## 9   80583.89         100297.56     45554.17         126500.98    94673.91
## 10  83417.04          74218.64     62937.53                NA    70749.71
## 11  82937.05          66274.58     67600.00          95680.00    73840.00
## 12  88370.50          61870.50     57200.00                NA    33280.00
## 13  85820.50          62505.59     48287.10         112815.47    65351.76
## 14  89407.29          55191.18     52000.00          81120.00    60332.24
## 15  75335.96          62516.89     38907.40                NA    39520.00
## 16  79476.97          64977.80     35360.00          78145.45    42120.00
## 17  83420.50          66253.62     37568.00          99467.46    49140.00
## 18 105411.54          77304.08     31662.22          93050.88    36336.97
## 19  79549.30          32500.00     70720.00          82160.00    43680.00
## 20 104918.31          69145.70     43878.10          64458.95    65343.20
## 21  76566.18          65796.38     44026.67         134450.45    66607.04
## 22  76339.48          63472.25    112301.91          88400.00    63492.75
## 23  98586.40          59915.82     56647.31         114400.00   160956.73
## 24 103941.82          63156.28           NA                NA    36426.67
## 25  87616.28          53045.50    179668.81          83320.86    62452.00
## 26  68534.66          57542.37     41221.82          81120.00    18720.00
## 27  83436.77          54360.67     31200.00          91520.00    37440.00
## 28 100866.98          61182.82     91520.00         121383.57    82131.74
## 29  94381.00          77572.92     29120.00          86240.61    30928.00
## 30 108746.99          82842.92     74880.00         103959.06   165229.47
## 31  70031.68          91370.36           NA          92077.77    31200.00
## 32  80865.08          77129.17     49582.00         106692.60   110003.17
## 33  76354.40          50298.27     51746.67          94120.00    91456.00
## 34 103032.32          55930.92           NA         101920.00    38480.00
## 35  87126.47          51427.47     54114.44          73825.56    45149.45
## 36  73000.87          55123.52     41782.86          93604.50   101920.00
## 37  84483.06          50425.16     67600.00         102960.00   175568.74
## 38  77206.35          53925.44     61544.23          92499.45    59710.94
## 39  58456.72          92715.58     39318.71          63120.79    89440.00
## 40  74507.46          78620.94     83200.00          40145.93    51132.41
## 41  64326.19          65721.59           NA          91520.00          NA
## 42  98727.22          61158.14     33444.75                NA    41843.40
## 43  89414.57          59751.68     68932.50          95239.64    72716.80
## 44  96266.97          62217.39     53225.71                NA    58209.41
## 45 139476.99          83750.00     31200.00                NA          NA
## 46  91389.80          83700.97     50960.00                NA    69680.00
## 47  95335.03          89489.96    105846.00         101662.78    85041.79
## 48  52875.47          52607.75           NA                NA    33280.00
## 49  74300.82          67664.93     94840.00          93600.00    59669.61
## 50  96064.66          40154.50           NA          74680.00    31200.00
##    medicalSpaEsthetician medicalDoctor yogaInstructor pilatesInstructor
## 1               53936.55     230392.43      101513.04         130000.00
## 2               65520.00     250002.48             NA                NA
## 3               54918.12     108732.73      119497.37         116480.00
## 4               65520.00     211226.50      114400.00         130000.00
## 5               57070.00      90671.67      119600.00         119368.89
## 6               54580.38     114840.22      119620.13         124231.78
## 7               59847.27      88064.28      119379.60         124427.17
## 8               65520.00     166414.43      121741.18         130000.00
## 9               56109.68     100301.62      125551.45         125454.48
## 10              50330.14     177901.84       99455.20         116480.00
## 11              65520.00     211766.83      156000.00         156000.00
## 12              65520.00     241453.20      121648.80         121648.80
## 13              52065.45      61615.04       70801.34          81250.00
## 14              58480.00     187377.72      110750.88         119600.00
## 15              65520.00     189517.56      130000.00         110619.29
## 16              65520.00      98080.81      127252.54         130000.00
## 17              57408.00     164865.82      107380.00         130000.00
## 18              65520.00     278183.12      120640.00         130000.00
## 19              56134.63     261418.44      130000.00         130000.00
## 20              56683.08     135313.00      117461.93         114400.00
## 21              55429.19      86574.45      124788.18         126338.78
## 22              56884.29     175915.58      130000.00         120183.41
## 23              52923.10      77048.49      119600.00          95304.92
## 24              65520.00     185730.77       53733.33          85800.00
## 25              65520.00     127364.36      123029.42         125233.33
## 26              52596.10     106050.23      130000.00         130000.00
## 27              56368.00     168907.38      107882.67         130000.00
## 28              53238.96     196847.35      130000.00         130000.00
## 29              65520.00     126054.35      130000.00         128298.18
## 30              56160.00     121250.87      146640.00         115440.00
## 31              54917.07     165227.27      130000.00         130000.00
## 32              48234.94     163185.20      137136.00         120625.75
## 33              54452.62     139693.85      120776.84         125928.14
## 34              65520.00     158103.12      119600.00         130000.00
## 35              53386.67     144104.49      115204.67         104625.56
## 36              61822.22     122863.73      126257.94         108574.16
## 37              57049.28     209603.73      130000.00         130000.00
## 38              55002.58      80897.72       89998.68          79714.07
## 39              53040.00     142581.00      124800.00         124800.00
## 40              53485.71     192733.66      107302.27         130000.00
## 41              65520.00     234702.90      130000.00         130000.00
## 42              54918.99     170108.78       78200.00         130000.00
## 43              58686.49     150276.48      113706.67         117921.69
## 44              57268.42     149630.63      123760.00         123760.00
## 45              65520.00     248134.33      130000.00         130000.00
## 46              54385.07     215669.32      130000.00         130000.00
## 47              55895.36     152145.04      114512.43         119213.91
## 48              65520.00     213932.41      130000.00         130000.00
## 49              52012.68     233949.70      118791.11         119381.05
## 50              65520.00     193219.12      130000.00         130000.00

Lets take a look at the health and wellness number of jobs available by using the listedJobsAll columns for LMT, personalTrainer, chiropractor, physicalTherapist, esthetician, and medicalSpaEsthetician.

wellnessJobs <- listedJobsAll[,c(1,2,5,16,17,21,22)]
wellnessSalary <- avgSalaryAll[,c(1,2,5,16,17,21,22)]
wellnessJobs
##             state LMT personalTrainer chiropractor physicalTherapist
## 1         Alabama  88              92           42               215
## 2          Alaska  39              47           36                87
## 3         Arizona 212             168          155               231
## 4        Arkansas  73              72           27               179
## 5      California 223             190          205               215
## 6        Colorado 241             196          197               215
## 7     Connecticut 203             211          126               234
## 8        Delaware 159             157          115               193
## 9         Florida 222             200          192               225
## 10        Georgia 105             103           89               208
## 11         Hawaii  99              38           31               174
## 12          Idaho 203              87          129               217
## 13       Illinois 226             206          214               212
## 14        Indiana 109              96           87               153
## 15           Iowa 152              82           76               125
## 16         Kansas 179             172           51               212
## 17       Kentucky 123              67           77               201
## 18      Louisiana 110              87           32               200
## 19          Maine  73              28           36                75
## 20       Maryland 237             229          210               247
## 21  Massachusetts 229             207          108               222
## 22       Michigan 237             175          207               220
## 23      Minnesota 187             150          175               205
## 24    Mississippi  93              82           19               190
## 25       Missouri 190             147          118               222
## 26        Montana  46              18           25               111
## 27       Nebraska 169             146           39               150
## 28         Nevada 230             187          126               207
## 29  New Hampshire 139             183           60               187
## 30     New Jersey 236             237          226               254
## 31     New Mexico 162             102           31               179
## 32       New York 196             135           44               219
## 33 North Carolina 203             164          156               219
## 34   North Dakota  46              27           18                75
## 35           Ohio 235             194          151               212
## 36       Oklahoma 192             133           91               231
## 37         Oregon 171             123          147               203
## 38   Pennsylvania 227             211          175               197
## 39   Rhode Island 215             192           62               202
## 40 South Carolina 176             184           61               216
## 41   South Dakota  56              33           12               108
## 42      Tennessee 174             152          114               203
## 43          Texas 234             199          192               222
## 44           Utah 224             162          140               166
## 45        Vermont  70               4           42               121
## 46       Virginia 177             198          107               198
## 47     Washington 218             133          160               171
## 48  West Virginia  61              52           15                89
## 49      Wisconsin 166             141          104               164
## 50        Wyoming  35              17           14               104
##    yogaInstructor pilatesInstructor
## 1              27                31
## 2               4                NA
## 3             152               111
## 4              20                 9
## 5             209               198
## 6             155               157
## 7             151               159
## 8              72                42
## 9             173               116
## 10             84                74
## 11             48                28
## 12            110                81
## 13            179               168
## 14             57                56
## 15             21                17
## 16            134               102
## 17             26                18
## 18             42                14
## 19             16                13
## 20            197               174
## 21            132               122
## 22            138                82
## 23            129               122
## 24             36                17
## 25            124                72
## 26              8                 8
## 27            120                62
## 28             47                16
## 29             55                55
## 30            196               168
## 31            102                72
## 32             89                82
## 33            118               122
## 34             13                 4
## 35            137               133
## 36            131               113
## 37             81                63
## 38            121               108
## 39            140                67
## 40             97                67
## 41             14                 4
## 42             71                23
## 43            171               189
## 44             70                52
## 45             30                 8
## 46             77               112
## 47            148               113
## 48             12                 8
## 49             40                42
## 50              8                 8

Now look at the LMT with esthetician and medical spa esthetician jobs available.Nurses are needed in medical spas that are also estheticians, so we will add that class of jobs listed to our spaJobs data table.

spaJobs <- listedJobsAll[,c(1,2,14,18,19)]
spaSalary <- avgSalaryAll[,c(1,2,14,18,19)]
spaJobs
##             state LMT nurses esthetician medicalSpaEsthetician
## 1         Alabama  88    238          88                    29
## 2          Alaska  39    231          28                    10
## 3         Arizona 212    248         211                   170
## 4        Arkansas  73    260          47                    40
## 5      California 223    234         219                    72
## 6        Colorado 241    254         186                   159
## 7     Connecticut 203    233         195                    44
## 8        Delaware 159    241         144                    32
## 9         Florida 222    245         184                   124
## 10        Georgia 105    235          74                    71
## 11         Hawaii  99    234          68                    33
## 12          Idaho 203    247          72                    36
## 13       Illinois 226    259         221                   143
## 14        Indiana 109    249          94                    52
## 15           Iowa 152    249          42                    22
## 16         Kansas 179    236         164                   118
## 17       Kentucky 123    228          62                    25
## 18      Louisiana 110    249         118                    12
## 19          Maine  73    170          57                    41
## 20       Maryland 237    242         200                   169
## 21  Massachusetts 229    247         199                    74
## 22       Michigan 237    245         147                   112
## 23      Minnesota 187    245         171                   129
## 24    Mississippi  93    234         195                    36
## 25       Missouri 190    244         170                    83
## 26        Montana  46    245           8                    41
## 27       Nebraska 169    254          57                    30
## 28         Nevada 230    242         184                   115
## 29  New Hampshire 139    240         153                    52
## 30     New Jersey 236    230         247                   183
## 31     New Mexico 162    240          52                    41
## 32       New York 196    261         202                    79
## 33 North Carolina 203    243         195                    70
## 34   North Dakota  46    246          22                    10
## 35           Ohio 235    234         201                    40
## 36       Oklahoma 192    238         117                    81
## 37         Oregon 171    244          91                    69
## 38   Pennsylvania 227    240         181                    62
## 39   Rhode Island 215    239         191                    39
## 40 South Carolina 176    244         187                    84
## 41   South Dakota  56    230          18                    22
## 42      Tennessee 174    253         188                   119
## 43          Texas 234    246         225                   191
## 44           Utah 224    229         204                    76
## 45        Vermont  70    239          12                    22
## 46       Virginia 177    268         206                   150
## 47     Washington 218    262         179                   112
## 48  West Virginia  61    236          21                    11
## 49      Wisconsin 166    245         112                    41
## 50        Wyoming  35    228          32                    10

Lets used our list of demanded LMT states where there weren’t as many jobs available for LMT, but the pay was higher for LMT than the national LMT average pay.

demanded
## [1] Georgia     Indiana     Mississippi Wyoming    
## 50 Levels: Alabama Alaska Arizona Arkansas California Colorado ... Wyoming

Lets look at Georgia and see how the jobs available in the wellness and the spa industries compare by plotting the wellness jobs available in GA, then the salary of those jobs in GA against the median income for GA and the median two bedroom home value.

GA <- subset(slr2, slr2=='Georgia')
GA_2BR <- GA$Zillow_2BR_3cityAverageHomeValue
GA_medIncome <- GA$median2018IncomeByState

GA_wellness <- subset(wellnessJobs, wellnessJobs$state=='Georgia')
GA_wellnessSalary <- subset(wellnessSalary,wellnessSalary$state=='Georgia')

GA_wellness2 <- gather(GA_wellness, key='jobTitle',value='jobsListed',2:7)
GA_wellnessSalary2 <- gather(GA_wellnessSalary, key='jobTitle', value='annualSalary',2:7)
ggplot(data = GA_wellness2, aes(y=GA_wellness2$jobsListed, x=GA_wellness2$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('GA Wellness Jobs Available')+
  ylab(NULL)+
  xlab(NULL)

ggplot(data = GA_wellnessSalary2, aes(y=GA_wellnessSalary2$annualSalary, x=GA_wellnessSalary2$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge(),na.rm=TRUE)+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  geom_hline(yintercept=GA_medIncome, linetype="dashed", color = "red")+
  geom_hline(yintercept=GA_2BR, linetype='dashed',color='blue')+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('GA Wellness Jobs Annual Salary')+
  ylab(NULL)+
  xlab(NULL)

The blue line is the May 2020 Zillow average home value for the top 3 populated cities in GA for a two bedroom home, and the red line is the 2018 median income in GA, according to the data.census.gov data. There wasn’t any salary data for physical therapists in GA, so it doesn’t have a bar for salary information. But chiropractors’ annual salary is above the GA 2018 median income and the average 2020 two bedroom home value. Also, personal trainers make more than LMTs and have slightly less personal training jobs available than LMTs, but both have pay below the median income of GA. The available jobs for chiropractors, LMTs, and personal trainers is roughly the same in GA, while the demand for physical therapists is high with more than twice as many jobs available for physical therapists as any one other wellness category jobs available.Pilates and Yoga Instuctors get paid more annually than chiropractors, LMTs, or personal trainers. But their salary was approximated as full time at the average hourly rate. Many yoga and Pilates intructors might only work 20-32 hours a week. But then again, a great yoga or pilates instructor brings in clients who pay an average of $20 per class three times a week, with bargains on Groupon. Many physical therapists prescribe or recommend yoga and pilates to athletes or trauma patients with tendon injuries who need structural re-alignment.

Now, lets look at the chart of the medical spas jobs available and annual salary in GA with the same home value and median income values for GA used in the wellness jobs above.

GA_spa <- subset(spaJobs, spaJobs$state=='Georgia')
GA_spaSalary <- subset(spaSalary,spaSalary$state=='Georgia')

GA_spa2 <- gather(GA_spa, key='jobTitle',value='jobsListed',2:5)
GA_spaSalary2 <- gather(GA_spaSalary, key='jobTitle', value='annualSalary',2:5)
ggplot(data = GA_spa2, aes(y=GA_spa2$jobsListed, x=GA_spa2$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('GA Spa and Medical Spa Jobs Available')+
  ylab(NULL)+
  xlab(NULL)

ggplot(data = GA_spaSalary2, aes(y=GA_spaSalary2$annualSalary, 
                                 x=GA_spaSalary2$jobTitle)) +
  geom_bar(stat='identity', position=position_dodge())+
  scale_fill_brewer(palette='Paired') +
  theme_classic()+
  geom_hline(yintercept=GA_medIncome, linetype="dashed", color = "red")+
  geom_hline(yintercept=GA_2BR, linetype='dashed',color='blue')+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('GA Spa and Medical Spa Jobs Annual Salary')+
  ylab(NULL)+
  xlab(NULL)

The blue line above is the same two bedroom Zillow average home value for GA and the red line is the 2018 median income for GA from data.census.gov data. The above medical spa information for GA, shows that medical spa estheticians don’t make as much annually as estheticians or nurses. And that estheticians make more than nurses in GA. A medical spa esthetician is supposed to be an esthetician and a nurse to be able to give botox injections. But there could be some differences in state to state requirements and regulations for estheticians. Estheticians call it ‘lancing’ when they can drain a white head with a needle. Logically, on the surface the above doesn’t make sense, but it is possible that estheticians do make 150,000 USD a year. It is not unlikely that nurse make close to 100,000 USD a year either. The demand of nurses in GA is more than double that of the other medical spa jobs available and nearly triple it at around 250 available nursing jobs in GA’s top three populated cities.


There is now a script that did similar to what the indeed function did but for yellowpages.com. This script takes the first five webpages of yellowpages.com for the business searched in the city and state and returns a table of the number of businesses of that type in the same three top populated cities per state used in this program. The script is called ‘yellowPages-number-of-businesses.Rmd’ and it was used to get the number of businesses in those three cities per state for coffee, massage, gym, tanning, hair salon, tanning, yoga, chiropractic, wellness, and health food businesses. Lets add these counts to our table slr2 of all features used so far.

ypChiro <- read.csv('./number of businesses/statesRates- chiropractor .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypWellness <- read.csv('./number of businesses/statesRates- wellness clinic .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypMassage <- read.csv('./number of businesses/statesRates- massage spa .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypYoga <- read.csv('./number of businesses/statesRates- yoga .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypGym <- read.csv('./number of businesses/statesRates- gym .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypCoffee <- read.csv('./number of businesses/statesRates- coffee .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypHealthFood <- read.csv('./number of businesses/statesRates- health food .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypHairSalon <- read.csv('./number of businesses/statesRates- hair salon .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypTanning <- read.csv('./number of businesses/statesRates- tanning .csv',
                    sep=',', header=TRUE, na.strings=c('',' ','NA'))
ypChiro$states <- states
ypWellness$states <- states
ypMassage$states <- states
ypYoga$states <- states
ypGym$states <- states
ypCoffee$states <- states
ypHealthFood$states <- states
ypHairSalon$states <- states
ypTanning$states <- states
ypChiro <- ypChiro[,-1]
ypWellness <- ypWellness[,-1]
ypMassage <- ypMassage[,-1]
ypYoga <- ypYoga[,-1]
ypGym <- ypGym[,-1]
ypCoffee <- ypCoffee[,-1]
ypHealthFood <- ypHealthFood[,-1]
ypHairSalon <- ypHairSalon[,-1]
ypTanning <- ypTanning[,-1]
slr3 <- merge(slr2,ypChiro, by.x='state', by.y='states')
slr3 <- merge(slr3,ypWellness,by.x='state', by.y='states')
slr3 <- merge(slr3,ypMassage,by.x='state', by.y='states')
slr3 <- merge(slr3,ypYoga,by.x='state', by.y='states')
slr3 <- merge(slr3,ypGym,by.x='state', by.y='states')
slr3 <- merge(slr3,ypCoffee,by.x='state', by.y='states')
slr3 <- merge(slr3,ypHealthFood,by.x='state', by.y='states')
slr3 <- merge(slr3,ypHairSalon,by.x='state', by.y='states')
slr3 <- merge(slr3,ypTanning,by.x='state', by.y='states')
colnames(slr3)
##   [1] "state"                                 
##   [2] "massageBoard"                          
##   [3] "licenseByReciprocity"                  
##   [4] "proofOtherOrAllStateLicense"           
##   [5] "stateResidencyProof"                   
##   [6] "passportSizePhoto"                     
##   [7] "driversLicensePhotoCopy"               
##   [8] "nameChangeProof"                       
##   [9] "socialSecurityCopy"                    
##  [10] "Hours"                                 
##  [11] "MBLEX_or_NCBTMB"                       
##  [12] "goodHealthClearance"                   
##  [13] "BoardBackgroundCheckFee"               
##  [14] "stateApplyingBackgroundCheck"          
##  [15] "DOJ_backgroundCheck"                   
##  [16] "applicationCost"                       
##  [17] "licensingCost"                         
##  [18] "licenseRenewalFee"                     
##  [19] "CPR_certification"                     
##  [20] "licensingETA"                          
##  [21] "healthReferences"                      
##  [22] "CEU"                                   
##  [23] "timeLicenseValidYears"                 
##  [24] "liabilityInsurance"                    
##  [25] "schoolTranscripts"                     
##  [26] "MBLEX_transcript"                      
##  [27] "notes"                                 
##  [28] "notes2"                                
##  [29] "notes3"                                
##  [30] "notes4"                                
##  [31] "citiesGreaterThan300k_orTop3"          
##  [32] "LMT_AvgJobsListed_IndeedFirst5pages"   
##  [33] "LMT_HourlyAvgPayRangeAdvertised_Indeed"
##  [34] "LMT_AnualAvgPayAdvertised_Indeed"      
##  [35] "Zillow_2BR_3cityAverageHomeValue"      
##  [36] "median2018IncomeByState"               
##  [37] "total_state_population"                
##  [38] "percent_black"                         
##  [39] "percent_white"                         
##  [40] "percent_two_or_more"                   
##  [41] "percent_Native_American"               
##  [42] "percent_Asian"                         
##  [43] "percent_Pacific_Islander"              
##  [44] "percent_Latino"                        
##  [45] "cashier_jobsListed"                    
##  [46] "cashier_avgHourly"                     
##  [47] "cashier_avgAnnualSalary"               
##  [48] "server_jobsListed"                     
##  [49] "server_avgHourly"                      
##  [50] "server_avgAnnualSalary"                
##  [51] "personalTrainer_jobsListed"            
##  [52] "personalTrainer_avgHourly"             
##  [53] "personalTrainer_avgAnnualSalary"       
##  [54] "houseCleaner_jobsListed"               
##  [55] "houseCleaner_avgHourly"                
##  [56] "houseCleaner_avgAnnualSalary"          
##  [57] "warehouse_jobsListed"                  
##  [58] "warehouse_avgHourly"                   
##  [59] "warehouse_avgAnnualSalary"             
##  [60] "security_jobsListed"                   
##  [61] "security_avgHourly"                    
##  [62] "security_avgAnnualSalary"              
##  [63] "nanny_jobsListed"                      
##  [64] "nanny_avgHourly"                       
##  [65] "nanny_avgAnnualSalary"                 
##  [66] "clerical_jobsListed"                   
##  [67] "clerical_avgHourly"                    
##  [68] "clerical_avgAnnualSalary"              
##  [69] "tutor_jobsListed"                      
##  [70] "tutor_avgHourly"                       
##  [71] "tutor_avgAnnualSalary"                 
##  [72] "teacher_jobsListed"                    
##  [73] "teacher_avgHourly"                     
##  [74] "teacher_avgAnualSalary"                
##  [75] "dataScientist_jobsListed"              
##  [76] "dataScientist_avgHourly"               
##  [77] "dataScientist_avgAnualSalary"          
##  [78] "nurses jobsListed"                     
##  [79] "nurses avgHourly"                      
##  [80] "nurses avgAnualSalary"                 
##  [81] "personalAssistant jobsListed"          
##  [82] "personalAssistant avgHourly"           
##  [83] "personalAssistant avgAnualSalary"      
##  [84] "chiropractor jobsListed"               
##  [85] "chiropractor avgHourly"                
##  [86] "chiropractor avgAnualSalary"           
##  [87] "physicalTherapist jobsListed"          
##  [88] "physicalTherapist avgHourly"           
##  [89] "physicalTherapist avgAnualSalary"      
##  [90] "esthetician jobsListed"                
##  [91] "esthetician avgHourly"                 
##  [92] "esthetician avgAnualSalary"            
##  [93] "medicalSpaEsthetician jobsListed"      
##  [94] "medicalSpaEsthetician avgHourly"       
##  [95] "medicalSpaEsthetician avgAnualSalary"  
##  [96] "medicalDoctor jobsListed"              
##  [97] "medicalDoctor avgHourly"               
##  [98] "medicalDoctor avgAnualSalary"          
##  [99] "yogaInstructor jobsListed"             
## [100] "yogaInstructor avgHourly"              
## [101] "yogaInstructor avgAnualSalary"         
## [102] "pilatesInstructor jobsListed"          
## [103] "pilatesInstructor avgHourly"           
## [104] "pilatesInstructor avgAnualSalary"      
## [105] "chiropractor_businessListings"         
## [106] "wellness.clinic_businessListings"      
## [107] "massage.spa_businessListings"          
## [108] "yoga_businessListings"                 
## [109] "gym_businessListings"                  
## [110] "coffee_businessListings"               
## [111] "health.food_businessListings"          
## [112] "hair.salon_businessListings"           
## [113] "tanning_businessListings"
write.csv(slr3, 'stateLicensingDemographicsAddedAndUpdated.csv', row.names=FALSE)

We currently have the price of 2 bedroom homes using Zillow data, but now we can add in apartments.com data for rental apartments of 2-3 bedroom, 2 bathroom, dog/cat friendly pricing to our data set to compare rental prices in the three top populated cities in each state. It didn’t happen by magic either, there is a script for it very similar to the indeed and yellowpages web scraping scripts. Originally, I was going to use rent.com, but wouldn’t you know they have a web scraping blocker in place that makes sure their terms of use aren’t violated for ‘not downloading their data.’ I did download apartments.com data, but only to share the aggregate results. Each individual file is downloaded for the date pulled but not added to githu. The script is ‘aps-com-2BR-2BA.Rmd’ in github with all these other shared files.I was booted from apartments.com due to so many downloads, but used a VPN that allowed me to take the average of the average, minimum, and maximum prices of up to ten cities that are the most populated cities (rather than the top 3 cities) with prices on aparmtnents.com. It will produce this table in csv format, ‘apts_2BR2BA_prices.csv’ to add to our updated and added state licensing requirements csv table of data to compare state by state. This last file was modified to read in the listings if available of the top 10 most populated cities, as was the Zillow home value listings for 10 most populated cities, instead of for the 3 most populated as the original scripts were done.

apt2and2 <- read.csv('./apartments Dot Com/apts_2BR2BA_prices.csv',sep=',',
                     header=TRUE, na.strings=c('',' ','NA'))
head(apt2and2,10)
##    state TwoBedroomApartment_Listings Rent2BR2BA_MinPrice Rent2BR2BA_MaxPrice
## 1     AK                           66            1389.373            1843.812
## 2     AL                          426            1019.231            1412.166
## 3     AR                          251             941.657            1347.389
## 4     AZ                          783            1307.573            1938.583
## 5     CA                          750            2835.572            4201.762
## 6     CO                          575            1698.809            2688.151
## 7     CT                          171            2085.466            3086.279
## 8     DE                          326            1797.702            2964.835
## 9     FL                          774            1582.641            2207.818
## 10    GA                          600            1439.029            2287.278
##    Rent2BR2BA_AvgPrice
## 1             1528.712
## 2             1153.883
## 3             1074.461
## 4             1575.056
## 5             3395.412
## 6             2147.120
## 7             2407.294
## 8             2318.318
## 9             1839.048
## 10            1814.311

The above information takes the price of each listing in those 50 states’ three most populated cities, and gets the minimum, maximum, and average prices of a 2 bedroom, 2 bath dog/cat friendly apartment for rent. The average minimum is the average of all minimum price boundaries of all three cities for each state, and the average maximum is the average of all maximum boundaries of the price range in all three cities of each state, and the average is the average price of all prices listed in each state.

Now lets add these new data columns to our table of 50 states.

colnames(apt2and2)[1] <- 'stateAbbreviation'
colnames(apt2and2)[2:5] <- paste(colnames(apt2and2)[2:5],'_10cities')
apt2and2$stateName <- states
slr4 <- merge(slr3,apt2and2, by.x='state',by.y='stateName')
colnames(slr4)
##   [1] "state"                                 
##   [2] "massageBoard"                          
##   [3] "licenseByReciprocity"                  
##   [4] "proofOtherOrAllStateLicense"           
##   [5] "stateResidencyProof"                   
##   [6] "passportSizePhoto"                     
##   [7] "driversLicensePhotoCopy"               
##   [8] "nameChangeProof"                       
##   [9] "socialSecurityCopy"                    
##  [10] "Hours"                                 
##  [11] "MBLEX_or_NCBTMB"                       
##  [12] "goodHealthClearance"                   
##  [13] "BoardBackgroundCheckFee"               
##  [14] "stateApplyingBackgroundCheck"          
##  [15] "DOJ_backgroundCheck"                   
##  [16] "applicationCost"                       
##  [17] "licensingCost"                         
##  [18] "licenseRenewalFee"                     
##  [19] "CPR_certification"                     
##  [20] "licensingETA"                          
##  [21] "healthReferences"                      
##  [22] "CEU"                                   
##  [23] "timeLicenseValidYears"                 
##  [24] "liabilityInsurance"                    
##  [25] "schoolTranscripts"                     
##  [26] "MBLEX_transcript"                      
##  [27] "notes"                                 
##  [28] "notes2"                                
##  [29] "notes3"                                
##  [30] "notes4"                                
##  [31] "citiesGreaterThan300k_orTop3"          
##  [32] "LMT_AvgJobsListed_IndeedFirst5pages"   
##  [33] "LMT_HourlyAvgPayRangeAdvertised_Indeed"
##  [34] "LMT_AnualAvgPayAdvertised_Indeed"      
##  [35] "Zillow_2BR_3cityAverageHomeValue"      
##  [36] "median2018IncomeByState"               
##  [37] "total_state_population"                
##  [38] "percent_black"                         
##  [39] "percent_white"                         
##  [40] "percent_two_or_more"                   
##  [41] "percent_Native_American"               
##  [42] "percent_Asian"                         
##  [43] "percent_Pacific_Islander"              
##  [44] "percent_Latino"                        
##  [45] "cashier_jobsListed"                    
##  [46] "cashier_avgHourly"                     
##  [47] "cashier_avgAnnualSalary"               
##  [48] "server_jobsListed"                     
##  [49] "server_avgHourly"                      
##  [50] "server_avgAnnualSalary"                
##  [51] "personalTrainer_jobsListed"            
##  [52] "personalTrainer_avgHourly"             
##  [53] "personalTrainer_avgAnnualSalary"       
##  [54] "houseCleaner_jobsListed"               
##  [55] "houseCleaner_avgHourly"                
##  [56] "houseCleaner_avgAnnualSalary"          
##  [57] "warehouse_jobsListed"                  
##  [58] "warehouse_avgHourly"                   
##  [59] "warehouse_avgAnnualSalary"             
##  [60] "security_jobsListed"                   
##  [61] "security_avgHourly"                    
##  [62] "security_avgAnnualSalary"              
##  [63] "nanny_jobsListed"                      
##  [64] "nanny_avgHourly"                       
##  [65] "nanny_avgAnnualSalary"                 
##  [66] "clerical_jobsListed"                   
##  [67] "clerical_avgHourly"                    
##  [68] "clerical_avgAnnualSalary"              
##  [69] "tutor_jobsListed"                      
##  [70] "tutor_avgHourly"                       
##  [71] "tutor_avgAnnualSalary"                 
##  [72] "teacher_jobsListed"                    
##  [73] "teacher_avgHourly"                     
##  [74] "teacher_avgAnualSalary"                
##  [75] "dataScientist_jobsListed"              
##  [76] "dataScientist_avgHourly"               
##  [77] "dataScientist_avgAnualSalary"          
##  [78] "nurses jobsListed"                     
##  [79] "nurses avgHourly"                      
##  [80] "nurses avgAnualSalary"                 
##  [81] "personalAssistant jobsListed"          
##  [82] "personalAssistant avgHourly"           
##  [83] "personalAssistant avgAnualSalary"      
##  [84] "chiropractor jobsListed"               
##  [85] "chiropractor avgHourly"                
##  [86] "chiropractor avgAnualSalary"           
##  [87] "physicalTherapist jobsListed"          
##  [88] "physicalTherapist avgHourly"           
##  [89] "physicalTherapist avgAnualSalary"      
##  [90] "esthetician jobsListed"                
##  [91] "esthetician avgHourly"                 
##  [92] "esthetician avgAnualSalary"            
##  [93] "medicalSpaEsthetician jobsListed"      
##  [94] "medicalSpaEsthetician avgHourly"       
##  [95] "medicalSpaEsthetician avgAnualSalary"  
##  [96] "medicalDoctor jobsListed"              
##  [97] "medicalDoctor avgHourly"               
##  [98] "medicalDoctor avgAnualSalary"          
##  [99] "yogaInstructor jobsListed"             
## [100] "yogaInstructor avgHourly"              
## [101] "yogaInstructor avgAnualSalary"         
## [102] "pilatesInstructor jobsListed"          
## [103] "pilatesInstructor avgHourly"           
## [104] "pilatesInstructor avgAnualSalary"      
## [105] "chiropractor_businessListings"         
## [106] "wellness.clinic_businessListings"      
## [107] "massage.spa_businessListings"          
## [108] "yoga_businessListings"                 
## [109] "gym_businessListings"                  
## [110] "coffee_businessListings"               
## [111] "health.food_businessListings"          
## [112] "hair.salon_businessListings"           
## [113] "tanning_businessListings"              
## [114] "stateAbbreviation"                     
## [115] "TwoBedroomApartment_Listings _10cities"
## [116] "Rent2BR2BA_MinPrice _10cities"         
## [117] "Rent2BR2BA_MaxPrice _10cities"         
## [118] "Rent2BR2BA_AvgPrice _10cities"
slr5 <- slr4[,c(114,1:113,115:118)]
write.csv(slr5,'stateLicensingDemographicsAddedAndUpdated.csv',row.names=FALSE)

Remember to update the stateLicensingRequirements.csv file with the actual massage board licensing requirements of each state, then adding the additional updated and added features with this script, after using those helper script files to update information as needed.


Getting back to the motivation for this project, comparing TN to CA, to satisfy some gamey choices in moving from CA to TN as a massage therapist to make my youngest and greatly adored neice’s life easier and happier, Lets compare TN to CA in demographics, number of data science and massage therapist jobs, annual salary on average for those jobs, and for alternate jobs, how many health food stores, salons, spas, chiropractors, and coffee shops in each state’s top three most populated cities, what the average and average minimum price range for a two bedroom, two bathroom and pet friendly apartment is, the median income from 2018 data for each state, and see how compromisable the effects of moving from CA to TN would be.

Lets first get all the fields used for this comparison.

comparing_TN_CA <- slr5[,c(1,11,12,17,18,19,23,33,35,37:45,55,57,58,60,
                           64,66,67,69,70,72,76,78,82,84,108:118)]
colnames(comparing_TN_CA)
##  [1] "stateAbbreviation"                     
##  [2] "Hours"                                 
##  [3] "MBLEX_or_NCBTMB"                       
##  [4] "applicationCost"                       
##  [5] "licensingCost"                         
##  [6] "licenseRenewalFee"                     
##  [7] "CEU"                                   
##  [8] "LMT_AvgJobsListed_IndeedFirst5pages"   
##  [9] "LMT_AnualAvgPayAdvertised_Indeed"      
## [10] "median2018IncomeByState"               
## [11] "total_state_population"                
## [12] "percent_black"                         
## [13] "percent_white"                         
## [14] "percent_two_or_more"                   
## [15] "percent_Native_American"               
## [16] "percent_Asian"                         
## [17] "percent_Pacific_Islander"              
## [18] "percent_Latino"                        
## [19] "houseCleaner_jobsListed"               
## [20] "houseCleaner_avgAnnualSalary"          
## [21] "warehouse_jobsListed"                  
## [22] "warehouse_avgAnnualSalary"             
## [23] "nanny_jobsListed"                      
## [24] "nanny_avgAnnualSalary"                 
## [25] "clerical_jobsListed"                   
## [26] "clerical_avgAnnualSalary"              
## [27] "tutor_jobsListed"                      
## [28] "tutor_avgAnnualSalary"                 
## [29] "dataScientist_jobsListed"              
## [30] "dataScientist_avgAnualSalary"          
## [31] "personalAssistant jobsListed"          
## [32] "personalAssistant avgAnualSalary"      
## [33] "massage.spa_businessListings"          
## [34] "yoga_businessListings"                 
## [35] "gym_businessListings"                  
## [36] "coffee_businessListings"               
## [37] "health.food_businessListings"          
## [38] "hair.salon_businessListings"           
## [39] "tanning_businessListings"              
## [40] "TwoBedroomApartment_Listings _10cities"
## [41] "Rent2BR2BA_MinPrice _10cities"         
## [42] "Rent2BR2BA_MaxPrice _10cities"         
## [43] "Rent2BR2BA_AvgPrice _10cities"

Lets compare demographics of each state by the states’ three most populated cities. This is important as it skews necessary information if the cities most populated aren’t near the place planning to live. For CA, the cities were San Diego, Los Angeles, and San Jose. The distance between San Diego and Los Angeles is about 120 miles, and from San Jose to Los Angeles it is more than 400 miles. San Jose is also a popularly expensive high rent city due to silicon valley. For TN, the cities most populated are Nashville, Memphis, and knoxville. The idea is that the pricing will be similar as an average across the state’s three most populated cities.

CA <- subset(comparing_TN_CA, comparing_TN_CA$stateAbbreviation=='CA')
TN <- subset(comparing_TN_CA, comparing_TN_CA$stateAbbreviation=='TN')

Lets look at demographics from 2018 state only data using data.census.gov.

CA_demographics <- CA[,c(1,11:18)]
TN_demographics <- TN[,c(1,11:18)]
CA_demoTidy <- gather(CA_demographics, key='race', value='TotalPopulationPercent',
                      3:9)
## Warning: attributes are not identical across measure variables;
## they will be dropped
CA_demoTidy$TotalPopulationPercent <- as.numeric(CA_demoTidy$TotalPopulationPercent)
CA_pop <- CA_demographics$total_state_population

gg1 <- ggplot(data = CA_demoTidy,
              aes(y=CA_demoTidy$TotalPopulationPercent,
                  x=CA_demoTidy$race)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  coord_cartesian(ylim = c(0, 100))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('CA demographics, Percent of: ',CA_pop)+
  ylab(NULL)+
  xlab(NULL)

gg1

TN_demoTidy <- gather(TN_demographics, key='race', value='TotalPopulationPercent',
                      3:9)
## Warning: attributes are not identical across measure variables;
## they will be dropped
TN_demoTidy$TotalPopulationPercent <- as.numeric(TN_demoTidy$TotalPopulationPercent)
TN_pop <- TN_demographics$total_state_population

gg2 <- ggplot(data = TN_demoTidy,
              aes(y=TN_demoTidy$TotalPopulationPercent,
                  x=TN_demoTidy$race)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  coord_cartesian(ylim = c(0, 100))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('TN demographics, Percent of: ',TN_pop)+
  ylab(NULL)+
  xlab(NULL)

gg2

CA_TN_demographics <- rbind(CA_demographics,TN_demographics)
CA_TN_demographics
##    stateAbbreviation total_state_population percent_black percent_white
## 5                 CA               39557045           5.8          59.5
## 42                TN                6770010          16.8          77.3
##    percent_two_or_more percent_Native_American percent_Asian
## 5                  5.1                     0.8          14.7
## 42                 2.2                     0.3           1.8
##    percent_Pacific_Islander percent_Latino
## 5                       0.4           39.3
## 42                      0.1            5.5
grid.arrange(gg1, gg2, ncol = 2)

Now lets look at the two bedroom, two bath, pet friendly apartments for rent in CA and TN.

CA_2BR <- CA[,c(1,40:43)]
TN_2BR <- TN[,c(1,40:43)]
CA_listings <- CA_2BR$TwoBedroomApartment_Listings

CA_2BR_tidy <- gather(CA_2BR, key='range',value='price',3:5)
CA_2BR_tidy$range <- gsub('Rent2BR2BA_','',CA_2BR_tidy$range)
gg3 <- ggplot(data = CA_2BR_tidy,
              aes(y=CA_2BR_tidy$price,
                  x=CA_2BR_tidy$range)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  coord_cartesian(ylim = c(500, 5000))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('CA 2 Bedroom/2 Bath: ',CA_listings)+
  ylab(NULL)+
  xlab('San Diego, San Jose, and Los Angeles Prices Averaged')


TN_listings <- TN_2BR$TwoBedroomApartment_Listings

TN_2BR_tidy <- gather(TN_2BR, key='range', value='price', 3:5)
TN_2BR_tidy$range <- gsub('Rent2BR2BA_','',TN_2BR_tidy$range)
gg4 <- ggplot(data = TN_2BR_tidy,
              aes(y=TN_2BR_tidy$price,
                  x=TN_2BR_tidy$range)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  coord_cartesian(ylim = c(500, 5000))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('TN 2 Bedroom/2 Bath: ',TN_listings)+
  ylab(NULL)+
  xlab('Nashville,Memphis, and Knoxville Prices Averaged')
CA_TN_2BR <- rbind(CA_2BR,TN_2BR)
CA_TN_2BR
##    stateAbbreviation TwoBedroomApartment_Listings _10cities
## 5                 CA                                    750
## 42                TN                                    451
##    Rent2BR2BA_MinPrice _10cities Rent2BR2BA_MaxPrice _10cities
## 5                       2835.572                      4201.762
## 42                      1268.962                      1910.188
##    Rent2BR2BA_AvgPrice _10cities
## 5                       3395.412
## 42                      1507.706
grid.arrange(gg3, gg4, ncol = 2)

Lets now look at the number of massage and alternate jobs in CA and TN to compare their annual salaries against number of jobs available.

CA_jobsAvailable <- CA[,c(1,8,19,21,23,25,27,29,31)]
TN_jobsAvailable <- TN[,c(1,8,19,21,23,25,27,29,31)]

colnames(CA_jobsAvailable) <- gsub('_.*$','',colnames(CA_jobsAvailable))
colnames(TN_jobsAvailable) <- gsub('_.*$','',colnames(TN_jobsAvailable))

colnames(CA_jobsAvailable) <- gsub('jobsListed','',colnames(CA_jobsAvailable))
colnames(TN_jobsAvailable) <- gsub('jobsListed','',colnames(TN_jobsAvailable))

CA_jobsAvailable_tidy <- gather(CA_jobsAvailable, key='job',value='listings', 2:9)
TN_jobsAvailable_tidy <- gather(TN_jobsAvailable, key='job',value='listings', 2:9)
gg5 <- ggplot(data = CA_jobsAvailable_tidy,
              aes(y=CA_jobsAvailable_tidy$listings,
                  x=CA_jobsAvailable_tidy$job)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  coord_cartesian(ylim = c(0,300))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('CA Number of Advertised Jobs: ')+
  ylab(NULL)+
  xlab('San Diego, San Jose, and Los Angeles')

gg6 <- ggplot(data = TN_jobsAvailable_tidy,
              aes(y=TN_jobsAvailable_tidy$listings,
                  x=TN_jobsAvailable_tidy$job)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  coord_cartesian(ylim = c(0,300))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('TN Number of Advertised Jobs: ')+
  ylab(NULL)+
  xlab('Nashville, Memphis, and Knoxville')
CA_TN_jobsAvailable <- rbind(CA_jobsAvailable,TN_jobsAvailable)
CA_TN_jobsAvailable
##    stateAbbreviation LMT houseCleaner warehouse nanny clerical tutor
## 5                 CA 223          216       243   199      225   217
## 42                TN 174          192       230   113      238   198
##    dataScientist personalAssistant 
## 5            231                223
## 42           152                218
grid.arrange(gg5,gg6,ncol=2)

Now, lets look at the average annual salary for those jobs available in CA and TN.

CA_salary <- CA[,c(1,9,20,22,24,26,28,30,32)]
TN_salary <- TN[,c(1,9,20,22,24,26,28,30,32)]

colnames(CA_salary) <- gsub('_.*$','',colnames(CA_salary))
colnames(CA_salary) <- gsub(' avgAnualSalary', '',colnames(CA_salary))
colnames(TN_salary) <- gsub('_.*$','',colnames(TN_salary))
colnames(TN_salary) <- gsub(' avgAnualSalary', '',colnames(TN_salary))

CA_salary_tidy <- gather(CA_salary, key='job',value='salary',2:9)
TN_salary_tidy <- gather(TN_salary, key='job', value='salary',2:9)
CA_medianIncome <- CA$median2018IncomeByState
TN_medianIncome <- TN$median2018IncomeByState

gg7 <- ggplot(data = CA_salary_tidy,
              aes(y=CA_salary_tidy$salary,
                  x=CA_salary_tidy$job)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  geom_hline(yintercept=CA_medianIncome, linetype="dashed", color = "red")+
  coord_cartesian(ylim = c(10000, 120000))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('CA Advertised Salaries: ')+
  ylab(NULL)+
  xlab('San Diego, San Jose, and Los Angeles')

gg8 <- ggplot(data = TN_salary_tidy,
              aes(y=TN_salary_tidy$salary,
                  x=TN_salary_tidy$job)) +
  geom_bar(stat='identity', position=position_dodge())+
  theme_classic()+
  geom_hline(yintercept=TN_medianIncome, linetype="dashed", color = "red")+
  coord_cartesian(ylim = c(10000,120000))+
  theme(legend.position="bottom")+
  theme(axis.text = element_text(colour = "black", angle=90, size = rel(.75)))+
  ggtitle('TN Advertised Salaries: ')+
  ylab(NULL)+
  xlab('Nashville, Memphis, and Knoxville')
CA_TN_salaries <- rbind(CA_salary,TN_salary)
CA_TN_salaries
##    stateAbbreviation      LMT houseCleaner warehouse    nanny clerical    tutor
## 5                 CA 66450.98     42592.81  47334.89 52888.44 51181.31 87743.41
## 42                TN 55739.94     31194.58  32322.16 31384.07 33240.50 39892.93
##    dataScientist personalAssistant
## 5       120606.1          99507.74
## 42      128660.7          61158.14

The red dashed line across the CA and TN advertised salaries is the state’s respective 2018 median income.

grid.arrange(gg7,gg8, ncol=2)

We notice a large gap in LMT annual pay in the CA advertised pay ranges for jobs selected when compared to the gap of the TN median income and annual salaries of jobs selected.