Professional Documents
Culture Documents
Oscar Torres-Reyna
otorres@princeton.edu
February 2014
http://dss.princeton.edu/training/
. margins, atmeans
Adjusted predictions
Model VCE
: OIM
Expression
at
Number of obs
: Pr(y_bin), predict()
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
1.opinion
=
.2857143 (mean)
2.opinion
=
.2142857 (mean)
3.opinion
=
.2714286 (mean)
4.opinion
=
.2285714 (mean)
Margin
_cons
.8575618
Delta-method
Std. Err.
.0512873
z
16.72
70
Variables at mean
values
P>|z|
0.000
.7570405
.9580832
The probability of y_bin = 1 is 85% given that all predictors are set to their mean
values.
Type help margins for more details. Available since Stata 11+
OTR
: Pr(y_bin), predict()
: x1
=
.6480006 (mean)
x2
=
3
x3
=
.761851 (mean)
1.opinion
=
.2857143 (mean)
2.opinion
=
.2142857 (mean)
3.opinion
=
.2714286 (mean)
4.opinion
=
.2285714 (mean)
Margin
_cons
Number of obs
.9346922
Delta-method
Std. Err.
.0732788
z
12.76
70
Variables at mean
values
P>|z|
0.000
.7910683
1.078316
The probability of y_bin = 1 is 93% given that x2 = 3 and the rest of predictors
are set to their mean values.
Type help margins for more details. Available since Stata 11+
OTR
: Pr(y_bin), predict()
: x1
=
.6480006 (mean)
x2
=
3
x3
=
5
1.opinion
=
.2857143 (mean)
2.opinion
=
.2142857 (mean)
3.opinion
=
.2714286 (mean)
4.opinion
=
.2285714 (mean)
Margin
_cons
Number of obs
.9872112
Delta-method
Std. Err.
.0357288
z
27.63
P>|z|
70
Variables at mean
values
0.000
.917184
1.057238
OTR
Type help margins for more details. Available since Stata 11+
Number of obs
Expression
: Pr(y_bin), predict()
1._at
: x1
x2
x3
opinion
=
=
=
=
.6480006 (mean)
3
5
1
2._at
: x1
x2
x3
opinion
=
=
=
=
.6480006 (mean)
3
5
2
Margin
_at
1
2
.9891283
.9304941
Delta-method
Std. Err.
.0305393
.1915434
32.39
4.86
70
P>|z|
0.000
0.000
.9292724
.5550758
1.048984
1.305912
Type help margins for more details. Available since Stata 11+
: Pr(y_bin), predict()
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
1.opinion
=
.2857143 (mean)
2.opinion
=
.2142857 (mean)
3.opinion
=
.2714286 (mean)
4.opinion
=
.2285714 (mean)
70
.8764826
.5107928
.907761
.933931
.0739471
.1509988
.0673524
.0644709
11.85
3.38
13.48
14.49
P>|z|
0.000
0.001
0.000
0.000
.731549
.2148405
.7757527
.8075704
.6
.4
opinion
Str agree
Agree
Disag
Str disag
Delta-method
Std. Err.
1.021416
.8067451
1.039769
1.060292
.2
Margin
Pr(Y_Bin)
.8
Expression
at
Number of obs
Adjusted predictions
Model VCE
: OIM
Str agree
Agree
Disag
Str disag
opinion
Source: http://www.stata.com/stata12/margins-plots/
Holding all variables at their mean values. The probability of y_bin = 1 is:
OTR
Str
Str
Str
Str
Str
Str
Str
Delta-method
Std. Err.
P>|z|
.1676835
.0739956
.0855355
.0347693
.0210781
.2431515
.0330825
.1568031
.07074
.1163811
.0782601
.0632413
.1394519
.1141899
.1403006
.0875026
.1006077
.0339031
.0224011
.2382172
.0349299
.1069996
.0851639
.0615373
.0212865
.0078968
.1814934
.0104861
5.20
2.98
10.36
11.28
19.72
3.38
29.56
4.42
1.34
6.10
3.92
5.88
4.58
7.80
6.24
2.55
8.83
11.59
18.58
3.46
28.02
8.89
3.65
15.57
19.54
53.84
5.08
94.83
0.000
0.003
0.000
0.000
0.000
0.001
0.000
0.000
0.179
0.000
0.000
0.000
0.000
0.000
0.000
0.011
0.000
0.000
0.000
0.001
0.000
0.000
0.000
0.000
0.000
0.000
0.000
0.000
.5436181
.0755741
.7184442
.3239182
.3744049
.3446987
.9130629
.3849638
-.0435612
.4813608
.1537601
.2476371
.3658771
.666625
.5998621
.0514531
.6913168
.3264681
.3721947
.3573707
.9101439
.7414776
.1437303
.8376292
.3743203
.4096831
.5659143
.9738664
1.200925
.3656314
1.053737
.4602113
.4570296
1.297835
1.042744
.9996208
.2337343
.9375665
.460534
.4955382
.9125185
1.114241
1.14983
.3944569
1.085692
.4593657
.4600053
1.291165
1.047066
1.160908
.4775665
1.078851
.457762
.4406381
1.277355
1.014971
OTR
Type help margins or help marginsplot for more details
.5
.8722717
.2206027
.8860908
.3920647
.4157172
.8212669
.9779035
.6922923
.0950865
.7094636
.307147
.3715877
.6391978
.890433
.8748461
.222955
.8885042
.3929169
.4161
.8242678
.9786051
.951193
.3106484
.9582401
.4160411
.4251606
.9216348
.9944189
1.5
Str
Str
Str
Str
Str
Str
Str
70
: Pr(y_bin), predict()
Margin
opinion#
country
agree#A
agree#B
agree#C
agree#D
agree#E
agree#F
agree#G
Agree#A
Agree#B
Agree#C
Agree#D
Agree#E
Agree#F
Agree#G
Disag#A
Disag#B
Disag#C
Disag#D
Disag#E
Disag#F
Disag#G
disag#A
disag#B
disag#C
disag#D
disag#E
disag#F
disag#G
Pr(Y_Bin)
Expression
Number of obs
Str agree
Agree
Disag
Str disag
opinion
A
C
E
G
B
D
F
Source: http://www.stata.com/stata12/margins-plots/
Number of obs
70
Expression
: Pr(y_bin), predict()
dy/dx w.r.t. : x1 x2 x3 2.opinion 3.opinion 4.opinion
at
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
1.opinion
=
.2857143 (mean)
2.opinion
=
.2142857 (mean)
3.opinion
=
.2714286 (mean)
4.opinion
=
.2285714 (mean)
dy/dx
Delta-method
Std. Err.
P>|z|
x1
x2
x3
.1384634
.036904
.04857
.1093955
.0421082
.0548416
1.27
0.88
0.89
0.206
0.381
0.376
-.0759478
-.0456266
-.0589176
.3528746
.1194346
.1560577
opinion
Agree
Disag
Str disag
-.3656898
.0312784
.0574484
.1670551
.0945857
.098205
-2.19
0.33
0.58
0.029
0.741
0.559
-.6931118
-.1541062
-.1350299
-.0382678
.2166629
.2499268
Note: dy/dx for factor levels is the discrete change from the base level.
OTR
Number of obs
70
: Pr(y_bin), predict()
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
1.opinion
=
.2857143 (mean)
2.opinion
=
.2142857 (mean)
3.opinion
=
.2714286 (mean)
4.opinion
=
.2285714 (mean)
Margin
opinion
Str agree
Agree
Disag
Str disag
.8764826
.5107928
.907761
.933931
Delta-method
Std. Err.
.0739471
.1509988
.0673524
.0644709
11.85
3.38
13.48
14.49
P>|z|
0.000
0.001
0.000
0.000
.731549
.2148405
.7757527
.8075704
1.021416
.8067451
1.039769
1.060292
Mac users click here to go to the directory where test.doc is saved, open it with Word
OTR
Number of obs
70
Expression
: Pr(y_bin), predict()
dy/dx w.r.t. : x1 x2 x3 2.opinion 3.opinion 4.opinion
dy/dx
Delta-method
Std. Err.
P>|z|
x1
x2
x3
.1411603
.0376228
.049516
.1137246
.0440405
.058822
1.24
0.85
0.84
0.215
0.393
0.400
-.0817359
-.048695
-.065773
.3640564
.1239406
.1648051
opinion
Agree
Disag
Str disag
-.3564299
.0338245
.0628003
.1565868
.1022902
.1062941
-2.28
0.33
0.59
0.023
0.741
0.555
-.6633343
-.1666607
-.1455323
-.0495255
.2343096
.2711329
Note: dy/dx for factor levels is the discrete change from the base level.
. outreg2 using test.doc, word replace ctitle(Marginal effects)
test.doc
dir : seeout
Windows users click here to open the file test.doc
in Word.
OTR
10
Number of obs
70
_cons
.2800935
Delta-method
Std. Err.
.0541271
5.17
Adjusted predictions
Model VCE
: OIM
Expression
at
: Pr(opinion==1), predict(outcome(1))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
Margin
P>|z|
0.000
.1740064
.3861805
Number of obs
70
: Pr(opinion==2), predict(outcome(2))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
Margin
_cons
.219505
Delta-method
Std. Err.
.0502736
z
4.37
P>|z|
0.000
.1209706
.3180394
The probability of opinion = 1 given that the rest of the variables are at their mean values is 28%
. margins, predict(outcome(3)) atmeans
Adjusted predictions
Model VCE
: OIM
Expression
at
OTR
70
: Pr(opinion==3), predict(outcome(3))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
Margin
_cons
Number of obs
.2788256
Delta-method
Std. Err.
.0546476
z
5.10
Adjusted predictions
Model VCE
: OIM
Expression
at
P>|z|
0.000
.1717183
.3859328
70
: Pr(opinion==4), predict(outcome(4))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
.761851 (mean)
Margin
_cons
Number of obs
.221576
Delta-method
Std. Err.
.0501011
z
4.42
P>|z|
0.000
.1233796
.3197723
The probability of opinion = 4 given that the rest of the variables are at their mean values is 22%
11
Number of obs
70
_cons
.2092897
Delta-method
Std. Err.
.1191718
P>|z|
1.76
0.079
Adjusted predictions
Model VCE
: OIM
Expression
at
: Pr(opinion==1), predict(outcome(1))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
5
Margin
.4428621
70
: Pr(opinion==2), predict(outcome(2))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
5
Margin
Number of obs
_cons
.1951933
Delta-method
Std. Err.
.0665121
z
2.93
P>|z|
0.003
.0648321
.3255545
The probability of opinion = 1, x3=5 and the rest of the variables are at their mean values is 21%
. margins, predict(outcome(4)) at(x3=5) atmeans
OTR
70
.3005314
Delta-method
Std. Err.
.063336
z
4.75
Adjusted predictions
Model VCE
: OIM
Expression
at
: Pr(opinion==3), predict(outcome(3))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
5
Margin
_cons
Number of obs
P>|z|
0.000
.1763952
.4246676
70
: Pr(opinion==4), predict(outcome(4))
: x1
=
.6480006 (mean)
x2
=
.1338694 (mean)
x3
=
5
Margin
_cons
Number of obs
.2949855
Delta-method
Std. Err.
.1450564
z
2.03
P>|z|
0.042
.0106803
.5792908
The probability of opinion = 4, x3=5 and the rest of the variables are at their mean values is 29%
12
can replace this name for your own) . Otherwise follow the Mac
instructions.
Mac users click here to go to the directory where mymod.doc is saved, open it with Word
(you can replace this name for your own)
OTR