Professional Documents
Culture Documents
14 September 2016
1
Do file: make sure to open data and log file correctly (and close log file)
Number of obs
LR chi2(2)
Prob > chi2
Pseudo R2
=
=
=
=
3000
54.65
0.0000
0.0411
2. Scatterplot
-----------------------------------------------------------------------------ptuse |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban | -.1178419
.0782359
-1.51
0.132
-.2711814
.0354976
age |
.013089
.0018674
7.01
0.000
.009429
.016749
_cons |
1.201824
.0834919
14.39
0.000
1.038183
1.365465
------------------------------------------------------------------------------
4. Marginal effects
10
Number of obs
3000
Expression
: Pr(ptuse), predict()
dy/dx w.r.t. : 1.urban age
at
: urban
=
age
=
Expression
: Pr(ptuse), predict()
dy/dx w.r.t. : 1.urban age
Number of obs
3000
0
50
-----------------------------------------------------------------------------|
Delta-method
|
dy/dx
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban |
Urban | -.0081151
.0058582
-1.39
0.166
-.0195971
.0033668
age |
.0008388
.0001187
7.07
0.000
.0006062
.0010714
-----------------------------------------------------------------------------Note: dy/dx for factor levels is the discrete change from the base level.
-----------------------------------------------------------------------------|
Delta-method
|
dy/dx
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban |
Urban | -.0117787
.0084613
-1.39
0.164
-.0283625
.0048051
age |
.001381
.0002193
6.30
0.000
.0009513
.0018108
-----------------------------------------------------------------------------Note: dy/dx for factor levels is the discrete change from the base level.
Number of obs
3000
1
50
-----------------------------------------------------------------------------|
Delta-method
|
dy/dx
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban |
Urban | -.0081151
.0058582
-1.39
0.166
-.0195971
.0033668
age |
.0010318
.0001194
8.64
0.000
.0007978
.0012658
-----------------------------------------------------------------------------Note: dy/dx for factor levels is the discrete change from the base level.
Number of obs
LR chi2(4)
Prob > chi2
Pseudo R2
=
=
=
=
Logistic regression
3,000
92.80
0.0000
0.0698
-----------------------------------------------------------------------------ptuse |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban |
Urban | -.1917626
.1653453
-1.16
0.246
-.5158335
.1323083
|
age_categ |
2 | -.4105884
.180612
-2.27
0.023
-.7645815
-.0565953
3 |
1.02875
.2284758
4.50
0.000
.5809455
1.476554
4 |
2.114608
.4316005
4.90
0.000
1.268687
2.96053
|
_cons |
2.559948
.1677366
15.26
0.000
2.23119
2.888706
------------------------------------------------------------------------------
Logistic regression
Log likelihood = -617.88621
Number of obs
LR chi2(4)
Prob > chi2
Pseudo R2
=
=
=
=
3,000
92.80
0.0000
0.0698
-----------------------------------------------------------------------------ptuse |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban | -.1917626
.1653453
-1.16
0.246
-.5158335
.1323083
age20_39 | -.4105884
.180612
-2.27
0.023
-.7645815
-.0565953
age40_59 |
1.02875
.2284758
4.50
0.000
.5809455
1.476554
age60_plus |
2.114608
.4316005
4.90
0.000
1.268687
2.96053
_cons |
2.559948
.1677366
15.26
0.000
2.23119
2.888706
------------------------------------------------------------------------------
Marginal effects
different: obtained
after model with
i.age_categ are
correct; obtained
after model with
separate dummies
are wrong.
13
Number of obs
LR chi2(4)
Prob > chi2
Pseudo R2
=
=
=
=
3,000
92.80
0.0000
0.0698
-----------------------------------------------------------------------------ptuse |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban |
Urban | -.1917626
.1653453
-1.16
0.246
-.5158335
.1323083
|
age_categ |
1 |
.4105884
.180612
2.27
0.023
.0565953
.7645815
3 |
1.439338
.2217098
6.49
0.000
1.004795
1.873882
4 |
2.525197
.4279787
5.90
0.000
1.686374
3.36402
|
_cons |
2.14936
.164105
13.10
0.000
1.82772
2.471
-----------------------------------------------------------------------------margins, dydx(*)
Average marginal effects
Model VCE
: OIM
Number of obs
3,000
Expression
: Pr(ptuse), predict()
dy/dx w.r.t. : 1.urban 1.age_categ 3.age_categ 4.age_categ
-----------------------------------------------------------------------------|
Delta-method
|
dy/dx
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------urban |
Urban | -.0099922
.0084661
-1.18
0.238
-.0265855
.0066012
|
age_categ |
1 |
.0358715
.0158533
2.26
0.024
.0047996
.0669434
3 |
.0857047
.0135678
6.32
0.000
.0591122
.1122971
4 |
.1054683
.0131294
8.03
0.000
.0797352
.1312014
-----------------------------------------------------------------------------Note: dy/dx for factor levels is the discrete change from the base level.
Implications for
interpretation?
interpretation is always
compared to the
reference category
14
Question 6
Probit models
Same xs as question 5, except that age will enter the model differently:
One in categories (up to you which and how many categories)
Other one not in categories but also not (just) age
In both cases, need to create new variables
5. Question 6
15
16
Question 8
Cannot see from the data how long a person has smoked, that is why
need to assume something: they all started at the same time (does not
matter when)
=> what do you know about duration of smoking?
6. Question 8
18
7. Other question(s)
for each explanatory variable (question 5). Show Stata output with
marginal effects for all the variables included in the model. Interpret just
for the two variables mentioned.
Good luck!
19
20