Pathologists Pay Raise Analysis

In [125]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
df = pd.DataFrame.from_csv('data/data.csv')
df['Package'] = df['Salary'] + df['Benefits']
In [134]:
# Filter for Pathologists
df_path = df[df['Position'].map(lambda x: ('patholog' in str(x).lower()) and ('speech' not in str(x).lower()))]

Positions Mapped to Pathologist

In [135]:
set(df_path['Position'])
Out[135]:
{'Administrative Director Pathology',
 'Administrative Director, Laboratory And Pathology / Directrice administrative, Laboratoire et Pathologie',
 'Administrative Director, Pathology',
 'Administrative Director, Pathology & Laboratory Medicine',
 'Administrative Director, Pathology and Laboratory Medicine',
 'Anatomic Pathologist',
 'Anatomic Pathologist / Assistant Professor',
 'Anatomic Pathologist / Associate Professor',
 'Anatomic Pathologist / Professor',
 'Anatomic Pathologist, Assistant Professor',
 'Anatomic Pathologist, Associate Professor',
 'Anatomic Pathologist, Professor',
 'Anatomical (Paediatric) Pathologist',
 'Anatomical Pathologist',
 'Anatomical Pathologist / Anatomopathologiste',
 'Anatomical Pathologist / Anatompoathologiste',
 'Anatomical Pathologist/Anatompoathologiste',
 'Anatotomic Pathologist',
 'AsSt. Director II, Pathology',
 'AsSt. Director II,Pathology',
 'AsSt. Director, Pathology',
 "Ass't. Director, Pathology",
 'Assist Prof Pathology',
 'Assist. Prof, Pathology & Molecular Med.',
 'Assist. Prof., Pathology',
 'Assist.Prof.Pathology',
 'Assistant Chief, Pathology',
 'Assistant Pathologist',
 'Assistant Professor Pathology',
 'Assistant Professor \xe2\x80\x93 Pathology and Molecular Medicine',
 'Assistant Professor, Pathology',
 'Assistant Professor, Pathology & Molecular Medicine',
 'Assistant Professor, Pathology and Molecular Medicine',
 'Assoc. Dir. I, Pathology',
 'Assoc. Dir. II, Pathology',
 'Assoc. Director I, Pathology',
 'Assoc. Director II, Pathology',
 'Assoc. Pathologist',
 'Assoc. Prof., Pathology & Molecular Med.',
 'Associate Director I, Pathology',
 'Associate Director II, Pathology',
 'Associate Director, Pathology',
 'Associate Director, Pathology / Directeur adjoint, Pathologie',
 'Associate Director, Pathology / Directrice adjointe, Pathologie',
 'Associate Head of Pathology',
 'Associate Head, Pathology',
 'Associate Pathologist',
 'Associate Pathologist / Pathologiste adjoint',
 'Associate Pathologist / Pathologiste associ\xc3\xa9(e)',
 'Associate Pathologist 1',
 'Associate Pathologist I',
 'Associate Pathologist II',
 'Associate Pathologist/Pathologiste adjoint',
 'Associate Pathologist/Pathologiste adjointe',
 'Associate Professor - Pathology and Molecular Medicine',
 'Associate Professor Pathology & Molecular Medicine',
 'Associate Professor \xe2\x80\x93 Pathology and Molecular Medicine',
 'Associate Professor \xe2\x80\x93 Pathology and Molecular Medicine, Associate Professor \xe2\x80\x93 Biomedical and Molecular Science',
 'Associate Professor, Pathology',
 'Associate Professor, Pathology & Molecular Medicine',
 'Associate Professor, Pathology and Molecular Medicine',
 'Assoicate Pathologist',
 'Asst Chief, Pathology',
 'Asst. Prof, Pathology & Molecular Med.',
 'Asst. Prof., Pathology & Molecular Med',
 'Asst. Prof., Pathology & Molecular Med.',
 'BC, Genetics/Mol Med,Pathology/Mol Med/CRC,Tier 1,Hlth Sci/Prof,Pathology, Mol Med',
 'Bracken Chr, Genetics/Mol Med, Path/Molecular Med/Prof, Pathology/Mol Med/CRC, Tier 1',
 'CRC & Professor, Pathology',
 'CRC Tier 1, Hlth Sci/BC, Genetics/Mol Med, Pathology/Mol Med/Prof, Pathology & Mol Med',
 'CRC/Prof., Pathology & Molecular Med.',
 'Canada Research Chair & Professor, Pathology & Molecular Medicine',
 'Chief - Pathology',
 'Chief Forensic Pathologist',
 'Chief Forensic Pathologist / M\xc3\xa9decin l\xc3\xa9giste en chef',
 'Chief Forensic Pathologist \xc2\xa0/\xc2\xa0 M\xc3\xa9decin l\xc3\xa9giste en chef',
 'Chief Forensic Pathologist\xc2\xa0/\xc2\xa0M\xc3\xa9decin l\xc3\xa9giste en chef',
 'Chief Of Pathology And Laboratory Director',
 'Chief Pathologist',
 'Chief Pathologist-Humber Memorial',
 'Chief Pathology',
 'Chief of Laboratory and Pathology',
 'Chief of Laboratory/Pathology',
 'Chief of Pathology',
 'Chief of Pathology & Lab Director',
 'Chief of Pathology & Lab Med. Director',
 'Chief of Pathology & Laboratory Services',
 'Chief of Pathology/Dir. Lab. Med.',
 'Chief of Pathology/Dir. Lab. Medicine',
 'Chief, Anatomical Pathology',
 'Chief, Pathology',
 'Chief, Pathology & Lab Director',
 'Chief, Pathology & Lab Medical Director',
 'Chief, Pathology & Laboratory',
 'Chief, Pathology & Laboratory Director',
 'Chief, Pathology & Medical Lab Director',
 'Chief, Pathology and Lab Director',
 'Chief, Pathology/Lab Director',
 'Chief, Pathology/Laboratory Director',
 'Clinical Program Manager, Disease Pathway Management / Directeur Des Programmes Cliniques, Gestion Des Voies Pathologiques',
 'Co-Ordinator, Clinical Pathology',
 'Co-ordinator, Clinical Pathology Regional Blood Network',
 'Dep. Hd., Pathology & Molecular Medicine',
 'Department Head, Pathology and Molecular Medicine and Professor, Pathology and Molecular Medicine',
 'Deputy Head, Department of Pathology',
 'Deputy Head, Dept. of Pathology',
 'Deputy Provost, Office of Provost and Vice-Principal (Academic) and Bracken Chair In Genetics & Molecular Medicine, Pathology & Molecular Medicine and Canada Research Chair, Tier 1, Faculty of Health Sciences and Professor, Pathology & Molecular Medicine',
 'Dir Cancer Research & Prof. Pathology',
 'Dir. Cancer Research\xc2\xa0 Prof, Pathology',
 'Dir. Division of Anatomic Pathology',
 'Dir. Division of Anotomic Pathology',
 'Dir. of Neuropathology',
 'Dir., Anatomic Pathology',
 'Dir., Cancer Research Institute, Health Sciences/Prof., Pathology & Molecular Medicine',
 'Dir., Cancer Research/ Prof., Pathology',
 'Dir., Cancer Research/Prof., Pathology',
 'Dir., Division, Anatomic Pathology',
 'Dir., Pathology',
 'Director Cancer Research & Professor, Pathology',
 'Director Cytopathology',
 'Director Division, Anatomic Pathology',
 'Director Pathology',
 'Director of Laboratory/Pathology',
 'Director of Neuropathology',
 'Director, Division of Anatomic Pathology',
 'Director, Haematopathology',
 'Director, Laboratory Services/Chief Pathologist',
 'Director, Molecular Pathology',
 'Director, Pathology',
 'Director, Pathology / Directeur, Pathologie',
 'Div Head, Haematopathology',
 'Div. Head, Haematopathology',
 'Division Head Haematopathology',
 'Division Head Pathology',
 'Division Head, Haematopathology',
 'Division Head, Pathology',
 'Doctor - Pathologist',
 'Doctor-Pathologist',
 'Forensic Pathologist',
 'Forensic Pathologist / Assistant Professor',
 'Forensic Pathologist / Associate Professor',
 'Forensic Pathologist / M\xc3\xa9decin l\xc3\xa9giste',
 'Forensic Pathologist \xc2\xa0/\xc2\xa0 M\xc3\xa9decin l\xc3\xa9giste',
 'Forensic Pathologist, Assistant Professor',
 'Forensic Pathologist, Associate Professor',
 'Forensic Pathologist\xc2\xa0/\xc2\xa0M\xc3\xa9decin l\xc3\xa9giste',
 'Haematopathologist',
 'Head, Cytopathology',
 'Head, Dept. of Pathology',
 'Head, M.D.: Cytopathology',
 'Head, M.D.: Neuropathology',
 'Head, M.D.: Pathology',
 'Head, M.D.: Pathology: Admin Ii',
 'Head, M.D.: Pathology: Admin. I',
 'Head, Pathology',
 'Head, Pathology & Molecular Medicine & Professor, Pathology & Molecular Medicine',
 'Head, Pathology & Molecular Medicine and Professor, Pathology & Molecular Medicine',
 'Head, Ph.D.: Pathology',
 'Head, Surgical Pathology',
 'Hematopathologist',
 'Hematopathologist - Path&Molecular Med. / H\xc3\xa9matopathologiste en pathologie et m\xc3\xa9decine mol\xc3\xa9culaire',
 'Hematopathologist \xe2\x80\x93 Pathology & Molecular Medicine / H\xc3\xa9matopathologiste \xe2\x80\x93 Medicene pathologique & mol\xc3\xa9culaire',
 'Hemotopathologist',
 'Information Systems Officer, Pathology & Laboratory Medicine',
 'Joseph Stauffer Chair, Pathology',
 'Lab Dir, Pathologist',
 'Lab Director / Pathologist',
 'Lab Director, Pathologist',
 'Lab Pathologist',
 'Lab. Pathologist',
 'Laboratory Pathologist',
 'Laboratory Pathologist / Pathologiste du laboratoire',
 'Laboratory Pathologist/Pathologiste du laboratoire',
 'M.D., Chief Pathologist',
 'M.D., Pathologist',
 'M.D., Pathology',
 'Manager for Pathology Services',
 'Manager, Anatomical Pathology',
 'Manager, Pathology & Laboratory Medicine',
 'Manager, Pathology and Laboratory Medicine',
 'Medical Chief, Pathology',
 'Medical Dir., Laboratory/Pathologist',
 'Medical Director, Clinical Lab Services / Pathologiste',
 'Neuropathologist',
 'Neuropathologist / Associate Professor',
 'Neuropathologist / Professor',
 'Neuropathologist, Associate Professor',
 'Neuropathologist, Professor',
 'PATHOLOGIST-IN-CHIEF',
 'Paediatric Pathologist',
 'Pathologist',
 'Pathologist & Discipline Director',
 'Pathologist & Laboratory Director',
 'Pathologist & Medical Director, Laboratory',
 'Pathologist - General',
 'Pathologist - General / Pathologiste g\xc3\xa9n\xc3\xa9ral',
 'Pathologist - General/Pathologiste g\xc3\xa9n\xc3\xa9ral',
 'Pathologist - Pathology / Pathologiste',
 'Pathologist - in - Chief',
 'Pathologist / Gestionnaire de programme, Programme de services centraux de traitement',
 'Pathologist / Pathologiste',
 'Pathologist Level 0',
 'Pathologist and Director, Laboratory Medicine',
 'Pathologist \xe2\x80\x93 General / Pathologiste g\xc3\xa9n\xc3\xa9ral',
 'Pathologist \xe2\x80\x93 Pathology / Pathologiste',
 'Pathologist, Associate Dean, Vice President',
 'Pathologist, Chief of Laboratory Medicine, and Medical Director of Laboratory Service / Pathologiste & Directeur',
 'Pathologist, Department Head',
 'Pathologist, General',
 'Pathologist, Lab Director',
 'Pathologist, Laboratory Medical Director and Chief of Medical Staff',
 'Pathologist, Locum Tenens',
 'Pathologist, Medical Lab.',
 'Pathologist, Pathology',
 'Pathologist, Physician',
 'Pathologist, Sr',
 'Pathologist, Sr.',
 'Pathologist- General',
 'Pathologist- in- Chief',
 'Pathologist-Humber Memorial Hospital',
 'Pathologist-In-Chief',
 'Pathologist-in-Chief',
 'Pathologist/ - Pathologiste',
 'Pathologist/ Anatomopathologiste',
 'Pathologist/ Pathologiste',
 'Pathologist/Assoc Dean/VP, Res, FHS, KGH',
 'Pathologist/Assoc. Dean/VP, Res FHS,KGH',
 'Pathologist/Assoc. Dir. of Lab.',
 'Pathologist/Chief, Laboratories',
 'Pathologist/Department Head, Pathology',
 'Pathologist/Director of Laboratory',
 'Pathologist/Director, Laboratory Medicine',
 'Pathologist/Discipline Director',
 'Pathologist/Laboratory Director',
 'Pathologist/Laboratory Medical Director',
 'Pathologist/Medical Director, Laboratory',
 'Pathologist/Pathologiste',
 'Pathologist; Assoc Dean,VP(Res) FHS,KGH',
 'Pathologiste',
 "Pathologists' Assistant",
 'Pathologist\xe2\x80\x93in\xe2\x80\x93Chief',
 'Pathology Assistant',
 'Pathology Assistant 2/ - Pathologiste Adjoint 2',
 'Pediatric Pathologist',
 'Physician, Director Anatomic Pathology',
 'Platform Leader, Transformative Pathology',
 'Postdoctoral Fellow - Pathology and Molecular Medicine, Assistant Professor - Pathology and Molecular Medicine',
 'Prof,. Pathology',
 'Prof. & Head, Dept. of Pathology',
 'Prof. & Head. Dept. of Pathology',
 'Prof., Pathology',
 'Prof., Pathology & Laboratory Medicine',
 'Prof., Pathology & Molecular Med.',
 'Prof., Pathology & Molecular Medicine',
 'Prof., Pathology and Oncology',
 'Prof., Pharma./Toxicology, Oncalogy, Pathology',
 'Professor & Head, Dept. of Pathology',
 'Professor - Pathology and Molecular Medicine',
 'Professor - Pathology and Molecular Medicine, Bracken Chair in Genetics and Molecular Medicine - Pathology and Molecular Medicine, Canada Research Chair, Tier 1 - Pathology and Molecular Medicine',
 'Professor - Pathology and Molecular Medicine, Department Head - Pathology and Molecular Medicine',
 'Professor - Pathology and Molecular Medicine, Director (Cancer Research Institute) - Health Science, Vice-Dean (Research and Research Development) - Faculty of Health Science, Joseph Stauffer Chair/Director (Cancer Research) - Faculty of Health Science',
 'Professor Pathology',
 'Professor and Acting Chair of Pathology and Clinical Biochemistry',
 'Professor of Pathology',
 'Professor of Pathology and Head, Experimental Pathology',
 'Professor \xe2\x80\x93 Pathology and Molecular Medicine',
 'Professor \xe2\x80\x93 Pathology and Molecular Medicine, Bracken Chair in Genetics and Molecular Medicine \xe2\x80\x93 Pathology and Molecular Medicine, Canada Research Chair, Tier 1 \xe2\x80\x93 Biomedical and Molecular Science, Deputy Provost \xe2\x80\x93 Provost and Vice\xe2\x80\x93Principal (Academic)',
 'Professor \xe2\x80\x93 Pathology and Molecular Medicine, Department Head \xe2\x80\x93 Pathology and Molecular Medicine',
 'Professor, Pathology',
 'Professor, Pathology & Molecular Med',
 'Professor, Pathology & Molecular Med.',
 'Professor, Pathology & Molecular Medicine',
 'Professor, Pathology & Molecular Medicine/Director (Cancer Research Institute), Faculty of Health Science/Vice\xe2\x80\x93Dean (Research & Research Development), Faculty of Health Science, Joseph Stauffer Chair/Director Cancer Research \xe2\x80\x93 Faculty of Health Science',
 'Professor, Pathology and Molecular Medicine',
 'Program Manager, Stage Capture & Pathology Reporting / Directeur De Projet, D\xc3\xa9termination Du Stade Et Signalement Des Pathologies',
 'Program Manager, Stage Capture & Pathology Reporting \xc2\xa0/\xc2\xa0 Directrice de projet, d\xc3\xa9termination du stade et signalement des pathologies',
 'Program Manager, Stage Capture & Pathology Reporting\xc2\xa0/\xc2\xa0Directrice de projet, d\xc3\xa9termination du stade et signalement des pathologies',
 'Program Manager, Stage Capture And Pathology Reporting',
 'Research Pathologist',
 'Sect Head, Human Neurochemical Pathology',
 'Senior Assoc. Pathologist',
 'Senior Associate Pathologist',
 'Senior Associate Pathologist / Pathologiste associ\xc3\xa9(e) principal(e)',
 'Senior Manager, Pathology & Laboratory Medicine',
 'Senior Pathologist',
 'Senior Pathologists Assistant',
 'Senior Pathology Assistant',
 'Sr. Associate Pathologist',
 'Sr. Pathology Assistant',
 'Sr. Pathology Asst.',
 'Staff Neuro Pathologist',
 'Staff Pathologist',
 'Staff Pathologist/Associate Chair',
 'Staff Pathologist/Associate Chief',
 'Veterinary Clinical Pathologist',
 'Veterinary Pathologist',
 'Vice-Dean, Medical Education, School of Medicine and Associate Professor, Biomedical and Molecular Sciences and Associate Professor, Pathology and Molecular Medicine',
 'Vice-Dean, Research & Research Development, Faculty of Health Sciences and Director, Cancer Research Institute, Faculty of Health Sciences and Joseph Stauffer Chair/Dir Cancer Research and Professor, Pathology and Molecular Medicine'}

Number of Pathologists on List by Year

In [141]:
year_counts = df_path['year'].value_counts()
year_counts = year_counts.sort_index()
year_counts
Out[141]:
1997    136
1998    124
1999    125
2000    134
2001    168
2002    150
2003    144
2004    174
2005    146
2006    177
2007    207
2008    221
2009    239
2010    248
2011    256
2012    244
2013    270
2014    296
dtype: int64

Pay Raises

Note that it would be wrong to simply calculate the average pay of all pathologists on the list each year and compare. This is a fundamental aspect of doing analysis on the list. Each year salaries across the board rightly increase, roles "graduate" to the sunshine list and bring down the average pay when in fact salaries are increasing.

Instead we compare the average salary of the top N from each year and the year before. Below I take that N to be the maximum possible.

In [138]:
path_pay_raises = []

for year in range(1998,2015):
    n_last_year = year_counts[year-1]
    n_this_year = year_counts[year]
    n_compare = min(n_last_year, n_this_year)
    
    df_last = df_path[df_path['year']==(year-1)]
    df_last = df_last.sort('Package',ascending=0)
    paid_last_year = df_last['Package'].values[:n_compare].sum()
    
    df_this = df_path[df_path['year']==year]
    df_this = df_this.sort('Package',ascending=0)
    paid_this_year = df_this['Package'].values[:n_compare].sum()

    path_pay_raises.append({'year':year,'raise':((paid_this_year / paid_last_year) - 1)})
In [139]:
df_path_pay_raises = pd.DataFrame(path_pay_raises)
df_path_pay_raises = df_path_pay_raises.set_index('year')
In [140]:
ind = np.arange(len(df_path_pay_raises))
plt.bar(ind,df_path_pay_raises['raise'])
ax=plt.gca()
ax.set_ylabel('Pay Raise')
ax.set_title('Pay Raises for "Pathologists" by Year')
ax.set_xticks(ind+0.5)
ax.set_xticklabels(df_path_pay_raises.index)
plt.gcf().set_size_inches(10,10)

#from matplotlib.ticker import FuncFormatter
#formatter = FuncFormatter(matplotlib.to_percent)

from matplotlib.ticker import FuncFormatter 
def formatter(x, pos=0): 
     return '%1.0f%%'%(100*x)
plt.gca().yaxis.set_major_formatter(FuncFormatter(formatter))

plt.show()