Project 2 :DataSet1 Analysis. This dataset has Year data spread in a wide format. Also it has some special characters and formats to be cleaned up.

Your task is to: For each of the three chosen datasets: • Create a .CSV file (or optionally, a MySQL database!) that includes all of the information included in the dataset. You’re encouraged to use a “wide” structure similar to how the information appears in the discussion item, so that you can practice tidying and transformations as described below.

DATASET SOURCE: US Census Data URL link: https://www.census.gov/data/tables/time-series/demo/income-poverty/cps-pinc/pinc-06.2018.html

myurl <- "https://raw.githubusercontent.com/BanuB/DATA607Project2/master/census2femalecsv1.csv"
csvdata2  <- read.csv(file=myurl, header=TRUE,sep=",",stringsAsFactors = FALSE,na.strings=c("NA"))
filename<- "CensusFemaleDataset1.csv"

After reading in data, view file

str(csvdata2)
## 'data.frame':    101 obs. of  49 variables:
##  $ ï..Occupation        : chr  "....Total" "Management, science, and arts occupations" "..Management, business, and financial operations occupations" "..Management occupations" ...
##  $ Total.with.Earnings  : chr  "79,440" "34,830" "12,376" "7,821" ...
##  $ X.1.to..2.499.or.loss: chr  "3,324" "812" "173" "133" ...
##  $ X.2.500.to..4.999    : chr  "2,752" "527" "121" "70" ...
##  $ X.5.000.to..7.499    : chr  "2,918" "709" "186" "124" ...
##  $ X.7.500.to..9.999    : chr  "2,068" "473" "113" "86" ...
##  $ X.10.000.to..12.499  : chr  "3,730" "789" "190" "124" ...
##  $ X.12.500.to..14.999  : chr  "1,713" "375" "90" "45" ...
##  $ X.15.000.to..17.499  : chr  "3,401" "800" "188" "143" ...
##  $ X.17.500.to..19.999  : chr  "2,394" "636" "145" "116" ...
##  $ X.20.000.to..22.499  : chr  "4,357" "1,007" "293" "197" ...
##  $ X.22.500.to..24.999  : chr  "2,312" "614" "182" "93" ...
##  $ X.25.000.to..27.499  : chr  "4,074" "1,110" "283" "162" ...
##  $ X.27.500.to..29.999  : chr  "1,748" "486" "114" "68" ...
##  $ X.30.000.to..32.499  : chr  "4,852" "1,466" "463" "260" ...
##  $ X.32.500.to..34.999  : chr  "1,244" "389" "142" "75" ...
##  $ X.35.000.to..37.499  : chr  "3,638" "1,334" "432" "249" ...
##  $ X.37.500.to..39.999  : chr  "1,374" "616" "244" "152" ...
##  $ X.40.000.to..42.499  : chr  "3,642" "1,812" "655" "409" ...
##  $ X.42.500.to..44.999  : int  937 477 146 99 8 0 92 47 23 24 ...
##  $ X.45.000.to..47.499  : chr  "2,643" "1,428" "526" "332" ...
##  $ X.47.500.to..49.999  : chr  "1,185" "641" "193" "81" ...
##  $ X.50.000.to..52.499  : chr  "3,487" "2,214" "793" "496" ...
##  $ X.52.500.to..54.999  : int  786 488 156 86 4 0 82 70 32 38 ...
##  $ X.55.000.to..57.499  : chr  "1,803" "1,123" "394" "201" ...
##  $ X.57.500.to..59.999  : int  601 387 153 88 22 0 65 65 32 33 ...
##  $ X.60.000.to..62.499  : chr  "2,575" "1,702" "633" "372" ...
##  $ X.62.500.to..64.999  : int  517 349 120 88 1 0 87 32 7 25 ...
##  $ X.65.000.to..67.499  : chr  "1,381" "1,002" "436" "228" ...
##  $ X.67.500.to..69.999  : int  463 292 113 55 0 0 55 58 24 34 ...
##  $ X.70.000.to..72.499  : chr  "1,543" "1,115" "437" "262" ...
##  $ X.72.500.to..74.999  : int  321 251 100 55 1 0 54 45 18 27 ...
##  $ X.75.000.to..77.499  : chr  "1,210" "950" "403" "210" ...
##  $ X.77.500.to..79.999  : int  359 293 112 52 4 0 48 60 39 20 ...
##  $ X.80.000.to..82.499  : chr  "1,254" "971" "408" "230" ...
##  $ X.82.500.to..84.999  : int  251 207 76 48 11 0 37 28 25 3 ...
##  $ X.85.000.to..87.499  : int  756 624 274 192 6 0 186 83 40 43 ...
##  $ X.87.500.to..89.999  : int  175 122 33 22 0 0 22 11 8 3 ...
##  $ X.90.000.to..92.499  : int  770 623 206 133 3 0 130 73 49 24 ...
##  $ X.92.500.to..94.999  : int  204 148 68 56 8 0 48 12 8 4 ...
##  $ X.95.000.to..97.499  : int  436 352 136 94 3 0 91 42 19 22 ...
##  $ X.97.500.to..99.999  : int  156 117 45 32 3 0 28 13 0 13 ...
##  $ X.100.000.and.over   : chr  "6,086" "5,000" "2,405" "1,806" ...
##  $ Median.earnings      : chr  "32,654" "51,033" "57,292" "60,153" ...
##  $ Median.earnings.1    : chr  "420" "159" "860" "993" ...
##  $ Mean.earnings        : chr  "44,594" "62,071" "70,552" "74,345" ...
##  $ Mean.earnings.1      : chr  "338" "603" "1,030" "1,291" ...
##  $ Gini.ratio           : chr  "0.472" "0.414" "0.391" "0.407" ...
##  $ Gini.ratio.1         : chr  "0.0032" "0.004" "0.0059" "0.0072" ...
raw.tablefemale <- data.frame(csvdata2)
names(raw.tablefemale)[1]<-"Occupation"
str(raw.tablefemale)
## 'data.frame':    101 obs. of  49 variables:
##  $ Occupation           : chr  "....Total" "Management, science, and arts occupations" "..Management, business, and financial operations occupations" "..Management occupations" ...
##  $ Total.with.Earnings  : chr  "79,440" "34,830" "12,376" "7,821" ...
##  $ X.1.to..2.499.or.loss: chr  "3,324" "812" "173" "133" ...
##  $ X.2.500.to..4.999    : chr  "2,752" "527" "121" "70" ...
##  $ X.5.000.to..7.499    : chr  "2,918" "709" "186" "124" ...
##  $ X.7.500.to..9.999    : chr  "2,068" "473" "113" "86" ...
##  $ X.10.000.to..12.499  : chr  "3,730" "789" "190" "124" ...
##  $ X.12.500.to..14.999  : chr  "1,713" "375" "90" "45" ...
##  $ X.15.000.to..17.499  : chr  "3,401" "800" "188" "143" ...
##  $ X.17.500.to..19.999  : chr  "2,394" "636" "145" "116" ...
##  $ X.20.000.to..22.499  : chr  "4,357" "1,007" "293" "197" ...
##  $ X.22.500.to..24.999  : chr  "2,312" "614" "182" "93" ...
##  $ X.25.000.to..27.499  : chr  "4,074" "1,110" "283" "162" ...
##  $ X.27.500.to..29.999  : chr  "1,748" "486" "114" "68" ...
##  $ X.30.000.to..32.499  : chr  "4,852" "1,466" "463" "260" ...
##  $ X.32.500.to..34.999  : chr  "1,244" "389" "142" "75" ...
##  $ X.35.000.to..37.499  : chr  "3,638" "1,334" "432" "249" ...
##  $ X.37.500.to..39.999  : chr  "1,374" "616" "244" "152" ...
##  $ X.40.000.to..42.499  : chr  "3,642" "1,812" "655" "409" ...
##  $ X.42.500.to..44.999  : int  937 477 146 99 8 0 92 47 23 24 ...
##  $ X.45.000.to..47.499  : chr  "2,643" "1,428" "526" "332" ...
##  $ X.47.500.to..49.999  : chr  "1,185" "641" "193" "81" ...
##  $ X.50.000.to..52.499  : chr  "3,487" "2,214" "793" "496" ...
##  $ X.52.500.to..54.999  : int  786 488 156 86 4 0 82 70 32 38 ...
##  $ X.55.000.to..57.499  : chr  "1,803" "1,123" "394" "201" ...
##  $ X.57.500.to..59.999  : int  601 387 153 88 22 0 65 65 32 33 ...
##  $ X.60.000.to..62.499  : chr  "2,575" "1,702" "633" "372" ...
##  $ X.62.500.to..64.999  : int  517 349 120 88 1 0 87 32 7 25 ...
##  $ X.65.000.to..67.499  : chr  "1,381" "1,002" "436" "228" ...
##  $ X.67.500.to..69.999  : int  463 292 113 55 0 0 55 58 24 34 ...
##  $ X.70.000.to..72.499  : chr  "1,543" "1,115" "437" "262" ...
##  $ X.72.500.to..74.999  : int  321 251 100 55 1 0 54 45 18 27 ...
##  $ X.75.000.to..77.499  : chr  "1,210" "950" "403" "210" ...
##  $ X.77.500.to..79.999  : int  359 293 112 52 4 0 48 60 39 20 ...
##  $ X.80.000.to..82.499  : chr  "1,254" "971" "408" "230" ...
##  $ X.82.500.to..84.999  : int  251 207 76 48 11 0 37 28 25 3 ...
##  $ X.85.000.to..87.499  : int  756 624 274 192 6 0 186 83 40 43 ...
##  $ X.87.500.to..89.999  : int  175 122 33 22 0 0 22 11 8 3 ...
##  $ X.90.000.to..92.499  : int  770 623 206 133 3 0 130 73 49 24 ...
##  $ X.92.500.to..94.999  : int  204 148 68 56 8 0 48 12 8 4 ...
##  $ X.95.000.to..97.499  : int  436 352 136 94 3 0 91 42 19 22 ...
##  $ X.97.500.to..99.999  : int  156 117 45 32 3 0 28 13 0 13 ...
##  $ X.100.000.and.over   : chr  "6,086" "5,000" "2,405" "1,806" ...
##  $ Median.earnings      : chr  "32,654" "51,033" "57,292" "60,153" ...
##  $ Median.earnings.1    : chr  "420" "159" "860" "993" ...
##  $ Mean.earnings        : chr  "44,594" "62,071" "70,552" "74,345" ...
##  $ Mean.earnings.1      : chr  "338" "603" "1,030" "1,291" ...
##  $ Gini.ratio           : chr  "0.472" "0.414" "0.391" "0.407" ...
##  $ Gini.ratio.1         : chr  "0.0032" "0.004" "0.0059" "0.0072" ...

tidy data and rename columns

raw.tablefemale1 <- raw.tablefemale %>%
  mutate(Occupation = gsub("[[:punct:]]", "", Occupation)) 

raw.tablefemale2 <- raw.tablefemale1 %>%
  mutate(Occupation = gsub("[^a-zA-Z]","", Occupation))
raw.tablefemale2  %>% kable() %>% kable_styling()
Occupation Total.with.Earnings X.1.to..2.499.or.loss X.2.500.to..4.999 X.5.000.to..7.499 X.7.500.to..9.999 X.10.000.to..12.499 X.12.500.to..14.999 X.15.000.to..17.499 X.17.500.to..19.999 X.20.000.to..22.499 X.22.500.to..24.999 X.25.000.to..27.499 X.27.500.to..29.999 X.30.000.to..32.499 X.32.500.to..34.999 X.35.000.to..37.499 X.37.500.to..39.999 X.40.000.to..42.499 X.42.500.to..44.999 X.45.000.to..47.499 X.47.500.to..49.999 X.50.000.to..52.499 X.52.500.to..54.999 X.55.000.to..57.499 X.57.500.to..59.999 X.60.000.to..62.499 X.62.500.to..64.999 X.65.000.to..67.499 X.67.500.to..69.999 X.70.000.to..72.499 X.72.500.to..74.999 X.75.000.to..77.499 X.77.500.to..79.999 X.80.000.to..82.499 X.82.500.to..84.999 X.85.000.to..87.499 X.87.500.to..89.999 X.90.000.to..92.499 X.92.500.to..94.999 X.95.000.to..97.499 X.97.500.to..99.999 X.100.000.and.over Median.earnings Median.earnings.1 Mean.earnings Mean.earnings.1 Gini.ratio Gini.ratio.1
Total 79,440 3,324 2,752 2,918 2,068 3,730 1,713 3,401 2,394 4,357 2,312 4,074 1,748 4,852 1,244 3,638 1,374 3,642 937 2,643 1,185 3,487 786 1,803 601 2,575 517 1,381 463 1,543 321 1,210 359 1,254 251 756 175 770 204 436 156 6,086 32,654 420 44,594 338 0.472 0.0032
Managementscienceandartsoccupations 34,830 812 527 709 473 789 375 800 636 1,007 614 1,110 486 1,466 389 1,334 616 1,812 477 1,428 641 2,214 488 1,123 387 1,702 349 1,002 292 1,115 251 950 293 971 207 624 122 623 148 352 117 5,000 51,033 159 62,071 603 0.414 0.004
Managementbusinessandfinancialoperationsoccupations 12,376 173 121 186 113 190 90 188 145 293 182 283 114 463 142 432 244 655 146 526 193 793 156 394 153 633 120 436 113 437 100 403 112 408 76 274 33 206 68 136 45 2,405 57,292 860 70,552 1,030 0.391 0.0059
Managementoccupations 7,821 133 70 124 86 124 45 143 116 197 93 162 68 260 75 249 152 409 99 332 81 496 86 201 88 372 88 228 55 262 55 210 52 230 48 192 22 133 56 94 32 1,806 60,153 993 74,345 1,291 0.407 0.0072
ChiefExecutivesGeneralandOperationsManagers 781 8 6 13 3 2 0 18 2 16 3 21 1 18 3 10 7 51 8 22 4 26 4 15 22 20 1 24 0 23 1 16 4 9 11 6 0 3 8 3 3 366 84,746 11,184 116,422 6,200 0.447 0.0182
Legislators 24 4 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0
AllotherManagers 7,017 121 65 111 84 121 45 125 114 177 90 141 67 242 72 239 145 358 92 311 77 470 82 186 65 352 87 204 55 223 54 194 48 221 37 186 22 130 48 91 28 1,440 57,188 1,430 69,750 1,186 0.389 0.0074
Businessandfinancialoperationsoccupations 4,555 41 51 61 27 66 45 45 29 96 89 121 45 203 67 183 92 246 47 194 112 297 70 193 65 261 32 208 58 175 45 193 60 178 28 83 11 73 12 42 13 599 55,648 698 64,038 1,328 0.351 0.0096
BusinessOperationsSpecialists 2,510 29 39 41 21 25 27 14 25 46 69 65 28 140 39 107 40 131 23 109 72 122 32 90 32 125 7 99 24 107 18 116 39 90 25 40 8 49 8 19 0 370 55,259 1,710 65,603 1,963 0.38 0.0144
FinancialSpecialists 2,044 12 11 20 5 42 18 31 4 49 21 56 17 63 29 75 52 115 24 85 40 176 38 103 33 136 25 109 34 68 27 77 20 88 3 43 3 24 4 22 13 228 55,986 777 62,117 1,482 0.313 0.0115
Professionalandrelatedoccupations 22,454 639 406 524 360 599 285 612 491 714 432 827 372 1,003 247 902 372 1,157 331 902 449 1,420 332 729 234 1,069 229 566 179 678 151 547 182 563 132 350 90 417 80 216 72 2,596 47,797 596 57,397 724 0.422 0.0056
Computerandmathematicaloccupations 1,362 15 10 14 5 23 0 8 0 12 6 57 13 25 18 31 8 33 17 29 23 76 19 31 9 80 28 58 10 50 17 38 26 74 20 58 11 26 16 25 12 331 71,204 2,093 76,283 2,489 0.314 0.0193
Computerscientistsanalystsprogrammersengineersandadministrators 1,234 15 10 14 5 15 0 8 0 12 6 57 13 25 18 30 5 31 17 22 16 69 19 31 8 77 25 56 10 40 17 33 24 68 20 54 11 24 15 20 10 283 70,115 3,324 75,385 2,633 0.318 0.0206
Actuaries 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 2 1 0 2
Mathematiciansstatisticiansoperationsresearchandothermathoccupations 119 0 0 0 0 8 0 0 0 0 0 0 0 0 0 1 3 2 0 7 7 7 0 0 0 2 2 2 0 10 0 6 1 2 0 4 0 2 0 4 2 45 80,688 11,710 84,371 6,708 0.275 0.0328
Architectureandengineeringoccupations 523 2 6 11 4 8 6 10 5 6 1 5 2 10 11 24 10 11 6 3 0 22 9 9 11 33 13 20 0 25 7 32 6 28 0 21 2 23 2 12 0 109 70,502 4,278 73,596 3,196 0.332 0.0223
Architectsexceptnaval 57 0 2 0 0 1 4 1 0 0 0 2 0 0 0 0 2 0 0 0 0 9 0 0 0 11 0 1 0 6 4 0 0 10 0 0 0 4 0 0 0 0
SurveyorsCartographersandphonogrammetrists 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0
Engineers 320 0 0 11 4 4 3 5 2 2 0 1 0 4 6 0 4 3 0 3 0 9 9 6 8 13 13 5 0 11 1 27 0 17 0 21 2 18 2 8 0 101 81,366 4,585 86,514 4,760 0.306 0.0293
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians 139 2 4 1 0 3 0 5 2 5 1 3 2 6 5 24 4 8 6 0 0 3 0 2 3 6 0 13 0 8 2 5 6 2 0 0 0 2 0 0 0 7 41,146 4,182 49,960 4,305 0.332 0.0423
Lifephysicalandsocialscienceoccupations 813 10 5 11 6 18 14 9 6 22 12 17 19 28 9 26 9 51 20 36 12 75 10 13 4 35 3 27 3 25 5 34 0 32 9 34 3 7 4 5 0 145 52,262 2,272 65,565 2,542 0.364 0.0167
AstronomersandPhysicists 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2
Economists 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 3 0 6
PsychologistsandSociologists 206 2 0 0 3 0 3 2 0 1 0 5 9 9 0 13 0 10 2 13 4 2 2 6 0 9 2 9 2 0 0 17 0 15 9 10 3 3 0 2 0 37 66,465 8,020 71,605 4,960 0.324 0.0306
Allotherscientists 449 3 0 6 2 9 11 3 5 13 3 10 9 14 5 2 5 31 15 19 6 50 6 4 4 23 1 11 1 15 5 12 0 14 0 20 0 4 4 1 0 99 53,372 5,435 69,723 3,560 0.365 0.0201
Sciencetechnicians 140 5 4 5 0 9 0 4 0 8 9 2 2 6 4 10 4 6 4 3 2 22 1 3 0 2 0 6 0 10 0 4 0 0 0 3 0 0 0 0 0 0 38,945 4,934 38,617 3,518 0.321 0.0455
Communityandsocialservicesoccupations 1,959 52 33 16 29 57 19 48 46 69 58 80 32 124 44 132 49 162 59 83 63 130 44 54 19 105 19 50 30 67 6 28 18 18 9 0 5 31 4 9 2 58 41,424 494 44,543 1,194 0.327 0.0137
Legaloccupations 902 5 3 12 7 5 9 15 21 18 15 25 8 33 21 32 9 61 0 23 7 64 12 24 0 43 14 22 8 47 3 32 3 28 5 13 3 6 0 0 0 247 61,338 2,056 96,760 8,494 0.503 0.0336
LawyersJudgesandMagistrates 373 0 0 0 0 0 5 0 6 5 4 7 0 0 2 6 2 25 0 5 0 5 5 4 0 11 3 3 2 32 3 9 0 10 0 10 1 6 0 0 0 203 106,550 7,688 150,715 16,015 0.463 0.039
ParalegalsLegalassistantsandLegalsupportworkers 529 5 3 12 7 5 4 14 14 13 10 18 8 33 19 26 8 36 0 18 7 59 7 20 0 32 11 19 6 15 0 23 3 18 5 3 2 0 0 0 0 43 50,149 2,947 58,652 7,690 0.401 0.0729
Educationtrainingandlibraryoccupations 7,740 331 220 278 196 318 158 298 263 306 199 332 138 340 91 236 167 460 139 358 164 497 130 265 107 261 61 148 65 213 64 91 45 113 50 83 26 100 18 50 20 340 39,973 781 42,425 850 0.406 0.0092
Postsecondaryteachers 703 20 13 25 30 31 14 13 30 27 7 23 3 42 2 12 11 16 5 14 7 47 11 20 3 15 4 6 6 20 5 20 6 9 5 10 4 24 0 14 3 125 50,308 2,999 57,542 2,829 0.443 0.0167
Allotherteachers 5,618 246 156 179 115 183 84 198 116 167 103 175 79 236 78 201 120 382 124 310 151 414 115 230 87 228 50 133 50 179 56 71 38 96 45 72 20 68 18 35 14 192 42,439 739 44,013 891 0.369 0.0108
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants 1,419 65 52 74 50 104 61 87 117 113 89 134 56 62 11 23 36 62 9 34 6 36 4 14 16 18 7 9 8 13 3 0 2 8 0 0 3 8 0 0 2 23 22,232 674 28,651 2,333 0.443 0.0415
Artsdesignentertainmentsportsandmediaoccupations 1,812 190 91 79 37 56 25 60 50 74 36 73 5 103 4 71 17 63 13 91 22 70 22 29 22 68 9 36 10 49 0 53 19 36 2 21 3 29 3 10 9 155 35,798 2,168 48,890 2,954 0.538 0.0207
Healthcarepractitionerandtechnicaloccupations 7,344 32 39 102 78 116 53 163 101 207 106 239 154 340 48 351 104 316 77 279 158 487 87 304 63 444 82 207 53 202 49 240 64 234 37 121 37 194 33 104 29 1,212 55,303 770 68,312 1,437 0.394 0.0088
Doctors 602 0 0 0 0 14 1 3 0 5 4 11 8 11 0 7 0 12 0 2 7 11 0 20 0 36 0 0 0 4 0 14 3 17 0 10 0 20 1 7 2 370 130,746 13,733 160,306 7,095 0.393 0.0139
Nurses 3,850 10 20 47 33 50 23 82 50 99 36 137 68 161 11 172 51 155 34 119 76 277 65 159 34 271 44 137 26 141 34 141 60 145 26 66 25 122 27 76 16 521 57,313 1,864 63,441 1,686 0.326 0.0133
Allotherhealthandtechnicaloccupations 2,892 23 18 55 45 52 29 78 51 102 66 90 78 167 37 171 53 148 43 158 75 199 22 124 28 137 38 70 28 57 15 85 2 72 10 44 13 52 5 21 11 321 47,197 752 55,654 2,095 0.37 0.0193
Serviceoccupations 17,187 1,249 1,094 1,056 774 1,469 699 1,325 910 1,515 665 1,233 464 1,261 254 693 247 520 91 250 142 219 33 125 24 208 37 52 29 94 17 59 6 60 17 16 6 37 3 28 3 203 20,028 236 24,848 608 0.474 0.0121
Healthcaresupportoccupations 3,364 75 64 128 116 214 104 206 131 322 162 312 139 404 83 199 109 122 45 87 44 50 15 46 1 68 15 4 0 37 6 5 3 12 0 0 0 3 0 2 0 32 26,287 355 29,533 954 0.365 0.0173
Protectiveserviceoccupations 801 49 65 39 7 12 19 12 23 31 27 36 10 66 4 50 15 45 6 17 18 22 0 8 16 30 4 3 16 18 2 7 3 14 10 5 0 11 0 12 3 66 35,117 3,462 41,860 2,017 0.451 0.0172
Supervisors 45 0 1 0 0 0 0 0 0 0 2 0 0 0 0 2 0 4 0 4 0 2 0 3 4 9 0 0 4 0 0 0 0 0 0 0 0 5 0 4 0 2
FirefightersandPolice 175 0 2 5 0 0 0 0 0 4 5 0 0 10 0 0 1 7 3 2 0 7 0 0 5 21 4 0 4 12 2 5 3 12 10 0 0 4 0 6 3 37 71,146 3,826 73,287 4,178 0.267 0.0241
Allotherprotectiveserviceoccupations 581 49 62 34 7 11 19 12 23 28 20 36 10 56 3 48 13 34 2 11 18 13 0 6 7 0 0 3 8 6 0 2 0 2 0 4 0 2 0 3 0 28 26,808 1,917 30,830 1,971 0.469 0.0229
Foodpreparationsandservingrelatedoccupations 5,232 471 489 367 288 515 260 511 308 456 182 353 108 325 58 132 34 93 22 49 19 43 5 30 4 37 2 2 0 6 0 13 0 5 2 3 5 0 3 3 0 28 16,103 250 19,090 592 0.455 0.0144
Supervisors 383 14 9 15 12 14 9 53 17 53 17 37 11 38 3 7 4 19 0 10 10 7 0 7 2 10 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 3 22,246 1,315 26,975 2,511 0.368 0.0492
ChefsandCooks 1,102 58 74 71 38 107 76 118 78 108 48 84 29 89 10 24 7 18 5 9 2 10 3 20 0 4 0 0 0 0 0 0 0 5 2 2 0 0 0 0 0 4 17,780 724 19,843 756 0.377 0.0152
Allotherfoodpreparationoccupations 3,748 400 406 282 238 394 175 340 213 296 117 232 69 199 46 102 23 56 17 30 6 27 2 2 2 23 2 2 0 4 0 13 0 0 0 1 5 0 3 3 0 22 14,725 612 18,063 736 0.482 0.019
Buildingandgroundscleaningandmaintenanceoccupations 2,747 177 175 129 141 293 115 215 166 299 132 209 84 166 45 108 26 86 14 27 16 31 10 4 2 20 3 12 6 2 1 13 0 6 0 0 2 3 0 0 0 10 19,438 592 20,689 469 0.386 0.0097
Supervisors 160 2 13 0 2 4 8 8 4 17 13 12 3 14 7 7 0 13 0 5 2 1 4 4 0 9 3 2 0 0 0 0 0 0 0 0 0 3 0 0 0 0 27,077 3,190 30,619 2,301 0.327 0.0288
Allothermaintenanceoccupations 2,587 175 162 129 139 289 107 208 162 282 120 196 80 152 38 102 25 73 14 22 14 30 5 0 2 11 0 10 6 2 1 13 0 6 0 0 2 0 0 0 0 10 18,804 584 20,074 466 0.385 0.01
Personalcareandserviceoccupations 5,042 477 302 394 222 436 200 381 282 406 162 323 123 300 65 203 64 175 5 70 45 72 3 37 0 52 13 31 7 31 7 22 0 23 5 9 0 20 0 11 0 66 18,471 486 27,260 1,980 0.555 0.0299
Supervisors 241 8 3 8 7 10 5 4 4 6 11 16 5 34 1 14 0 15 0 22 6 7 0 8 0 5 0 0 0 2 0 13 0 9 5 0 0 0 0 0 0 14 34,012 3,962 64,742 17,669 0.598 0.1
Allotherpersonalcareandserviceoccupations 4,801 468 299 386 215 426 195 377 278 400 151 307 118 267 64 189 64 159 5 48 39 66 3 29 0 47 13 30 7 29 7 9 0 13 0 9 0 20 0 11 0 52 17,800 472 25,375 1,903 0.54 0.0315
Salesandofficeoccupations 21,917 993 920 909 670 1,199 445 971 583 1,381 773 1,304 598 1,640 479 1,278 413 1,081 301 793 355 908 240 479 164 539 106 293 123 307 48 175 60 200 24 98 47 99 44 44 32 799 30,321 181 36,034 430 0.438 0.0055
Salesandrelatedoccupations 8,639 596 564 452 369 665 238 460 337 650 296 421 187 458 107 309 86 282 77 221 74 282 51 139 41 163 28 95 12 114 13 63 34 63 14 43 12 51 25 14 12 526 22,459 430 35,497 941 0.541 0.0092
Supervisors 1,926 49 28 33 15 48 45 75 59 99 60 100 63 165 41 110 34 79 21 100 42 98 11 69 25 52 15 52 7 35 9 22 13 32 9 16 8 21 11 5 0 154 36,912 991 47,610 1,692 0.408 0.0151
Cashiers 2,860 315 312 283 227 370 109 231 149 284 141 123 49 79 14 47 14 36 8 15 7 19 0 4 1 16 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 6 11,982 275 14,564 330 0.426 0.0093
Insurancesalesagents 297 3 3 5 0 2 0 2 2 10 11 22 4 43 7 21 7 26 5 24 2 26 10 12 2 4 1 3 0 3 0 0 5 0 0 0 0 4 0 0 6 20 40,573 1,904 46,017 2,715 0.305 0.0247
Realestatebrokersandsalesagents 611 6 12 10 8 29 5 7 12 46 10 21 3 14 11 42 5 54 6 22 3 47 14 21 0 26 0 10 0 18 4 9 3 12 3 17 0 3 0 0 2 92 45,244 3,433 57,280 3,868 0.423 0.0292
Allothersalesandrelatedoccupations 2,946 224 209 121 119 216 78 144 115 210 74 155 69 157 33 88 26 88 35 60 21 93 16 32 13 65 12 29 5 58 0 29 12 19 2 10 4 23 13 9 3 253 23,697 1,522 42,323 2,158 0.593 0.0172
Officeandadministrativesupportoccupations 13,277 397 357 457 301 534 208 510 247 730 478 883 411 1,182 372 969 327 798 225 572 281 626 189 340 123 376 78 199 111 193 35 113 26 137 11 55 34 48 20 30 20 273 32,380 252 36,384 420 0.361 0.0054
Supervisors 877 9 0 7 5 4 8 12 8 17 4 76 26 60 25 68 19 63 28 43 22 47 18 26 8 45 18 30 8 34 12 22 1 16 4 8 12 15 3 0 2 41 44,859 1,598 50,661 1,578 0.295 0.015
Postalworkers 241 0 0 2 2 1 4 2 0 12 4 5 0 13 4 20 0 16 3 29 9 14 7 15 8 19 8 9 6 12 0 4 0 5 0 0 0 0 0 4 3 2 48,473 2,603 49,050 1,760 0.215 0.017
Allotherofficeandadministrativesupportoccupations 12,159 388 357 448 294 530 195 496 239 702 470 801 385 1,110 342 882 308 719 194 499 251 565 164 300 107 312 52 160 97 147 23 87 25 116 6 47 23 33 16 26 14 231 31,748 192 35,102 449 0.365 0.006
Naturalresourcesconstructionandmaintenanceoccupations 868 67 23 48 12 39 42 38 41 62 32 63 33 74 16 40 15 54 12 12 6 17 0 18 5 48 0 1 4 8 0 4 0 9 1 0 0 0 0 6 5 13 26,210 769 32,082 2,358 0.455 0.0365
Farmingfishingandforestryoccupations 364 48 15 30 8 13 23 21 25 29 15 25 14 22 5 10 2 6 2 4 0 3 0 13 0 19 0 0 0 0 0 0 0 4 0 0 0 0 0 0 3 4 19,867 1,258 29,076 5,058 0.568 0.0721
Supervisors 8 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 2 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Allotherfarmingfishingandforestryoccupations 356 48 15 30 8 13 22 21 25 29 15 25 14 22 5 9 2 6 0 0 0 3 0 13 0 19 0 0 0 0 0 0 0 4 0 0 0 0 0 0 3 4 19,550 1,278 28,832 5,161 0.574 0.0733
Constructionandextractionoccupations 324 13 4 16 5 11 15 17 14 17 10 25 6 24 8 26 9 29 6 8 1 6 0 3 5 13 0 1 4 2 0 2 0 5 1 0 0 0 0 6 2 9 30,773 2,082 35,010 2,416 0.396 0.0306
Construction 320 13 4 16 5 11 15 17 14 17 10 25 4 24 8 26 9 29 6 8 1 6 0 3 5 13 0 1 3 2 0 2 0 5 1 0 0 0 0 6 2 8 30,848 2,252 34,879 2,421 0.395 0.0313
Supervisors 13 0 0 6 0 2 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Brickmasonsblockmasonsandstonemasons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Carpenters 40 0 0 0 3 1 0 2 0 9 2 0 2 7 0 0 0 2 0 0 0 0 0 2 3 5 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
Electricians 23 0 0 0 0 1 2 0 0 0 0 3 0 1 4 8 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Paintersandpaperhangers 47 2 0 2 0 2 5 0 1 6 6 0 2 0 0 11 0 2 0 4 0 1 0 1 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 0 0 0
Sheetmetalworkers 23 0 0 0 0 0 0 7 0 0 0 10 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
Structuralironandsteelworkers 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Allotherconstructiontrades 174 11 4 8 2 5 9 8 12 3 3 13 0 17 4 4 4 23 6 3 1 3 0 0 2 6 0 0 2 1 0 0 0 3 1 0 0 0 0 6 2 8 31,483 2,928 37,971 4,216 0.444 0.043
Extractionworkers 5 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1
Installationmaintenanceandrepairoccupations 180 5 5 2 0 14 4 0 2 16 6 12 13 28 3 4 4 19 4 1 5 8 0 2 0 16 0 0 0 6 0 2 0 0 0 0 0 0 0 0 0 0 30,993 984 32,881 2,051 0.297 0.0255
Supervisors 12 0 0 0 0 0 0 0 0 4 0 0 0 1 0 0 0 2 0 0 0 1 0 1 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0
Aircraftmechanicsandservice 8 0 0 0 0 0 0 0 0 0 1 0 0 4 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Autobustruckheavyequipmentmechanics 35 1 0 2 0 5 0 0 0 10 0 0 4 0 0 0 0 4 4 0 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Heatingairconditioningandrefrigerationmechanicsandinstallers 14 0 0 0 0 5 0 0 0 0 0 5 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Electricalpowerlineandtelecommunicationslineinstallersandrepairers 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0
Allotheroccupations 107 4 5 0 0 4 4 0 2 2 5 7 8 22 3 4 2 9 0 0 1 5 0 1 0 16 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 31,242 882 33,273 2,657 0.291 0.0359
Productiontransportationandmaterialmovingoccupations 4,590 204 180 195 134 234 152 267 218 391 225 364 167 410 106 290 84 171 53 159 41 128 26 57 21 75 25 29 16 18 5 19 0 12 2 14 0 11 8 6 0 71 25,647 356 29,236 883 0.396 0.0152
Productionoccupations 2,646 88 83 84 67 120 70 155 141 220 146 217 109 240 70 180 54 115 30 89 32 80 20 28 8 51 16 26 11 5 5 13 0 9 2 9 0 0 8 3 0 41 26,695 456 30,904 1,216 0.378 0.0216
Supervisors 204 0 0 0 0 2 0 8 8 13 3 15 11 13 5 13 2 7 8 5 5 12 3 5 0 18 10 0 0 2 0 0 0 5 2 1 0 0 0 0 0 29 43,196 5,054 56,233 5,103 0.378 0.0239
Allotheroccupations 2,442 88 83 84 67 118 70 147 133 207 143 202 99 226 65 167 52 108 22 84 26 68 18 23 8 33 6 26 11 3 5 13 0 4 0 8 0 0 8 3 0 12 25,979 441 28,788 1,228 0.362 0.0249
Transportationandmaterialmovingoccupations 1,944 115 97 112 67 114 82 112 77 171 79 147 57 170 36 110 30 56 24 70 9 48 6 30 12 24 10 3 5 13 0 6 0 3 0 5 0 11 0 2 0 31 23,324 1,068 26,966 1,020 0.42 0.016
Supervisors 42 0 0 0 0 3 4 0 0 7 3 2 3 6 2 4 0 0 0 6 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2
Aircraftpilotsandflightengineers 10 3 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2
Airtrafficcontrollersandairfieldoperationspecialists 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Autobustruckambulancetaxidrivers 720 36 20 67 21 50 20 36 37 57 30 45 15 67 20 42 19 15 8 27 0 24 4 8 8 11 5 3 1 4 0 4 0 0 0 0 0 4 0 2 0 11 23,854 1,677 28,170 1,922 0.425 0.033
Railandsubwayworkers 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Shipcaptainsandengineers 2 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Allothertransportationoccupations 1,165 76 77 45 46 61 55 73 39 107 47 100 40 98 14 63 11 41 15 37 9 21 1 21 4 9 5 0 3 9 0 3 0 3 0 5 0 7 0 0 0 17 22,626 1,164 25,566 1,000 0.409 0.0164
ArmedForces 48 0 7 0 4 0 0 0 5 1 3 1 0 0 1 3 0 3 2 1 0 0 0 1 1 4 0 2 0 0 0 2 0 2 0 3 0 0 0 0 0 0

arrange data and order

melt.tablefemale <- melt(raw.tablefemale2,id.vars="Occupation",variable.name = "Earnings", value.name = "Count")
melt.tablefemale3 <- subset (melt.tablefemale, Count != "(B)")
#head(melt.tablefemale,n=200)
str(melt.tablefemale3)
## 'data.frame':    4686 obs. of  3 variables:
##  $ Occupation: chr  "Total" "Managementscienceandartsoccupations" "Managementbusinessandfinancialoperationsoccupations" "Managementoccupations" ...
##  $ Earnings  : Factor w/ 48 levels "Total.with.Earnings",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Count     : chr  "79,440" "34,830" "12,376" "7,821" ...
head(melt.tablefemale3,n=200) %>% kable() %>% kable_styling()
Occupation Earnings Count
Total Total.with.Earnings 79,440
Managementscienceandartsoccupations Total.with.Earnings 34,830
Managementbusinessandfinancialoperationsoccupations Total.with.Earnings 12,376
Managementoccupations Total.with.Earnings 7,821
ChiefExecutivesGeneralandOperationsManagers Total.with.Earnings 781
Legislators Total.with.Earnings 24
AllotherManagers Total.with.Earnings 7,017
Businessandfinancialoperationsoccupations Total.with.Earnings 4,555
BusinessOperationsSpecialists Total.with.Earnings 2,510
FinancialSpecialists Total.with.Earnings 2,044
Professionalandrelatedoccupations Total.with.Earnings 22,454
Computerandmathematicaloccupations Total.with.Earnings 1,362
Computerscientistsanalystsprogrammersengineersandadministrators Total.with.Earnings 1,234
Actuaries Total.with.Earnings 9
Mathematiciansstatisticiansoperationsresearchandothermathoccupations Total.with.Earnings 119
Architectureandengineeringoccupations Total.with.Earnings 523
Architectsexceptnaval Total.with.Earnings 57
SurveyorsCartographersandphonogrammetrists Total.with.Earnings 7
Engineers Total.with.Earnings 320
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians Total.with.Earnings 139
Lifephysicalandsocialscienceoccupations Total.with.Earnings 813
AstronomersandPhysicists Total.with.Earnings 2
Economists Total.with.Earnings 16
PsychologistsandSociologists Total.with.Earnings 206
Allotherscientists Total.with.Earnings 449
Sciencetechnicians Total.with.Earnings 140
Communityandsocialservicesoccupations Total.with.Earnings 1,959
Legaloccupations Total.with.Earnings 902
LawyersJudgesandMagistrates Total.with.Earnings 373
ParalegalsLegalassistantsandLegalsupportworkers Total.with.Earnings 529
Educationtrainingandlibraryoccupations Total.with.Earnings 7,740
Postsecondaryteachers Total.with.Earnings 703
Allotherteachers Total.with.Earnings 5,618
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants Total.with.Earnings 1,419
Artsdesignentertainmentsportsandmediaoccupations Total.with.Earnings 1,812
Healthcarepractitionerandtechnicaloccupations Total.with.Earnings 7,344
Doctors Total.with.Earnings 602
Nurses Total.with.Earnings 3,850
Allotherhealthandtechnicaloccupations Total.with.Earnings 2,892
Serviceoccupations Total.with.Earnings 17,187
Healthcaresupportoccupations Total.with.Earnings 3,364
Protectiveserviceoccupations Total.with.Earnings 801
Supervisors Total.with.Earnings 45
FirefightersandPolice Total.with.Earnings 175
Allotherprotectiveserviceoccupations Total.with.Earnings 581
Foodpreparationsandservingrelatedoccupations Total.with.Earnings 5,232
Supervisors Total.with.Earnings 383
ChefsandCooks Total.with.Earnings 1,102
Allotherfoodpreparationoccupations Total.with.Earnings 3,748
Buildingandgroundscleaningandmaintenanceoccupations Total.with.Earnings 2,747
Supervisors Total.with.Earnings 160
Allothermaintenanceoccupations Total.with.Earnings 2,587
Personalcareandserviceoccupations Total.with.Earnings 5,042
Supervisors Total.with.Earnings 241
Allotherpersonalcareandserviceoccupations Total.with.Earnings 4,801
Salesandofficeoccupations Total.with.Earnings 21,917
Salesandrelatedoccupations Total.with.Earnings 8,639
Supervisors Total.with.Earnings 1,926
Cashiers Total.with.Earnings 2,860
Insurancesalesagents Total.with.Earnings 297
Realestatebrokersandsalesagents Total.with.Earnings 611
Allothersalesandrelatedoccupations Total.with.Earnings 2,946
Officeandadministrativesupportoccupations Total.with.Earnings 13,277
Supervisors Total.with.Earnings 877
Postalworkers Total.with.Earnings 241
Allotherofficeandadministrativesupportoccupations Total.with.Earnings 12,159
Naturalresourcesconstructionandmaintenanceoccupations Total.with.Earnings 868
Farmingfishingandforestryoccupations Total.with.Earnings 364
Supervisors Total.with.Earnings 8
Allotherfarmingfishingandforestryoccupations Total.with.Earnings 356
Constructionandextractionoccupations Total.with.Earnings 324
Construction Total.with.Earnings 320
Supervisors Total.with.Earnings 13
Brickmasonsblockmasonsandstonemasons Total.with.Earnings 0
Carpenters Total.with.Earnings 40
Electricians Total.with.Earnings 23
Paintersandpaperhangers Total.with.Earnings 47
Sheetmetalworkers Total.with.Earnings 23
Structuralironandsteelworkers Total.with.Earnings 0
Allotherconstructiontrades Total.with.Earnings 174
Extractionworkers Total.with.Earnings 5
Installationmaintenanceandrepairoccupations Total.with.Earnings 180
Supervisors Total.with.Earnings 12
Aircraftmechanicsandservice Total.with.Earnings 8
Autobustruckheavyequipmentmechanics Total.with.Earnings 35
Heatingairconditioningandrefrigerationmechanicsandinstallers Total.with.Earnings 14
Electricalpowerlineandtelecommunicationslineinstallersandrepairers Total.with.Earnings 5
Allotheroccupations Total.with.Earnings 107
Productiontransportationandmaterialmovingoccupations Total.with.Earnings 4,590
Productionoccupations Total.with.Earnings 2,646
Supervisors Total.with.Earnings 204
Allotheroccupations Total.with.Earnings 2,442
Transportationandmaterialmovingoccupations Total.with.Earnings 1,944
Supervisors Total.with.Earnings 42
Aircraftpilotsandflightengineers Total.with.Earnings 10
Airtrafficcontrollersandairfieldoperationspecialists Total.with.Earnings 4
Autobustruckambulancetaxidrivers Total.with.Earnings 720
Railandsubwayworkers Total.with.Earnings 0
Shipcaptainsandengineers Total.with.Earnings 2
Allothertransportationoccupations Total.with.Earnings 1,165
ArmedForces Total.with.Earnings 48
Total X.1.to..2.499.or.loss 3,324
Managementscienceandartsoccupations X.1.to..2.499.or.loss 812
Managementbusinessandfinancialoperationsoccupations X.1.to..2.499.or.loss 173
Managementoccupations X.1.to..2.499.or.loss 133
ChiefExecutivesGeneralandOperationsManagers X.1.to..2.499.or.loss 8
Legislators X.1.to..2.499.or.loss 4
AllotherManagers X.1.to..2.499.or.loss 121
Businessandfinancialoperationsoccupations X.1.to..2.499.or.loss 41
BusinessOperationsSpecialists X.1.to..2.499.or.loss 29
FinancialSpecialists X.1.to..2.499.or.loss 12
Professionalandrelatedoccupations X.1.to..2.499.or.loss 639
Computerandmathematicaloccupations X.1.to..2.499.or.loss 15
Computerscientistsanalystsprogrammersengineersandadministrators X.1.to..2.499.or.loss 15
Actuaries X.1.to..2.499.or.loss 0
Mathematiciansstatisticiansoperationsresearchandothermathoccupations X.1.to..2.499.or.loss 0
Architectureandengineeringoccupations X.1.to..2.499.or.loss 2
Architectsexceptnaval X.1.to..2.499.or.loss 0
SurveyorsCartographersandphonogrammetrists X.1.to..2.499.or.loss 0
Engineers X.1.to..2.499.or.loss 0
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians X.1.to..2.499.or.loss 2
Lifephysicalandsocialscienceoccupations X.1.to..2.499.or.loss 10
AstronomersandPhysicists X.1.to..2.499.or.loss 0
Economists X.1.to..2.499.or.loss 0
PsychologistsandSociologists X.1.to..2.499.or.loss 2
Allotherscientists X.1.to..2.499.or.loss 3
Sciencetechnicians X.1.to..2.499.or.loss 5
Communityandsocialservicesoccupations X.1.to..2.499.or.loss 52
Legaloccupations X.1.to..2.499.or.loss 5
LawyersJudgesandMagistrates X.1.to..2.499.or.loss 0
ParalegalsLegalassistantsandLegalsupportworkers X.1.to..2.499.or.loss 5
Educationtrainingandlibraryoccupations X.1.to..2.499.or.loss 331
Postsecondaryteachers X.1.to..2.499.or.loss 20
Allotherteachers X.1.to..2.499.or.loss 246
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants X.1.to..2.499.or.loss 65
Artsdesignentertainmentsportsandmediaoccupations X.1.to..2.499.or.loss 190
Healthcarepractitionerandtechnicaloccupations X.1.to..2.499.or.loss 32
Doctors X.1.to..2.499.or.loss 0
Nurses X.1.to..2.499.or.loss 10
Allotherhealthandtechnicaloccupations X.1.to..2.499.or.loss 23
Serviceoccupations X.1.to..2.499.or.loss 1,249
Healthcaresupportoccupations X.1.to..2.499.or.loss 75
Protectiveserviceoccupations X.1.to..2.499.or.loss 49
Supervisors X.1.to..2.499.or.loss 0
FirefightersandPolice X.1.to..2.499.or.loss 0
Allotherprotectiveserviceoccupations X.1.to..2.499.or.loss 49
Foodpreparationsandservingrelatedoccupations X.1.to..2.499.or.loss 471
Supervisors X.1.to..2.499.or.loss 14
ChefsandCooks X.1.to..2.499.or.loss 58
Allotherfoodpreparationoccupations X.1.to..2.499.or.loss 400
Buildingandgroundscleaningandmaintenanceoccupations X.1.to..2.499.or.loss 177
Supervisors X.1.to..2.499.or.loss 2
Allothermaintenanceoccupations X.1.to..2.499.or.loss 175
Personalcareandserviceoccupations X.1.to..2.499.or.loss 477
Supervisors X.1.to..2.499.or.loss 8
Allotherpersonalcareandserviceoccupations X.1.to..2.499.or.loss 468
Salesandofficeoccupations X.1.to..2.499.or.loss 993
Salesandrelatedoccupations X.1.to..2.499.or.loss 596
Supervisors X.1.to..2.499.or.loss 49
Cashiers X.1.to..2.499.or.loss 315
Insurancesalesagents X.1.to..2.499.or.loss 3
Realestatebrokersandsalesagents X.1.to..2.499.or.loss 6
Allothersalesandrelatedoccupations X.1.to..2.499.or.loss 224
Officeandadministrativesupportoccupations X.1.to..2.499.or.loss 397
Supervisors X.1.to..2.499.or.loss 9
Postalworkers X.1.to..2.499.or.loss 0
Allotherofficeandadministrativesupportoccupations X.1.to..2.499.or.loss 388
Naturalresourcesconstructionandmaintenanceoccupations X.1.to..2.499.or.loss 67
Farmingfishingandforestryoccupations X.1.to..2.499.or.loss 48
Supervisors X.1.to..2.499.or.loss 0
Allotherfarmingfishingandforestryoccupations X.1.to..2.499.or.loss 48
Constructionandextractionoccupations X.1.to..2.499.or.loss 13
Construction X.1.to..2.499.or.loss 13
Supervisors X.1.to..2.499.or.loss 0
Brickmasonsblockmasonsandstonemasons X.1.to..2.499.or.loss 0
Carpenters X.1.to..2.499.or.loss 0
Electricians X.1.to..2.499.or.loss 0
Paintersandpaperhangers X.1.to..2.499.or.loss 2
Sheetmetalworkers X.1.to..2.499.or.loss 0
Structuralironandsteelworkers X.1.to..2.499.or.loss 0
Allotherconstructiontrades X.1.to..2.499.or.loss 11
Extractionworkers X.1.to..2.499.or.loss 1
Installationmaintenanceandrepairoccupations X.1.to..2.499.or.loss 5
Supervisors X.1.to..2.499.or.loss 0
Aircraftmechanicsandservice X.1.to..2.499.or.loss 0
Autobustruckheavyequipmentmechanics X.1.to..2.499.or.loss 1
Heatingairconditioningandrefrigerationmechanicsandinstallers X.1.to..2.499.or.loss 0
Electricalpowerlineandtelecommunicationslineinstallersandrepairers X.1.to..2.499.or.loss 0
Allotheroccupations X.1.to..2.499.or.loss 4
Productiontransportationandmaterialmovingoccupations X.1.to..2.499.or.loss 204
Productionoccupations X.1.to..2.499.or.loss 88
Supervisors X.1.to..2.499.or.loss 0
Allotheroccupations X.1.to..2.499.or.loss 88
Transportationandmaterialmovingoccupations X.1.to..2.499.or.loss 115
Supervisors X.1.to..2.499.or.loss 0
Aircraftpilotsandflightengineers X.1.to..2.499.or.loss 3
Airtrafficcontrollersandairfieldoperationspecialists X.1.to..2.499.or.loss 0
Autobustruckambulancetaxidrivers X.1.to..2.499.or.loss 36
Railandsubwayworkers X.1.to..2.499.or.loss 0
Shipcaptainsandengineers X.1.to..2.499.or.loss 0
check<-function(x){
  return(as.numeric(gsub("[[:punct:]]","",x)))
    #gsub("[[:punct:]]", "",as.character(x))))
}
melt.tablefemale3[3] <- lapply(melt.tablefemale3[3],FUN=check)
str(melt.tablefemale3)
## 'data.frame':    4686 obs. of  3 variables:
##  $ Occupation: chr  "Total" "Managementscienceandartsoccupations" "Managementbusinessandfinancialoperationsoccupations" "Managementoccupations" ...
##  $ Earnings  : Factor w/ 48 levels "Total.with.Earnings",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Count     : num  79440 34830 12376 7821 781 ...
head(melt.tablefemale3,n=200) %>% kable() %>% kable_styling()
Occupation Earnings Count
Total Total.with.Earnings 79440
Managementscienceandartsoccupations Total.with.Earnings 34830
Managementbusinessandfinancialoperationsoccupations Total.with.Earnings 12376
Managementoccupations Total.with.Earnings 7821
ChiefExecutivesGeneralandOperationsManagers Total.with.Earnings 781
Legislators Total.with.Earnings 24
AllotherManagers Total.with.Earnings 7017
Businessandfinancialoperationsoccupations Total.with.Earnings 4555
BusinessOperationsSpecialists Total.with.Earnings 2510
FinancialSpecialists Total.with.Earnings 2044
Professionalandrelatedoccupations Total.with.Earnings 22454
Computerandmathematicaloccupations Total.with.Earnings 1362
Computerscientistsanalystsprogrammersengineersandadministrators Total.with.Earnings 1234
Actuaries Total.with.Earnings 9
Mathematiciansstatisticiansoperationsresearchandothermathoccupations Total.with.Earnings 119
Architectureandengineeringoccupations Total.with.Earnings 523
Architectsexceptnaval Total.with.Earnings 57
SurveyorsCartographersandphonogrammetrists Total.with.Earnings 7
Engineers Total.with.Earnings 320
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians Total.with.Earnings 139
Lifephysicalandsocialscienceoccupations Total.with.Earnings 813
AstronomersandPhysicists Total.with.Earnings 2
Economists Total.with.Earnings 16
PsychologistsandSociologists Total.with.Earnings 206
Allotherscientists Total.with.Earnings 449
Sciencetechnicians Total.with.Earnings 140
Communityandsocialservicesoccupations Total.with.Earnings 1959
Legaloccupations Total.with.Earnings 902
LawyersJudgesandMagistrates Total.with.Earnings 373
ParalegalsLegalassistantsandLegalsupportworkers Total.with.Earnings 529
Educationtrainingandlibraryoccupations Total.with.Earnings 7740
Postsecondaryteachers Total.with.Earnings 703
Allotherteachers Total.with.Earnings 5618
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants Total.with.Earnings 1419
Artsdesignentertainmentsportsandmediaoccupations Total.with.Earnings 1812
Healthcarepractitionerandtechnicaloccupations Total.with.Earnings 7344
Doctors Total.with.Earnings 602
Nurses Total.with.Earnings 3850
Allotherhealthandtechnicaloccupations Total.with.Earnings 2892
Serviceoccupations Total.with.Earnings 17187
Healthcaresupportoccupations Total.with.Earnings 3364
Protectiveserviceoccupations Total.with.Earnings 801
Supervisors Total.with.Earnings 45
FirefightersandPolice Total.with.Earnings 175
Allotherprotectiveserviceoccupations Total.with.Earnings 581
Foodpreparationsandservingrelatedoccupations Total.with.Earnings 5232
Supervisors Total.with.Earnings 383
ChefsandCooks Total.with.Earnings 1102
Allotherfoodpreparationoccupations Total.with.Earnings 3748
Buildingandgroundscleaningandmaintenanceoccupations Total.with.Earnings 2747
Supervisors Total.with.Earnings 160
Allothermaintenanceoccupations Total.with.Earnings 2587
Personalcareandserviceoccupations Total.with.Earnings 5042
Supervisors Total.with.Earnings 241
Allotherpersonalcareandserviceoccupations Total.with.Earnings 4801
Salesandofficeoccupations Total.with.Earnings 21917
Salesandrelatedoccupations Total.with.Earnings 8639
Supervisors Total.with.Earnings 1926
Cashiers Total.with.Earnings 2860
Insurancesalesagents Total.with.Earnings 297
Realestatebrokersandsalesagents Total.with.Earnings 611
Allothersalesandrelatedoccupations Total.with.Earnings 2946
Officeandadministrativesupportoccupations Total.with.Earnings 13277
Supervisors Total.with.Earnings 877
Postalworkers Total.with.Earnings 241
Allotherofficeandadministrativesupportoccupations Total.with.Earnings 12159
Naturalresourcesconstructionandmaintenanceoccupations Total.with.Earnings 868
Farmingfishingandforestryoccupations Total.with.Earnings 364
Supervisors Total.with.Earnings 8
Allotherfarmingfishingandforestryoccupations Total.with.Earnings 356
Constructionandextractionoccupations Total.with.Earnings 324
Construction Total.with.Earnings 320
Supervisors Total.with.Earnings 13
Brickmasonsblockmasonsandstonemasons Total.with.Earnings 0
Carpenters Total.with.Earnings 40
Electricians Total.with.Earnings 23
Paintersandpaperhangers Total.with.Earnings 47
Sheetmetalworkers Total.with.Earnings 23
Structuralironandsteelworkers Total.with.Earnings 0
Allotherconstructiontrades Total.with.Earnings 174
Extractionworkers Total.with.Earnings 5
Installationmaintenanceandrepairoccupations Total.with.Earnings 180
Supervisors Total.with.Earnings 12
Aircraftmechanicsandservice Total.with.Earnings 8
Autobustruckheavyequipmentmechanics Total.with.Earnings 35
Heatingairconditioningandrefrigerationmechanicsandinstallers Total.with.Earnings 14
Electricalpowerlineandtelecommunicationslineinstallersandrepairers Total.with.Earnings 5
Allotheroccupations Total.with.Earnings 107
Productiontransportationandmaterialmovingoccupations Total.with.Earnings 4590
Productionoccupations Total.with.Earnings 2646
Supervisors Total.with.Earnings 204
Allotheroccupations Total.with.Earnings 2442
Transportationandmaterialmovingoccupations Total.with.Earnings 1944
Supervisors Total.with.Earnings 42
Aircraftpilotsandflightengineers Total.with.Earnings 10
Airtrafficcontrollersandairfieldoperationspecialists Total.with.Earnings 4
Autobustruckambulancetaxidrivers Total.with.Earnings 720
Railandsubwayworkers Total.with.Earnings 0
Shipcaptainsandengineers Total.with.Earnings 2
Allothertransportationoccupations Total.with.Earnings 1165
ArmedForces Total.with.Earnings 48
Total X.1.to..2.499.or.loss 3324
Managementscienceandartsoccupations X.1.to..2.499.or.loss 812
Managementbusinessandfinancialoperationsoccupations X.1.to..2.499.or.loss 173
Managementoccupations X.1.to..2.499.or.loss 133
ChiefExecutivesGeneralandOperationsManagers X.1.to..2.499.or.loss 8
Legislators X.1.to..2.499.or.loss 4
AllotherManagers X.1.to..2.499.or.loss 121
Businessandfinancialoperationsoccupations X.1.to..2.499.or.loss 41
BusinessOperationsSpecialists X.1.to..2.499.or.loss 29
FinancialSpecialists X.1.to..2.499.or.loss 12
Professionalandrelatedoccupations X.1.to..2.499.or.loss 639
Computerandmathematicaloccupations X.1.to..2.499.or.loss 15
Computerscientistsanalystsprogrammersengineersandadministrators X.1.to..2.499.or.loss 15
Actuaries X.1.to..2.499.or.loss 0
Mathematiciansstatisticiansoperationsresearchandothermathoccupations X.1.to..2.499.or.loss 0
Architectureandengineeringoccupations X.1.to..2.499.or.loss 2
Architectsexceptnaval X.1.to..2.499.or.loss 0
SurveyorsCartographersandphonogrammetrists X.1.to..2.499.or.loss 0
Engineers X.1.to..2.499.or.loss 0
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians X.1.to..2.499.or.loss 2
Lifephysicalandsocialscienceoccupations X.1.to..2.499.or.loss 10
AstronomersandPhysicists X.1.to..2.499.or.loss 0
Economists X.1.to..2.499.or.loss 0
PsychologistsandSociologists X.1.to..2.499.or.loss 2
Allotherscientists X.1.to..2.499.or.loss 3
Sciencetechnicians X.1.to..2.499.or.loss 5
Communityandsocialservicesoccupations X.1.to..2.499.or.loss 52
Legaloccupations X.1.to..2.499.or.loss 5
LawyersJudgesandMagistrates X.1.to..2.499.or.loss 0
ParalegalsLegalassistantsandLegalsupportworkers X.1.to..2.499.or.loss 5
Educationtrainingandlibraryoccupations X.1.to..2.499.or.loss 331
Postsecondaryteachers X.1.to..2.499.or.loss 20
Allotherteachers X.1.to..2.499.or.loss 246
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants X.1.to..2.499.or.loss 65
Artsdesignentertainmentsportsandmediaoccupations X.1.to..2.499.or.loss 190
Healthcarepractitionerandtechnicaloccupations X.1.to..2.499.or.loss 32
Doctors X.1.to..2.499.or.loss 0
Nurses X.1.to..2.499.or.loss 10
Allotherhealthandtechnicaloccupations X.1.to..2.499.or.loss 23
Serviceoccupations X.1.to..2.499.or.loss 1249
Healthcaresupportoccupations X.1.to..2.499.or.loss 75
Protectiveserviceoccupations X.1.to..2.499.or.loss 49
Supervisors X.1.to..2.499.or.loss 0
FirefightersandPolice X.1.to..2.499.or.loss 0
Allotherprotectiveserviceoccupations X.1.to..2.499.or.loss 49
Foodpreparationsandservingrelatedoccupations X.1.to..2.499.or.loss 471
Supervisors X.1.to..2.499.or.loss 14
ChefsandCooks X.1.to..2.499.or.loss 58
Allotherfoodpreparationoccupations X.1.to..2.499.or.loss 400
Buildingandgroundscleaningandmaintenanceoccupations X.1.to..2.499.or.loss 177
Supervisors X.1.to..2.499.or.loss 2
Allothermaintenanceoccupations X.1.to..2.499.or.loss 175
Personalcareandserviceoccupations X.1.to..2.499.or.loss 477
Supervisors X.1.to..2.499.or.loss 8
Allotherpersonalcareandserviceoccupations X.1.to..2.499.or.loss 468
Salesandofficeoccupations X.1.to..2.499.or.loss 993
Salesandrelatedoccupations X.1.to..2.499.or.loss 596
Supervisors X.1.to..2.499.or.loss 49
Cashiers X.1.to..2.499.or.loss 315
Insurancesalesagents X.1.to..2.499.or.loss 3
Realestatebrokersandsalesagents X.1.to..2.499.or.loss 6
Allothersalesandrelatedoccupations X.1.to..2.499.or.loss 224
Officeandadministrativesupportoccupations X.1.to..2.499.or.loss 397
Supervisors X.1.to..2.499.or.loss 9
Postalworkers X.1.to..2.499.or.loss 0
Allotherofficeandadministrativesupportoccupations X.1.to..2.499.or.loss 388
Naturalresourcesconstructionandmaintenanceoccupations X.1.to..2.499.or.loss 67
Farmingfishingandforestryoccupations X.1.to..2.499.or.loss 48
Supervisors X.1.to..2.499.or.loss 0
Allotherfarmingfishingandforestryoccupations X.1.to..2.499.or.loss 48
Constructionandextractionoccupations X.1.to..2.499.or.loss 13
Construction X.1.to..2.499.or.loss 13
Supervisors X.1.to..2.499.or.loss 0
Brickmasonsblockmasonsandstonemasons X.1.to..2.499.or.loss 0
Carpenters X.1.to..2.499.or.loss 0
Electricians X.1.to..2.499.or.loss 0
Paintersandpaperhangers X.1.to..2.499.or.loss 2
Sheetmetalworkers X.1.to..2.499.or.loss 0
Structuralironandsteelworkers X.1.to..2.499.or.loss 0
Allotherconstructiontrades X.1.to..2.499.or.loss 11
Extractionworkers X.1.to..2.499.or.loss 1
Installationmaintenanceandrepairoccupations X.1.to..2.499.or.loss 5
Supervisors X.1.to..2.499.or.loss 0
Aircraftmechanicsandservice X.1.to..2.499.or.loss 0
Autobustruckheavyequipmentmechanics X.1.to..2.499.or.loss 1
Heatingairconditioningandrefrigerationmechanicsandinstallers X.1.to..2.499.or.loss 0
Electricalpowerlineandtelecommunicationslineinstallersandrepairers X.1.to..2.499.or.loss 0
Allotheroccupations X.1.to..2.499.or.loss 4
Productiontransportationandmaterialmovingoccupations X.1.to..2.499.or.loss 204
Productionoccupations X.1.to..2.499.or.loss 88
Supervisors X.1.to..2.499.or.loss 0
Allotheroccupations X.1.to..2.499.or.loss 88
Transportationandmaterialmovingoccupations X.1.to..2.499.or.loss 115
Supervisors X.1.to..2.499.or.loss 0
Aircraftpilotsandflightengineers X.1.to..2.499.or.loss 3
Airtrafficcontrollersandairfieldoperationspecialists X.1.to..2.499.or.loss 0
Autobustruckambulancetaxidrivers X.1.to..2.499.or.loss 36
Railandsubwayworkers X.1.to..2.499.or.loss 0
Shipcaptainsandengineers X.1.to..2.499.or.loss 0
#melt.tablefemale3$Count

filter by few occupations

melt.tablefemale2 <- melt.tablefemale3 %>% filter(Earnings == "Median.earnings" | Earnings == "Mean.earnings" ) %>%  arrange(Earnings,desc(Count))
myselect <- c('Chief','Doctors','Nurses','FirefightersandPolice')
melt.tablefemale4 <- melt.tablefemale2   %>% filter(str_detect(Occupation, myselect) == TRUE)
head(melt.tablefemale2,n=200) %>% kable() %>% kable_styling()
Occupation Earnings Count
Doctors Median.earnings 130746
LawyersJudgesandMagistrates Median.earnings 106550
ChiefExecutivesGeneralandOperationsManagers Median.earnings 84746
Engineers Median.earnings 81366
Mathematiciansstatisticiansoperationsresearchandothermathoccupations Median.earnings 80688
Computerandmathematicaloccupations Median.earnings 71204
FirefightersandPolice Median.earnings 71146
Architectureandengineeringoccupations Median.earnings 70502
Computerscientistsanalystsprogrammersengineersandadministrators Median.earnings 70115
PsychologistsandSociologists Median.earnings 66465
Legaloccupations Median.earnings 61338
Managementoccupations Median.earnings 60153
Nurses Median.earnings 57313
Managementbusinessandfinancialoperationsoccupations Median.earnings 57292
AllotherManagers Median.earnings 57188
FinancialSpecialists Median.earnings 55986
Businessandfinancialoperationsoccupations Median.earnings 55648
Healthcarepractitionerandtechnicaloccupations Median.earnings 55303
BusinessOperationsSpecialists Median.earnings 55259
Allotherscientists Median.earnings 53372
Lifephysicalandsocialscienceoccupations Median.earnings 52262
Managementscienceandartsoccupations Median.earnings 51033
Postsecondaryteachers Median.earnings 50308
ParalegalsLegalassistantsandLegalsupportworkers Median.earnings 50149
Postalworkers Median.earnings 48473
Professionalandrelatedoccupations Median.earnings 47797
Allotherhealthandtechnicaloccupations Median.earnings 47197
Realestatebrokersandsalesagents Median.earnings 45244
Supervisors Median.earnings 44859
Supervisors Median.earnings 43196
Allotherteachers Median.earnings 42439
Communityandsocialservicesoccupations Median.earnings 41424
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians Median.earnings 41146
Insurancesalesagents Median.earnings 40573
Educationtrainingandlibraryoccupations Median.earnings 39973
Sciencetechnicians Median.earnings 38945
Supervisors Median.earnings 36912
Artsdesignentertainmentsportsandmediaoccupations Median.earnings 35798
Protectiveserviceoccupations Median.earnings 35117
Supervisors Median.earnings 34012
Total Median.earnings 32654
Officeandadministrativesupportoccupations Median.earnings 32380
Allotherofficeandadministrativesupportoccupations Median.earnings 31748
Allotherconstructiontrades Median.earnings 31483
Allotheroccupations Median.earnings 31242
Installationmaintenanceandrepairoccupations Median.earnings 30993
Construction Median.earnings 30848
Constructionandextractionoccupations Median.earnings 30773
Salesandofficeoccupations Median.earnings 30321
Supervisors Median.earnings 27077
Allotherprotectiveserviceoccupations Median.earnings 26808
Productionoccupations Median.earnings 26695
Healthcaresupportoccupations Median.earnings 26287
Naturalresourcesconstructionandmaintenanceoccupations Median.earnings 26210
Allotheroccupations Median.earnings 25979
Productiontransportationandmaterialmovingoccupations Median.earnings 25647
Autobustruckambulancetaxidrivers Median.earnings 23854
Allothersalesandrelatedoccupations Median.earnings 23697
Transportationandmaterialmovingoccupations Median.earnings 23324
Allothertransportationoccupations Median.earnings 22626
Salesandrelatedoccupations Median.earnings 22459
Supervisors Median.earnings 22246
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants Median.earnings 22232
Serviceoccupations Median.earnings 20028
Farmingfishingandforestryoccupations Median.earnings 19867
Allotherfarmingfishingandforestryoccupations Median.earnings 19550
Buildingandgroundscleaningandmaintenanceoccupations Median.earnings 19438
Allothermaintenanceoccupations Median.earnings 18804
Personalcareandserviceoccupations Median.earnings 18471
Allotherpersonalcareandserviceoccupations Median.earnings 17800
ChefsandCooks Median.earnings 17780
Foodpreparationsandservingrelatedoccupations Median.earnings 16103
Allotherfoodpreparationoccupations Median.earnings 14725
Cashiers Median.earnings 11982
Doctors Mean.earnings 160306
LawyersJudgesandMagistrates Mean.earnings 150715
ChiefExecutivesGeneralandOperationsManagers Mean.earnings 116422
Legaloccupations Mean.earnings 96760
Engineers Mean.earnings 86514
Mathematiciansstatisticiansoperationsresearchandothermathoccupations Mean.earnings 84371
Computerandmathematicaloccupations Mean.earnings 76283
Computerscientistsanalystsprogrammersengineersandadministrators Mean.earnings 75385
Managementoccupations Mean.earnings 74345
Architectureandengineeringoccupations Mean.earnings 73596
FirefightersandPolice Mean.earnings 73287
PsychologistsandSociologists Mean.earnings 71605
Managementbusinessandfinancialoperationsoccupations Mean.earnings 70552
AllotherManagers Mean.earnings 69750
Allotherscientists Mean.earnings 69723
Healthcarepractitionerandtechnicaloccupations Mean.earnings 68312
BusinessOperationsSpecialists Mean.earnings 65603
Lifephysicalandsocialscienceoccupations Mean.earnings 65565
Supervisors Mean.earnings 64742
Businessandfinancialoperationsoccupations Mean.earnings 64038
Nurses Mean.earnings 63441
FinancialSpecialists Mean.earnings 62117
Managementscienceandartsoccupations Mean.earnings 62071
ParalegalsLegalassistantsandLegalsupportworkers Mean.earnings 58652
Postsecondaryteachers Mean.earnings 57542
Professionalandrelatedoccupations Mean.earnings 57397
Realestatebrokersandsalesagents Mean.earnings 57280
Supervisors Mean.earnings 56233
Allotherhealthandtechnicaloccupations Mean.earnings 55654
Supervisors Mean.earnings 50661
DraftersEngineeringtechniciansandSurveyingandmappingtechnicians Mean.earnings 49960
Postalworkers Mean.earnings 49050
Artsdesignentertainmentsportsandmediaoccupations Mean.earnings 48890
Supervisors Mean.earnings 47610
Insurancesalesagents Mean.earnings 46017
Total Mean.earnings 44594
Communityandsocialservicesoccupations Mean.earnings 44543
Allotherteachers Mean.earnings 44013
Educationtrainingandlibraryoccupations Mean.earnings 42425
Allothersalesandrelatedoccupations Mean.earnings 42323
Protectiveserviceoccupations Mean.earnings 41860
Sciencetechnicians Mean.earnings 38617
Allotherconstructiontrades Mean.earnings 37971
Officeandadministrativesupportoccupations Mean.earnings 36384
Salesandofficeoccupations Mean.earnings 36034
Salesandrelatedoccupations Mean.earnings 35497
Allotherofficeandadministrativesupportoccupations Mean.earnings 35102
Constructionandextractionoccupations Mean.earnings 35010
Construction Mean.earnings 34879
Allotheroccupations Mean.earnings 33273
Installationmaintenanceandrepairoccupations Mean.earnings 32881
Naturalresourcesconstructionandmaintenanceoccupations Mean.earnings 32082
Productionoccupations Mean.earnings 30904
Allotherprotectiveserviceoccupations Mean.earnings 30830
Supervisors Mean.earnings 30619
Healthcaresupportoccupations Mean.earnings 29533
Productiontransportationandmaterialmovingoccupations Mean.earnings 29236
Farmingfishingandforestryoccupations Mean.earnings 29076
Allotherfarmingfishingandforestryoccupations Mean.earnings 28832
Allotheroccupations Mean.earnings 28788
ArchivistsCuratorsMuseumtechniciansLibrariansandOthertechniciansandassistants Mean.earnings 28651
Autobustruckambulancetaxidrivers Mean.earnings 28170
Personalcareandserviceoccupations Mean.earnings 27260
Supervisors Mean.earnings 26975
Transportationandmaterialmovingoccupations Mean.earnings 26966
Allothertransportationoccupations Mean.earnings 25566
Allotherpersonalcareandserviceoccupations Mean.earnings 25375
Serviceoccupations Mean.earnings 24848
Buildingandgroundscleaningandmaintenanceoccupations Mean.earnings 20689
Allothermaintenanceoccupations Mean.earnings 20074
ChefsandCooks Mean.earnings 19843
Foodpreparationsandservingrelatedoccupations Mean.earnings 19090
Allotherfoodpreparationoccupations Mean.earnings 18063
Cashiers Mean.earnings 14564
melt.tablefemale4  %>% kable() %>% kable_styling() 
Occupation Earnings Count
ChiefExecutivesGeneralandOperationsManagers Mean.earnings 116422
Nurses Mean.earnings 63441
wptable4 <- head(melt.tablefemale4, n=30)