Step 07 - Standardize titles
Source:vignettes/step-07-standardize-titles.Rmd
step-07-standardize-titles.RmdAfter steps 01-06 a title is clean but still one of thousands of forms. standardize_titles() maps each one to a canonical title.standard, one of a few hundred titles that the taxonomy in step 08 describes. It works in three passes:
-
C-suite fixes (
basic_csuite_fixes()): a few titles are rewritten using pay and the officer box before the lookup. A paid CHANCELLOR is the CEO and an unpaid one the board president; a finance title held by a paid, full-time officer is the CFO. -
Exact match: the title is looked up in the title-standardization crosswalk, which lists every known variant.
title.matchisexact. -
Pattern match: a title the crosswalk does not list falls back to a learned rule for its longest known head. “MANAGER IT” ends in no known title but starts with MANAGER, which has a rule.
title.matchispattern. Titles whose head depends on context (DIRECTOR, PRESIDENT) have no rule, and a title with no rule stays uncoded (title.matchis NA).
Before and after
| before (TitleTxt6) | title.standard | title.match | strata | strata.label |
|---|---|---|---|---|
| EXECUTIVE DIRECTOR | EXECUTIVE DIRECTOR | exact | ||
| CEO | CEO | exact | ||
| HEAD OF SCHOOL | CEO | exact | ||
| PASTOR | PASTOR | exact | ||
| DIRECTOR | BOARD MEMBER | exact | ||
| DIRECTOR | BOARD MEMBER | exact | ||
| CHAIR OF BOARD | BOARD PRESIDENT | exact | ||
| CHAIR | BOARD PRESIDENT | exact | ||
| CHAIR | BOARD PRESIDENT | exact | ||
| VICE PRESIDENT | BOARD VICE PRESIDENT | exact | ||
| VICE CHAIR | BOARD VICE PRESIDENT | exact | ||
| TREASURER | BOARD TREASURER | exact | ||
| ASSISTANT TREASURER | BOARD TREASURER | exact | subordinate | assistant |
| SENIOR VICE PRESIDENT OF MARKETING | VICE PRESIDENT OF MARKETING | exact | superior | senior |
| EXECUTIVE VICE PRESIDENT | EXECUTIVE VICE PRESIDENT | exact | superior | executive |
| ADVISORY BOARD MEMBER | BOARD MEMBER | exact | duplex | advisory |
| REGIONAL DIRECTOR | BOARD MEMBER | exact | regional | regional |
| FINANCE COMMITTEE MEMBER | BOARD MEMBER | exact | ||
| STAFF PHYSICIAN | DOCTOR | exact | ||
| HEAD FOOTBALL COACH | COACH | exact | ||
| CAMP DIRECTOR | DIRECTOR | exact | ||
| MANAGER IT | MANAGER | pattern | NA | NA |
| HOSPITALIST PHYSICIAN | DOCTOR | pattern | NA | NA |
| SENIOR RABBI | NA | NA | NA | NA |
| CAMPUS ADVOCATE | NA | NA | NA | NA |
Things to notice:
- Many variants collapse onto one standard: DIRECTOR and DIR become BOARD MEMBER, CHAIR and CHAIR OF BOARD become BOARD PRESIDENT.
- A plain DIRECTOR is a board seat. A director of something (CAMP DIRECTOR, DIRECTOR OF DEVELOPMENT) is a staff job.
- The crosswalk drops rank words such as SENIOR, EXECUTIVE and ASSISTANT from the standard and keeps them in
strataandstrata.label: SENIOR VICE PRESIDENT OF MARKETING is a VICE PRESIDENT OF MARKETING at thesuperior/seniorstratum. - The standard is the title-only answer. A PRESIDENT may be the paid chief executive or the volunteer board chair. Step 07 files it as BOARD PRESIDENT, and step 09 decides from pay, hours and the checkboxes.
Assets
| Asset | Type | Used for | Load it with |
|---|---|---|---|
title.xwalk |
crosswalk (package data) | every known title.variant and its title.standard, strata and strata.label
|
get_title_xwalk() or data(title.xwalk)
|
title.patterns |
rules (package data) | head rules for titles the crosswalk does not list |
get_title_patterns() or data(title.patterns)
|
Their sources are data-raw/crosswalks/title-standardization.csv and title-patterns.csv in the source repository.
xwalk <- get_title_xwalk()
dim(xwalk)
#> [1] 9181 4
length(unique(xwalk$title.standard))
#> [1] 376
# all the variants that map to one standard
head(xwalk$title.variant[xwalk$title.standard == "CHIEF FINANCIAL OFFICER"], 15)
#> [1] "CFAO" "CFO"
#> [3] "CFO AND ASCENSION LIVING" "CFO AND CHI HEALTH"
#> [5] "CFO AND CIO" "CFO AND CONTINUING CARE"
#> [7] "CFO AND TREASURER" "CFO AT SSM HEALTH"
#> [9] "CFO AVERA HEALTH" "CFO BAYCARE HOSP DIV"
#> [11] "CFO CFO" "CFO OF BHS"
#> [13] "CFO OF CHI ST LUKE'S HEALTH SYSTEMS" "CFO OF COMMONBOND"
#> [15] "CFO PHC"
# the strata
table(xwalk$strata[xwalk$strata != ""])
#>
#> committee duplex exofficio regional regional? subordinate
#> 278 138 1 192 1 209
#> superior
#> 358Each pattern rule names a head word or phrase, where it sits (prefix or suffix), the standard it maps to, and how well it did on titles the crosswalk does list (support titles, precision the share it got right). majority rules map to the most common standard among titles with that head; level rules keep the head’s own standard.
pat <- get_title_patterns()
dim(pat)
#> [1] 121 6
head(pat[order(-pat$support), ], 10)
#> position head title.standard rule support precision
#> 110 suffix REPRESENTATIVE BOARD MEMBER majority 300 0.963
#> 65 suffix CHAIR BOARD MEMBER majority 261 0.881
#> 116 suffix TRUSTEE BOARD MEMBER majority 125 0.864
#> 97 suffix MEMBER BOARD MEMBER majority 113 0.912
#> 11 prefix BOARD BOARD MEMBER majority 107 0.822
#> 73 suffix COMMITTEE BOARD MEMBER majority 107 0.869
#> 63 suffix BOARD MEMBER BOARD MEMBER majority 99 0.889
#> 74 suffix COMMITTEE CHAIR BOARD MEMBER majority 70 0.971
#> 50 prefix TRUSTEE BOARD MEMBER majority 68 0.868
#> 34 prefix MEMBER BOARD MEMBER majority 65 0.862Try it
match_title_patterns(c("MANAGER IT", "HOSPITALIST PHYSICIAN", "SENIOR RABBI"))
#> [1] "MANAGER" "DOCTOR" NA
title_heads(c("FINANCE COMMITTEE MEMBER", "VICE PRESIDENT OF CLINICAL INTEGRATION"),
xwalk$title.variant)
#> suffix prefix
#> 1 COMMITTEE MEMBER FINANCE COMMITTEE
#> 2 INTEGRATION VICE PRESIDENT OF CLINICALInput: TitleTxt6. Output: TitleTxt7 (after the C-suite fixes), title.standard, title.match, strata and strata.label. Continue with step 08.