-
Notifications
You must be signed in to change notification settings - Fork 0
/
iscooesch.ado
369 lines (304 loc) · 19 KB
/
iscooesch.ado
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
********************************************************************************
* This is a 1-1 adaptation of the .do file by Amal Tawfik, University of Geneva
* found at http://people.unil.ch/danieloesch/scripts/
*
* There are two differences in this .ado:
* (1) It only performs the conversion for one person and hence doesn't do the
* final step of filling in Respondent missings with Partner class.
* (2) The original .do file uses only a limited "emprelp" and ignores "emplnop"
* entirely for the partner. Since this .ado can be used to calculate the
* class position for anyone, it uses the more complete conversion found for
* the respondent in the original script.
*
* see 'help iscooesch' for more Info
*
********************************************************************************
* May 2018 - Simon Kaiser, University of Bern
********************************************************************************
program define iscooesch
version 7
syntax newvarname, isco(varname numeric) emplrel(varname numeric) emplno(varname numeric) [sixteen eight five replace]
if "`sixteen'"=="sixteen" | ("`eight'"!="eight" & "`five'"!="five") {
capture confirm variable oesch16_`varlist'
if !_rc & "`replace'"!="replace" {
display as error "Error: One or multiple of the variables to be generated already exist. Specify option 'replace' to overwrite them."
exit 110
}
}
if "`eight'"=="eight"{
capture confirm variable oesch8_`varlist'
if !_rc & "`replace'"!="replace" {
display as error "Error: One or multiple of the variables to be generated already exist. Specify option 'replace' to overwrite them."
exit 110
}
}
if "`five'"=="five"{
capture confirm variable oesch5_`varlist'
if !_rc & "`replace'"!="replace" {
display as error "Error: One or multiple of the variables to be generated already exist. Specify option 'replace' to overwrite them."
exit 110
}
}
display as text "Converting ISCO08 codes to Oesch classification."
**** recode occupation variable (isco08 com 4-digit) for respondents
tempvar tmpisco
qui gen `tmpisco' = `isco'
qui recode `tmpisco' (missing=-9)
**** recode employment status for respondents
tempvar tmpemplrel
qui gen `tmpemplrel' = `emplrel'
qui recode `tmpemplrel' (missing=9)
tempvar tmpemplno
qui gen `tmpemplno' = `emplno'
qui recode `tmpemplno' (0=0)(1/9=1)(10/max=2)(missing=0)
tempvar selfem_mainjob
qui gen `selfem_mainjob' = .
qui replace `selfem_mainjob'=1 if `tmpemplrel'==1 | `tmpemplrel'==9
qui replace `selfem_mainjob'=2 if `tmpemplrel'==2 & `tmpemplno'==0
qui replace `selfem_mainjob'=2 if `tmpemplrel'==3
qui replace `selfem_mainjob'=3 if `tmpemplrel'==2 & `tmpemplno'==1
qui replace `selfem_mainjob'=4 if `tmpemplrel'==2 & `tmpemplno'==2
*************************************************
* Create Oesch class schema for respondents
*************************************************
tempvar oesch16
qui gen `oesch16' = -9
* Large employers (1)
qui replace `oesch16'=1 if `selfem_mainjob'==4
* Self-employed professionals (2)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2000 & `tmpisco' <= 2162)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2164 & `tmpisco' <= 2165)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2200 & `tmpisco' <= 2212)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' == 2250)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2261 & `tmpisco' <= 2262)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2300 & `tmpisco' <= 2330)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2350 & `tmpisco' <= 2352)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2359 & `tmpisco' <= 2432)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2500 & `tmpisco' <= 2619)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' == 2621)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2630 & `tmpisco' <= 2634)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2636 & `tmpisco' <= 2640)
qui replace `oesch16'=2 if (`selfem_mainjob'==2 | `selfem_mainjob'==3) & (`tmpisco' >= 2642 & `tmpisco' <= 2643)
* Small business owners with employees (3)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 1000 & `tmpisco' <= 1439)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2163)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2166)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 2220 & `tmpisco' <= 2240)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2260)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 2263 & `tmpisco' <= 2269)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 2340 & `tmpisco' <= 2342)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 2353 & `tmpisco' <= 2356)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 2433 & `tmpisco' <= 2434)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2620)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2622)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2635)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' == 2641)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 2650 & `tmpisco' <= 2659)
qui replace `oesch16'=3 if (`selfem_mainjob'==3) & (`tmpisco' >= 3000 & `tmpisco' <= 9629)
* Small business owners without employees (4)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 1000 & `tmpisco' <= 1439)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2163)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2166)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 2220 & `tmpisco' <= 2240)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2260)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 2263 & `tmpisco' <= 2269)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 2340 & `tmpisco' <= 2342)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 2353 & `tmpisco' <= 2356)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 2433 & `tmpisco' <= 2434)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2620)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2622)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2635)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' == 2641)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 2650 & `tmpisco' <= 2659)
qui replace `oesch16'=4 if (`selfem_mainjob'==2) & (`tmpisco' >= 3000 & `tmpisco' <= 9629)
* Technical experts (5)
qui replace `oesch16'=5 if (`selfem_mainjob'==1) & (`tmpisco' >= 2100 & `tmpisco' <= 2162)
qui replace `oesch16'=5 if (`selfem_mainjob'==1) & (`tmpisco' >= 2164 & `tmpisco' <= 2165)
qui replace `oesch16'=5 if (`selfem_mainjob'==1) & (`tmpisco' >= 2500 & `tmpisco' <= 2529)
* Technicians (6)
qui replace `oesch16'=6 if (`selfem_mainjob'==1) & (`tmpisco' >= 3100 & `tmpisco' <= 3155)
qui replace `oesch16'=6 if (`selfem_mainjob'==1) & (`tmpisco' >= 3210 & `tmpisco' <= 3214)
qui replace `oesch16'=6 if (`selfem_mainjob'==1) & (`tmpisco' == 3252)
qui replace `oesch16'=6 if (`selfem_mainjob'==1) & (`tmpisco' >= 3500 & `tmpisco' <= 3522)
* Skilled manual (7)
qui replace `oesch16'=7 if (`selfem_mainjob'==1) & (`tmpisco' >= 6000 & `tmpisco' <= 7549)
qui replace `oesch16'=7 if (`selfem_mainjob'==1) & (`tmpisco' >= 8310 & `tmpisco' <= 8312)
qui replace `oesch16'=7 if (`selfem_mainjob'==1) & (`tmpisco' == 8330)
qui replace `oesch16'=7 if (`selfem_mainjob'==1) & (`tmpisco' >= 8332 & `tmpisco' <= 8340)
qui replace `oesch16'=7 if (`selfem_mainjob'==1) & (`tmpisco' >= 8342 & `tmpisco' <= 8344)
* Low-skilled manual (8)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' >= 8000 & `tmpisco' <= 8300)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' >= 8320 & `tmpisco' <= 8321)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' == 8341)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' == 8350)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' >= 9200 & `tmpisco' <= 9334)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' >= 9600 & `tmpisco' <= 9620)
qui replace `oesch16'=8 if (`selfem_mainjob'==1) & (`tmpisco' >= 9622 & `tmpisco' <= 9629)
* Higher-grade managers and administrators (9)
qui replace `oesch16'=9 if (`selfem_mainjob'==1) & (`tmpisco' >= 1000 & `tmpisco' <= 1300)
qui replace `oesch16'=9 if (`selfem_mainjob'==1) & (`tmpisco' >= 1320 & `tmpisco' <= 1349)
qui replace `oesch16'=9 if (`selfem_mainjob'==1) & (`tmpisco' >= 2400 & `tmpisco' <= 2432)
qui replace `oesch16'=9 if (`selfem_mainjob'==1) & (`tmpisco' >= 2610 & `tmpisco' <= 2619)
qui replace `oesch16'=9 if (`selfem_mainjob'==1) & (`tmpisco' == 2631)
qui replace `oesch16'=9 if (`selfem_mainjob'==1) & (`tmpisco' >= 100 & `tmpisco' <= 110)
* Lower-grade managers and administrators (10)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' >= 1310 & `tmpisco' <= 1312)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' >= 1400 & `tmpisco' <= 1439)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' >= 2433 & `tmpisco' <= 2434)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' >= 3300 & `tmpisco' <= 3339)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' == 3343)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' >= 3350 & `tmpisco' <= 3359)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' == 3411)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' == 5221)
qui replace `oesch16'=10 if (`selfem_mainjob'==1) & (`tmpisco' >= 200 & `tmpisco' <= 210)
* Skilled clerks (11)
qui replace `oesch16'=11 if (`selfem_mainjob'==1) & (`tmpisco' >= 3340 & `tmpisco' <= 3342)
qui replace `oesch16'=11 if (`selfem_mainjob'==1) & (`tmpisco' == 3344)
qui replace `oesch16'=11 if (`selfem_mainjob'==1) & (`tmpisco' >= 4000 & `tmpisco' <= 4131)
qui replace `oesch16'=11 if (`selfem_mainjob'==1) & (`tmpisco' >= 4200 & `tmpisco' <= 4221)
qui replace `oesch16'=11 if (`selfem_mainjob'==1) & (`tmpisco' >= 4224 & `tmpisco' <= 4413)
qui replace `oesch16'=11 if (`selfem_mainjob'==1) & (`tmpisco' >= 4415 & `tmpisco' <= 4419)
* Unskilled clerks (12)
qui replace `oesch16'=12 if (`selfem_mainjob'==1) & (`tmpisco' == 4132)
qui replace `oesch16'=12 if (`selfem_mainjob'==1) & (`tmpisco' == 4222)
qui replace `oesch16'=12 if (`selfem_mainjob'==1) & (`tmpisco' == 4223)
qui replace `oesch16'=12 if (`selfem_mainjob'==1) & (`tmpisco' == 5230)
qui replace `oesch16'=12 if (`selfem_mainjob'==1) & (`tmpisco' == 9621)
* Socio-cultural professionals (13)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2200 & `tmpisco' <= 2212)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' == 2250)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2261 & `tmpisco' <= 2262)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2300 & `tmpisco' <= 2330)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2350 & `tmpisco' <= 2352)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' == 2359)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' == 2600)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' == 2621)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' == 2630)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2632 & `tmpisco' <= 2634)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2636 & `tmpisco' <= 2640)
qui replace `oesch16'=13 if (`selfem_mainjob'==1) & (`tmpisco' >= 2642 & `tmpisco' <= 2643)
* Socio-cultural semi-professionals (14)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2163)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2166)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 2220 & `tmpisco' <= 2240)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2260)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 2263 & `tmpisco' <= 2269)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 2340 & `tmpisco' <= 2342)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 2353 & `tmpisco' <= 2356)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2620)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2622)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2635)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 2641)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 2650 & `tmpisco' <= 2659)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 3200)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 3220 & `tmpisco' <= 3230)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 3250)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 3253 & `tmpisco' <= 3257)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 3259)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 3400 & `tmpisco' <= 3410)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 3412 & `tmpisco' <= 3413)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' >= 3430 & `tmpisco' <= 3433)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 3435)
qui replace `oesch16'=14 if (`selfem_mainjob'==1) & (`tmpisco' == 4414)
* Skilled service (15)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 3240)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 3251)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 3258)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 3420 & `tmpisco' <= 3423)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 3434)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 5000 & `tmpisco' <= 5120)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 5140 & `tmpisco' <= 5142)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 5163)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 5165)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 5200)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 5220)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 5222 & `tmpisco' <= 5223)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 5241 & `tmpisco' <= 5242)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 5300 & `tmpisco' <= 5321)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' >= 5400 & `tmpisco' <= 5413)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 5419)
qui replace `oesch16'=15 if (`selfem_mainjob'==1) & (`tmpisco' == 8331)
* Low-skilled service (16)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 5130 & `tmpisco' <= 5132)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 5150 & `tmpisco' <= 5162)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' == 5164)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' == 5169)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 5210 & `tmpisco' <= 5212)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' == 5240)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 5243 & `tmpisco' <= 5249)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 5322 & `tmpisco' <= 5329)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' == 5414)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' == 8322)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 9100 & `tmpisco' <= 9129)
qui replace `oesch16'=16 if (`selfem_mainjob'==1) & (`tmpisco' >= 9400 & `tmpisco' <= 9520)
* Output the Variables
qui mvdecode `oesch16', mv(-9)
if "`sixteen'"=="sixteen" | ("`eight'"!="eight" & "`five'"!="five") {
capture confirm variable oesch16_`varlist'
if !_rc & "`replace'"=="replace" {
drop oesch16_`varlist'
}
qui gen oesch16_`varlist' = `oesch16'
display as text "Created 16-class variable:"
ds oesch16_`varlist'
label variable oesch16_`varlist' "`varlist' Oesch class position - 16 classes"
label define oesch16_`varlist' ///
1 "Large employers" ///
2 "Self-employed professionals" ///
3 "Small business owners with employees" ///
4 "Small business owners without employees" ///
5 "Technical experts" ///
6 "Technicians" ///
7 "Skilled manual" ///
8 "Low-skilled manual" ///
9 "Higher-grade managers and administrators" ///
10 "Lower-grade managers and administrators" ///
11 "Skilled clerks" ///
12 "Unskilled clerks" ///
13 "Socio-cultural professionals" ///
14 "Socio-cultural semi-professionals" ///
15 "Skilled service" ///
16 "Low-skilled service", replace
label value oesch16_`varlist' oesch16_`varlist'
tab oesch16_`varlist'
}
if "`eight'"=="eight"{
capture confirm variable oesch8_`varlist'
if !_rc & "`replace'"=="replace" {
drop oesch8_`varlist'
}
qui recode `oesch16' (1 2=1)(3 4=2)(5 6=3)(7 8=4)(9 10=5)(11 12=6)(13 14=7)(15 16=8), gen(oesch8_`varlist')
display as text "Created 8-class variable:"
ds oesch8_`varlist'
label variable oesch8_`varlist' "`varlist' Oesch class position - 8 classes"
label define oesch8_`varlist' ///
1 "Self-employed professionals and large employers" ///
2 "Small business owners" ///
3 "Technical (semi-)professionals" ///
4 "Production workers" ///
5 "(Associate) managers" ///
6 "Clerks" ///
7 "Socio-cultural (semi-)professionals" ///
8 "Service workers", replace
label value oesch8_`varlist' oesch8_`varlist'
tab oesch8_`varlist'
}
if "`five'"=="five"{
capture confirm variable oesch5_`varlist'
if !_rc & "`replace'"=="replace" {
drop oesch5_`varlist'
}
qui recode `oesch16' (1 2 5 9 13=1)(6 10 14=2)(3 4=3)(7 11 15=4)(8 12 16=5), gen(oesch5_`varlist')
display as text "Created 5-class variable:"
ds oesch5_`varlist'
label variable oesch5_`varlist' "`varlist' Oesch class position - 5 classes"
label define oesch5_`varlist' ///
1 "Higher-grade service class" ///
2 "Lower-grade service class" ///
3 "Small business owners" ///
4 "Skilled workers" ///
5 "Unskilled workers", replace
label value oesch5_`varlist' oesch5_`varlist'
tab oesch5_`varlist'
}
end