Dear all,
I am estimating whether full-time employees receive more training than part-time employees - or if the employment type affects the training hours. As such, I created dummy variables where job_type==1 (full-time) and job_type==0 (part-time).
Initially, I used different models, where one was created using "xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector if job_type==1, re vce(robust)' for FT employees and another for PT employees using " xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector if job_type==0, re vce(robust)".
However, I now want to do the same, but using interaction terms to produce a single set of models.
My question is: is the best way of doing it using the code
When I run this code, I encounter a couple of problems - 1) Stata runs the command for a very long time (over 30 mins and it is still not over) and 2) as you can see below, a lot of variables are omitted.
How can I estimate the impact of employment type on training hours using interaction terms otherwise? I include the data example below. I am grateful in advance if you could please help me with this problem!
I am estimating whether full-time employees receive more training than part-time employees - or if the employment type affects the training hours. As such, I created dummy variables where job_type==1 (full-time) and job_type==0 (part-time).
Initially, I used different models, where one was created using "xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector if job_type==1, re vce(robust)' for FT employees and another for PT employees using " xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector if job_type==0, re vce(robust)".
However, I now want to do the same, but using interaction terms to produce a single set of models.
My question is: is the best way of doing it using the code
Code:
xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector i.job_type training_hrs##job_type, re vce(robust)
Code:
xtreg wages i.high_qual training_hrs training_hrs##job_type i.illness_disability i.sex i.children i.general_health i.region i.age i.sector job_type, re vce(robust) note: 5120.training_hrs omitted because of collinearity. note: 85.training_hrs#0.job_type identifies no observations in the sample. note: 85.training_hrs#1.job_type omitted because of collinearity. note: 107.training_hrs#0.job_type identifies no observations in the sample. note: 107.training_hrs#1.job_type omitted because of collinearity. note: 109.training_hrs#0.job_type identifies no observations in the sample. note: 109.training_hrs#1.job_type omitted because of collinearity. note: 113.training_hrs#0.job_type identifies no observations in the sample. note: 113.training_hrs#1.job_type omitted because of collinearity. note: 121.training_hrs#0.job_type identifies no observations in the sample. note: 121.training_hrs#1.job_type omitted because of collinearity. note: 127.training_hrs#1.job_type identifies no observations in the sample. note: 134.training_hrs#0.job_type identifies no observations in the sample. note: 134.training_hrs#1.job_type omitted because of collinearity. note: 139.training_hrs#0.job_type identifies no observations in the sample. note: 139.training_hrs#1.job_type omitted because of collinearity. note: 143.training_hrs#0.job_type identifies no observations in the sample. note: 143.training_hrs#1.job_type omitted because of collinearity. note: 146.training_hrs#0.job_type identifies no observations in the sample. note: 146.training_hrs#1.job_type omitted because of collinearity. note: 149.training_hrs#0.job_type identifies no observations in the sample. note: 149.training_hrs#1.job_type omitted because of collinearity. note: 159.training_hrs#0.job_type identifies no observations in the sample. note: 159.training_hrs#1.job_type omitted because of collinearity. note: 163.training_hrs#0.job_type identifies no observations in the sample. note: 163.training_hrs#1.job_type omitted because of collinearity. note: 166.training_hrs#0.job_type identifies no observations in the sample. note: 166.training_hrs#1.job_type omitted because of collinearity. note: 177.training_hrs#0.job_type identifies no observations in the sample. note: 177.training_hrs#1.job_type omitted because of collinearity. note: 186.training_hrs#0.job_type identifies no observations in the sample. note: 186.training_hrs#1.job_type omitted because of collinearity. note: 187.training_hrs#0.job_type identifies no observations in the sample. note: 187.training_hrs#1.job_type omitted because of collinearity. note: 191.training_hrs#0.job_type identifies no observations in the sample. note: 191.training_hrs#1.job_type omitted because of collinearity. note: 193.training_hrs#1.job_type identifies no observations in the sample. note: 194.training_hrs#0.job_type identifies no observations in the sample. note: 194.training_hrs#1.job_type omitted because of collinearity. note: 205.training_hrs#0.job_type identifies no observations in the sample. note: 205.training_hrs#1.job_type omitted because of collinearity. note: 209.training_hrs#1.job_type identifies no observations in the sample. note: 212.training_hrs#0.job_type identifies no observations in the sample. note: 212.training_hrs#1.job_type omitted because of collinearity. note: 215.training_hrs#0.job_type identifies no observations in the sample. note: 215.training_hrs#1.job_type omitted because of collinearity. note: 217.training_hrs#0.job_type identifies no observations in the sample. note: 217.training_hrs#1.job_type omitted because of collinearity. note: 219.training_hrs#0.job_type identifies no observations in the sample. note: 219.training_hrs#1.job_type omitted because of collinearity. note: 222.training_hrs#0.job_type identifies no observations in the sample. note: 222.training_hrs#1.job_type omitted because of collinearity. note: 223.training_hrs#1.job_type identifies no observations in the sample. note: 231.training_hrs#1.job_type identifies no observations in the sample. note: 232.training_hrs#0.job_type identifies no observations in the sample. note: 232.training_hrs#1.job_type omitted because of collinearity.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(sex region age high_qual) float(training_hrs wages training job_type) int _freq 1 1 4 1 0 0 0 0 1 1 1 4 1 0 3.2342455 0 0 1 1 1 4 1 0 3.986507 0 0 1 1 1 4 1 0 5.193341 0 0 1 1 1 4 1 0 5.792361 0 0 1 1 1 4 1 0 5.979761 0 0 1 1 1 4 1 0 6.311906 0 0 1 1 1 4 1 0 6.525496 0 0 1 1 1 4 1 0 6.599126 0 0 1 1 1 4 1 0 6.899724 0 0 1 1 1 4 1 0 6.976388 0 0 1 1 1 4 1 0 7.163255 0 0 1 1 1 4 1 0 7.661569 0 0 1 1 1 4 1 0 7.664548 0 0 1 1 1 4 1 0 7.901599 0 0 1 1 1 4 1 0 8.284412 0 0 1 1 1 4 1 0 8.432996 0 0 1 1 1 4 1 0 9.966268 0 0 1 1 1 4 1 0 10.09832 0 0 1 1 1 4 1 0 16.360012 0 0 1 1 1 4 1 0 22.99908 0 0 1 2 1 4 1 0 3.425857 0 0 1 2 1 4 1 0 3.9366376 0 0 1 2 1 4 1 0 4.599816 0 0 1 2 1 4 1 0 6.342206 0 0 1 2 1 4 1 0 6.612236 0 0 1 2 1 4 1 0 7.007532 0 0 1 2 1 4 1 0 8.023076 0 0 1 2 1 4 1 0 8.333333 0 0 1 2 1 4 1 0 8.491968 0 0 1 2 1 4 1 0 8.624655 0 0 1 2 1 4 1 0 9.199632 0 0 1 2 1 4 1 0 9.380175 0 0 1 2 1 4 1 0 9.400874 0 0 1 2 1 4 1 0 11.234702 0 0 1 2 1 4 1 0 11.461246 0 0 1 2 1 4 1 0 11.710413 0 0 1 2 1 4 1 0 11.93499 0 0 1 2 1 4 1 0 11.95521 0 0 1 2 1 4 1 0 12.457797 0 0 1 2 1 4 1 0 13.080727 0 0 1 2 1 4 1 0 14.566084 0 0 1 1 1 5 1 0 0 0 0 3 1 1 5 1 0 .7153225 0 0 1 1 1 5 1 0 1.91659 0 0 1 1 1 5 1 0 5.366452 0 0 1 1 1 5 1 0 6.073195 0 0 1 1 1 5 1 0 6.976357 0 0 1 1 1 5 1 0 8.097592 0 0 1 1 1 5 1 0 8.145508 0 0 1 1 1 5 1 0 9.966191 0 0 1 1 1 5 1 0 14.627415 0 0 1 2 1 5 1 0 3.752082 0 0 1 2 1 5 1 0 7.328183 0 0 1 2 1 5 1 0 7.877185 0 0 1 2 1 5 1 0 8.840271 0 0 1 2 1 5 1 0 8.957537 0 0 1 2 1 5 1 0 8.969642 0 0 1 2 1 5 1 0 10.732904 0 0 1 2 1 5 1 0 15.639375 0 0 1 2 1 5 1 0 16.065336 0 0 1 2 1 5 1 0 17.888147 0 0 1 2 1 5 1 0 101.85307 0 0 2 1 1 6 1 0 5.398363 0 0 1 1 1 6 1 0 7.187212 0 0 1 1 1 6 1 0 7.225736 0 0 1 1 1 6 1 0 8.305198 0 0 1 1 1 6 1 0 8.624655 0 0 1 1 1 6 1 0 9.199632 0 0 1 1 1 6 1 0 9.722339 0 0 1 2 1 6 1 0 4.456072 0 0 1 2 1 6 1 0 6.470288 0 0 1 2 1 6 1 0 6.644243 0 0 1 2 1 6 1 0 7.704692 0 0 1 2 1 6 1 0 7.927679 0 0 1 2 1 6 1 0 8.213957 0 0 1 2 1 6 1 0 8.23367 0 0 1 2 1 6 1 0 8.305223 0 0 2 2 1 6 1 0 8.518178 0 0 1 2 1 6 1 0 8.624655 0 0 1 2 1 6 1 0 8.944087 0 0 1 2 1 6 1 0 9.045794 0 0 1 2 1 6 1 0 9.301748 0 0 1 2 1 6 1 0 9.58295 0 0 1 2 1 6 1 0 9.65487 0 0 1 2 1 6 1 0 9.774609 0 0 1 2 1 6 1 0 9.966268 0 0 1 2 1 6 1 0 10.732904 0 0 1 2 1 6 1 0 11.821527 0 0 1 2 1 6 1 0 11.95952 0 0 1 2 1 6 1 0 12.218262 0 0 1 2 1 6 1 0 12.34217 0 0 1 2 1 6 1 0 12.431935 0 0 1 2 1 6 1 0 12.90881 0 0 1 2 1 6 1 0 12.936982 0 0 1 2 1 6 1 0 13.41613 0 0 1 2 1 6 1 0 13.569457 0 0 1 2 1 6 1 0 13.64612 0 0 1 2 1 6 1 0 13.799448 0 0 1 2 1 6 1 0 14.503965 0 0 1 end label values sex b_sex label def b_sex 1 "male", modify label def b_sex 2 "female", modify label values region b_gor_dv label def b_gor_dv 1 "North East", modify label values age b_agegr13_dv label def b_agegr13_dv 4 "20-24 years old", modify label def b_agegr13_dv 5 "25-29 years old", modify label def b_agegr13_dv 6 "30-34 years old", modify label values high_qual b_hiqual_dv label def b_hiqual_dv 1 "Degree", modify label values job_type ptime_ftime label def ptime_ftime 0 "Part time", modify
Comment