Hi all,
This is the dataex of my dataset. I am working on the impact of drinking alcohol on earnings with the following variables:

The way I do it is generate new variables for each of the group and run individual regression, as below:
All of the code work, but I don't think it is the correct way to do because it will generate different coefficients of the demographic variables for each group. So my questions are:
1. Do I run it correctly, and if not, could you let me know the correct code? Just one two example and I could work out the other group.
2. Should I take log in the earnings, currently earnings are in $ but I want to interpret data as % of earnings increase as we drink more or less. If yes, could you let me know the code?
Thank you very much!
This is the dataex of my dataset. I am working on the impact of drinking alcohol on earnings with the following variables:
input double days_drink_wk float drink_intensity byte educgrp long earnings
.5 4 1 5000
.5 .5 3 20000
.5 .5 3 24000
1 1 4 101099
2 12 3 11000
3 30 3 30000
3 6 4 100000
.5 .5 2 24000
.5 4 1 5000
.5 .5 3 20000
.5 .5 3 24000
1 1 4 101099
2 12 3 11000
3 30 3 30000
3 6 4 100000
.5 .5 2 24000
- days_drinks_wk: numbers of days drinking per week
- drink_intensity: numbers of drinking units per week
- educgrp: education level
- earnings: annual income in $$$
The way I do it is generate new variables for each of the group and run individual regression, as below:
generate abstainers = drink_intensity if inrange(drink_intensity, 0, 0.5)
generate light_dr = drink_intensity if inrange(drink_intensity, 0.6, 7)
generate light_moderate_dr = drink_intensity if inrange(drink_intensity, 7.1, 21)
generate moderate_dr = drink_intensity if inrange(drink_intensity, 21.1, 43)
generate moderate_heavy_dr = drink_intensity if inrange(drink_intensity, 43.1, 64)
generate heavy_dr = drink_intensity if inrange(drink_intensity, 64.1, 86)
generate very_heavy_dr = drink_intensity if (drink_intensity > 86)
reg earnings abstainers educgrp married
generate light_dr = drink_intensity if inrange(drink_intensity, 0.6, 7)
generate light_moderate_dr = drink_intensity if inrange(drink_intensity, 7.1, 21)
generate moderate_dr = drink_intensity if inrange(drink_intensity, 21.1, 43)
generate moderate_heavy_dr = drink_intensity if inrange(drink_intensity, 43.1, 64)
generate heavy_dr = drink_intensity if inrange(drink_intensity, 64.1, 86)
generate very_heavy_dr = drink_intensity if (drink_intensity > 86)
reg earnings abstainers educgrp married
1. Do I run it correctly, and if not, could you let me know the correct code? Just one two example and I could work out the other group.
2. Should I take log in the earnings, currently earnings are in $ but I want to interpret data as % of earnings increase as we drink more or less. If yes, could you let me know the code?
Thank you very much!
Comment