-
Notifications
You must be signed in to change notification settings - Fork 204
Expand file tree
/
Copy pathincome.py
More file actions
77 lines (62 loc) · 2.22 KB
/
income.py
File metadata and controls
77 lines (62 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from policyengine_us.model_api import *
label = "Income"
class employment_income_before_lsr(Variable):
value_type = float
entity = Person
label = "employment income before labor supply responses"
unit = USD
definition_period = YEAR
uprating = "calibration.gov.irs.soi.employment_income"
class self_employment_income_before_lsr(Variable):
value_type = float
entity = Person
label = "self-employment income before labor supply responses"
unit = USD
definition_period = YEAR
uprating = "calibration.gov.irs.soi.self_employment_income"
class employment_income(Variable):
value_type = float
entity = Person
label = "employment income"
documentation = "Wages and salaries, including tips and commissions."
unit = USD
definition_period = YEAR
adds = [
"employment_income_before_lsr",
"employment_income_behavioral_response",
]
uprating = "calibration.gov.irs.soi.employment_income"
class self_employment_income(Variable):
value_type = float
entity = Person
label = "self-employment income"
unit = USD
documentation = "Self-employment non-farm income."
definition_period = YEAR
adds = [
"self_employment_income_before_lsr",
"self_employment_income_behavioral_response",
]
uprating = "calibration.gov.irs.soi.self_employment_income"
class emp_self_emp_ratio(Variable):
value_type = float
entity = Person
label = "employment-to-self-employment income ratio"
unit = "/1"
definition_period = YEAR
def formula(person, period, parameters):
employment_income = person("employment_income", period)
self_employment_income = person("self_employment_income", period)
earnings = employment_income + self_employment_income
res = np.ones_like(earnings)
mask = earnings > 0
res[mask] = employment_income[mask] / earnings[mask]
return res
class farm_income(Variable):
value_type = float
entity = Person
label = "farm income"
unit = USD
documentation = "Income from agricultural businesses. Do not include this income in self-employment income."
definition_period = YEAR
uprating = "calibration.gov.irs.soi.farm_income"