├── ed_ret ├── __init__.py ├── utils.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ └── returns.cpython-37.pyc └── returns.py ├── README.md ├── data └── reasonable │ ├── fairstudentsocialr.xlsx │ ├── goodstudentsocialr.xlsx │ ├── poorstudentsocialr.xlsx │ ├── excellentstudentsocialr.xlsx │ └── ~$excellentstudentsocialr.xlsx └── scripts └── test.py /ed_ret/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ed_ret/utils.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # returns_to_education 2 | Computing returns to education based on The Case Against Education 3 | -------------------------------------------------------------------------------- /data/reasonable/fairstudentsocialr.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hatemr/returns_to_education/main/data/reasonable/fairstudentsocialr.xlsx -------------------------------------------------------------------------------- /data/reasonable/goodstudentsocialr.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hatemr/returns_to_education/main/data/reasonable/goodstudentsocialr.xlsx -------------------------------------------------------------------------------- /data/reasonable/poorstudentsocialr.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hatemr/returns_to_education/main/data/reasonable/poorstudentsocialr.xlsx -------------------------------------------------------------------------------- /ed_ret/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hatemr/returns_to_education/main/ed_ret/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /ed_ret/__pycache__/returns.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hatemr/returns_to_education/main/ed_ret/__pycache__/returns.cpython-37.pyc -------------------------------------------------------------------------------- /data/reasonable/excellentstudentsocialr.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hatemr/returns_to_education/main/data/reasonable/excellentstudentsocialr.xlsx -------------------------------------------------------------------------------- /data/reasonable/~$excellentstudentsocialr.xlsx: -------------------------------------------------------------------------------- 1 | Microsoft Office User Microsoft Office User -------------------------------------------------------------------------------- /scripts/test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('..') 3 | 4 | from ed_ret.returns import ReturnsCalc 5 | 6 | r = ReturnsCalc() 7 | # print(r.experience.head(3)) 8 | # print(r.crime_risk_factor.head(3)) 9 | # print(r.meta_df.columns.tolist()) 10 | # print(r.meta_df.head(3)) 11 | print(r.social_returns.head()) 12 | -------------------------------------------------------------------------------- /ed_ret/returns.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | class ReturnsCalc: 5 | 6 | def __init__(self, 7 | experience_premium=0.025): 8 | 9 | self.experience_premium = experience_premium 10 | self.experience = pd.DataFrame({'years_of_experience': list(range(52))}) 11 | self.experience.loc[:, 'experience_adjustment'] = (1 + experience_premium)**(self.experience.loc[:, 'years_of_experience']) 12 | 13 | self.excel_sheet = pd.ExcelFile('../data/reasonable/excellentstudentsocialr.xlsx') 14 | self.crime_risk_factor = self.excel_sheet.parse('Meta')[['Age', 'Crime Risk Factor']] 15 | 16 | self.meta_df = self.excel_sheet.parse('Meta')[['Years of Education', 17 | ' Pretax Income', 18 | 'Benefits', 19 | 'Unemployment Probability', 20 | 'Completion Probability', 21 | 'Participation Rate']].head(11) 22 | 23 | exp_norm = [np.mean(self.experience.loc[0:i,'experience_adjustment']) for i in range(self.experience.shape[0]-1, self.experience.shape[0]-12,-1)] 24 | self.meta_df.loc[:, 'Experience Normalization'] = exp_norm 25 | 26 | self.tuition = self.excel_sheet.parse('Meta').loc[0, ['High School Tuition', 27 | 'College Tuition', 28 | 'School Feelings', 29 | 'Nonparticipation Transfers']] 30 | self.social_data = self.excel_sheet.parse('Meta').loc[:, ['Social Income', 31 | 'Social Benefits', 32 | 'Social Unemployment', 33 | 'Social Crime Cost', 34 | 'Social Participation']] 35 | 36 | self.start_age = self.meta_df.loc[1,'Years of Education']+6 37 | self.pretax_income = self.meta_df.loc[1, ' Pretax Income'] 38 | self.benefits = self.meta_df.loc[1, 'Benefits'] 39 | self.unemployment_probability = self.meta_df.loc[1, 'Unemployment Probability'] 40 | self.participation = self.meta_df.loc[1, 'Participation Rate'] 41 | self.experience_normalization = self.meta_df.loc[1, 'Experience Normalization'] 42 | self.completion_probability = self.meta_df.loc[1, 'Completion Probability'] 43 | 44 | self.initial_social_participation = self.meta_df.loc[1, 'Completion Probability'] 45 | self.completion_probability = self.meta_df.loc[1, 'Completion Probability'] 46 | self.initial_social_participation = self.social_data.loc[0, 'Social Participation'] 47 | self.initial_unemployment = self.meta_df.loc[0, 'Unemployment Probability'] 48 | 49 | 50 | self.social_returns = self.compute_social_returns(self.start_age, 51 | self.pretax_income, 52 | self.benefits, 53 | self.unemployment_probability, 54 | self.participation, 55 | self.experience_normalization, 56 | self.completion_probability, 57 | self.initial_social_participation, 58 | self.initial_unemployment) 59 | 60 | def compute_social_returns(self, 61 | start_age, 62 | pretax_income, 63 | benefits, 64 | unemployment_probability, 65 | participation, 66 | experience_normalization, 67 | completion_probability, 68 | initial_social_participation, 69 | initial_unemployment): 70 | 71 | res = pd.DataFrame({'Age': list(range(15,91))}) 72 | return res --------------------------------------------------------------------------------