Hello I want to create a variable that depicts change in health wrt to change in hours worked. Something like the derivative Health effect of effort ∂h/ ∂hoursworked.
I have two health variables BMI and self rating of health EW10. WSHOURS is the hours worked in a year. I have two time periods depicted in SURVEY.
I want to create change in BMI wrt change in WSHOURS across the two years and change in EW10 wrt to change in WSHOURS. How do I do that?
Code:
------------------ copy up to and including the previous line ------------------ Listed 100 out of 57690 observations Use the count() option to liCode:* Example generated by -dataex-. To install: ssc install dataex clear input float BMI int(EW10 WSHOURS SURVEY) 23.49591 3 2555 2 30.774214 1 1760 1 21.41378 1 2190 2 26.62042 3 1800 2 30.93279 2 1825 2 22.14876 2 4000 2 23.93525 2 1050 1 23.93767 2 2100 2 31.70855 2 1560 2 25.9788 3 2190 2 30.69388 3 2190 2 21.854063 2 2190 2 32.105175 2 3150 2 28.16055 3 2240 1 20 2 1920 2 25.2002 2 2400 2 29.04866 3 2190 2 15.741002 2 1980 2 23.33768 2 1800 1 24.105185 2 60 2 25.72977 1 660 2 18.189388 2 960 2 33.014046 2 1680 2 18.754324 2 400 2 18.586313 3 1200 2 17.647774 3 1200 2 19.11111 3 400 2 25.86672 3 1825 2 19.27907 2 640 2 18.507961 4 368 2 19.403263 2 1480 2 25.53711 4 400 2 20.43453 2 200 2 27.333334 2 176 2 22.352186 1 800 1 18.98075 2 1350 2 19.77107 3 480 2 15.13938 2 320 2 26.00975 2 600 2 19.54614 2 1825 2 26.22564 2 180 2 20.703323 1 960 1 25.66822 2 440 2 31.034264 2 240 2 18.042686 2 400 2 20.92458 2 400 2 25.077394 2 2480 2 24.20114 1 2700 1 14.724116 2 560 2 21.75973 2 420 2 27.30469 3 900 2 17.893951 2 800 2 20.80251 2 1740 2 26.43039 2 2320 2 26.55152 2 2920 2 29.355314 2 1860 2 21.29674 2 240 2 18.798946 2 16 2 24.681847 3 800 2 17.377777 3 480 2 18.952898 3 240 2 21.0101 2 120 2 28.96076 3 640 2 21.38119 3 360 2 26.594553 3 432 2 25.558846 3 800 2 18.552498 2 224 2 18.36727 3 2560 2 22.07481 3 440 2 21.231205 4 560 2 22.10179 4 560 2 27.78715 2 2640 1 27.54679 3 800 2 25.64922 3 680 2 18.411722 2 720 1 26.22222 2 400 2 20.21424 2 480 2 28.681374 2 120 2 26.34457 2 200 2 30.827494 2 280 2 26.567747 2 1500 2 25.555555 2 2920 2 18.263971 3 320 1 18.263971 2 240 2 18.817272 3 480 2 25.7632 2 400 2 21.7095 3 224 2 17.346754 3 240 2 21.277534 3 400 2 18.107124 3 480 2 20.388186 3 320 2 15.181862 4 800 2 22.534153 3 400 2 20.9072 3 112 2 26.805414 3 240 2 21.33821 3 200 2 21.28549 3 400 2 21.21137 2 240 2 25.748217 2 480 2 17.535034 2 480 2 end label values EW10 EW10 label def EW10 1 "Very good 1", modify label def EW10 2 "Good 2", modify label def EW10 3 "OK 3", modify label def EW10 4 "Poor 4", modify label values SURVEY SURVEY label def SURVEY 1 "IHDS1 1", modify label def SURVEY 2 "IHDS2 2", modify
Comment