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.

1-does not smoke
0-smokes
0-male
1-female

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.

## Exercise 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.

1-smokes
0-does not smoke
0-male
1-female

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.