Dummy independent
Research question: Does gender affect smoking habits?
Hypothesis: A higher proportion of men smoke than women.
fre cgtsmke.
RECODE cgtsmke (1 2=1)(3 thru 5=0) into cgtsmke_dummy.
VARIABLE LABELS cgtsmke_dummy ‘Smokes or not’.
VALUE LABELS cgtsmke_dummy 0’No’ 1’Yes’.
fre cgtsmke cgtsmke_dummy.
fre gndr.
RECODE gndr (1=1)(2=0) into gndr_dummy.
VARIABLE LABELS gndr_dummy ‘Gender dummy’.
VALUE LABELS gndr_dummy 1’Male’ 0’Female’.
LOGISTIC REGRESSION cgtsmke_dummy WITH gndr_dummy.
b0: the log odds for category 1 of the dependent variable when the independent variable’s category is 0
b0: the log odds of smoking among women is -1.247.
b1: how much larger or smaller the log odds become as the independent variable increases by 1 unit.
b1: The log odds of smoking are -1.247 for females, but it increases by 0.784 if the respondent is male. The effect of gender on smoking is significant on the 5% significance level. In other words: the log odds of smoking among men are 0,784 times as high as among women.
b0+b1: the log odds for category 1 of the dependent variable when the independent variable’s category is 1.
b0+b1: the log odds of smoking among men is -0,463. (b0+b1*X=-1,247+0,784*1=-0,463)
Exp(B) for b1: is the odds ratio. -> category 1 … times than … category 0.
The odds of smoking are 2.191 times higher for males than for females.
The odds of smoking are (2.191-1)*100=119.1 % higher for males than for females.
Exp(B) for b0: the odds of smoking among women are 0,287.
Conclusion: The results support our hypothesis, stating that “A higher proportion of men smoke than women.” Why? Because the p-value of b1 is higher than 0,05 and the value of the Exp(b1) shows that the proportion of smokers among men is higher than among women.
Example 1:
1.Research question: Does gender have an effect on smoking?
Hypothesis: A higher proportion of men smoke than women.
fre cgtsmke.
RECODE cgtsmke (1 2=0) (3 thru 5=1) INTO cgtsmke_dummy.
VARIABLE LABELS cgtsmke_dummy ‘Smoking?’.
VALUE LABELS cgtsmke_dummy 1’No’ 0’Yes’.
fre cgtsmke cgtsmke_dummy.
fre gndr.
RECODE gndr (1=0)(2=1) INTO gndr_dummy.
VARIABLE LABELS gndr_dummy ‘Gender dummy’.
VALUE LABELS gndr_dummy 0’Male’ 1’Female’.
fre gndr gndr_dummy.
LOGISTIC REGRESSION cgtsmke_dummy WITH gndr_dummy.
b0: The log odds of not smoking are 0,472 among men. (b0+b1*X=0.472+0.794*0=0.472)
b1: The log odds of not smoking are higher by 0.794 among women than among men.
b0+b1: The log odds of not smoking among women are 1.266. (b0+b1*X=0.472+0.794*1=1.266)
Exp(b1)=2.213
The odds of not smoking among women are 2.213 times as high as among men.
Exp(b0)= The odds of not smoking among men are 1.603.
Exp(b0+b1)=Exp(b0)*Exp(b1)=1,603*2,213= the odds of not smoking among women.
Example 2:
We get different results if we turn on the weighting and we code 1 as smoking:
weight by pweight.
fre cgtsmke.
RECODE cgtsmke (1 2=1) (3 thru 5=0) INTO cgtsmke_cat.
VARIABLE LABELS cgtsmke_cat ‘ Do you smoke?’.
Value labels cgtsmke_cat 1 ‘smoke’ 0 ‘not smoking’.
fre cgtsmke cgtsmke_cat.
fre gndr.
RECODE gndr (1=0) (2=1) INTO gndr_cat.
VARIABLE LABELS gndr_cat ‘Are you male or female’.
Value labels gndr_cat 0 ‘male’ 1 ‘female’.
fre gndr gndr_cat.
LOGISTIC REGRESSION cgtsmke_cat WITH gndr_cat.
Exp(b1): The odds of smoking among women are 0.452 times as low as among men. The odds of smoking are 54,8% lower among women than among men. ((0.452-1))*100=-54.8%)
b1: The logarithm of the odds for smoking among women
is by 0.794 lower than among men.
b0: The logarithm of the odds for smoking among men is -0,472.
Exp(b0): The odds of smoking among men are 0,624.
Exp(b0+b1)=Exp(b0)*Exp(b1)
The odds of smoking among women are (0,624*0,452).
Conclusion: The results support the hypothesis, stating that a higher proportion of men smoke than women since the p-value is lower than 0,05 and the Exp(b1) shows that the odds for smoking are higher among men than among women.