-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysisPVS.do
More file actions
158 lines (106 loc) · 6.33 KB
/
Copy pathanalysisPVS.do
File metadata and controls
158 lines (106 loc) · 6.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
* ***************************************************************** *
* ***************************************************************** *
* File-Name: analysisPVS.do *
* Date: July 17, 2019 *
* Author: Engst, Gschwend, Sternberg *
* Purpose: DCE baseline analysis, DCE Figures in German *
* DCE analysis and Graph with Ideol. Proximity *
* Input File: analysisPVS.dta *
* Data Output: dce_base.dta *
* **************************************************************** *
* **************************************************************** *
* - fre -
* - coefplot -
version 15.1
set seed 123345
set more off
set niceness 3
capture log close
log using "results.log", replace
* Load data
use analysisPVS, clear
egen csid = group(id_g screen)
* set base levels
fvset base 5 selec age
fvset base 1 party
fvset base 2 gender
fvset base 3 origin
fvset base 4 marit occu
* This is our baseline model
clogit chosen i.occu i.party i.selec i.age i.origin i.gender i.marit, group(csid) vce(clu id_g) baselevels
predict pc1
predict pu0, pu0
// * Marginal effect of attributes (vs previous level); see -contrast-
margins ar.occu ar.party ar.selec ar.age ar.origin ar.gender ar.marit, predict(pu0) asobserved cformat(%5.3f)
* average marginal effect using observed value approach (relative to refernce category)
margins, dydx(*) post predict(pu0) asobserved cformat(%5.3f) vce(unconditional) mcomp(bonferroni)
log close
**** Figure in German
coefplot , xline(0, lwidth(vthin)lcolor(black) ) order(. *occu . *party . *selec . *age . *origin . *gender . *marit) ///
baselevels legend(off) mcolor(black) mlwidth(vthin) mfcolor(gs14) msize(.6) lcolor(black) ///
headings( 1.occu = "{bf:Derzeitiger Beruf}" 1.party = "{bf:Parteinähe}" 1.selec = "{bf:Ausgewählt durch ...}" 1.age = "{bf:Alter}" ///
1.origin = "{bf:Herkunft}" 1.gender = "{bf:Geschlecht}" 1.marit = "{bf:Familienstand}", labgap(1) labsize(vsmall) ) ///
yscale(alt noline) ysize(8) ///
ylabel(, grid nogextend glcolor(gs14)) ///
coeflabels(, notick labgap(3) labsize(vsmall) grid glcolor(gs14)) ///
xscale( nofextend) xlabel(-.3(.1)0, labsize(small) grid glcolor(gs14)) ///
xtitle("Effekt von Eigenschaften möglicher Verfassungsrichter" "(im Vergleich zur Referenzkategorie)", j(left) size(small) color(black) alignment(bottom )) xscale(titlegap(3) ) ///
graphregion(color(white)) plotregion( color(white) margin(zero)) bgcolor(white) ///
saving(dceg, replace)
graph export dceg.pdf, replace
graph export dceg.png, replace
graph export dceg.tif, replace
graph export dceg.eps, replace preview(on)
save dce_base, replace
***** Analysis with individual-level covariates (from GIP wave 26)
use dce_base, clear
merge m:1 id_g using GIP_W26_PVS // 108 respondents that never answered (_merge==2)
keep if _merge==3
/*
party -- Party of Judge
---------------------------------------------------------------------------------------
| Freq. Percent Valid Cum.
------------------------------------------+--------------------------------------------
Valid 1 Parteilos | 4001 12.13 12.13 12.13
2 Steht den Grünen nahe | 4178 12.67 12.67 24.79
3 Steht der AfD nahe | 4078 12.36 12.36 37.16
4 Steht der CDU nahe | 8310 25.19 25.19 62.35
5 Steht der FDP nahe | 4216 12.78 12.78 75.13
6 Steht der Partei die LINKE nahe | 4077 12.36 12.36 87.49
7 Steht der SPD nahe | 4128 12.51 12.51 100.00
Total | 32988 100.00 100.00
---------------------------------------------------------------------------------------
*/
* we code "parteilos" as the same position as the respondent. hence likeihood contribution is "0"
gen lr_party = .
replace lr_party = lr_self if party==1
*replace lr_party = 6 if party==1 // code "parteilos" to midpoint of scale as alternative (only party fixed effects do not disappear, otherwise no difference)
replace lr_party = lr_b90 if party==2
replace lr_party = lr_afd if party==3
replace lr_party = lr_cdu if party==4
replace lr_party = lr_fdp if party==5
replace lr_party = lr_lin if party==6
replace lr_party = lr_spd if party==7
* Perceived spatial distance between self and party of nominee
gen lr_dist = abs(lr_self - lr_party)
lab var lr_dist "Distanz auf ideologischer Dimension"
clogit chosen i.occu i.party lr_dist i.selec i.age i.origin i.gender i.marit, group(csid) vce(clu id_g) baselevels
* average marginal effect using observed value approach (relative to refernce category)
margins, dydx(*) post predict(pu0) asobserved cformat(%5.3f) vce(unconditional) mcomp(bonferroni)
**** Figure in German
coefplot , xline(0, lwidth(vthin)lcolor(black) ) order(. *occu . lr_dist . *party . *selec . *age . *origin . *gender . *marit) ///
baselevels legend(off) mcolor(black) mlwidth(vthin) mfcolor(gs14) msize(.6) lcolor(black) ///
headings( 1.occu = "{bf:Derzeitiger Beruf}" 1.party = "{bf:Parteinähe}" lr_dist = "{bf:Ideologische Nähe}" 1.selec = "{bf:Ausgewählt durch ...}" 1.age = "{bf:Alter}" ///
1.origin = "{bf:Herkunft}" 1.gender = "{bf:Geschlecht}" 1.marit = "{bf:Familienstand}", labgap(1) labsize(vsmall) ) ///
yscale(alt noline) ysize(8) ///
ylabel(, grid nogextend glcolor(gs14)) ///
coeflabels(, notick labgap(3) labsize(vsmall) grid glcolor(gs14)) ///
xscale( nofextend) xlabel(-.3(.1)0, labsize(small) grid glcolor(gs14)) ///
xtitle("Effekt von Eigenschaften möglicher Verfassungsrichter" "(im Vergleich zur Referenzkategorie)", j(left) size(small) color(black) alignment(bottom )) xscale(titlegap(3) ) ///
graphregion(color(white)) plotregion( color(white) margin(zero)) bgcolor(white) ///
saving(dceideog, replace)
graph export dceideog.pdf, replace
graph export dceideog.eps, replace preview(on)
graph export dceideog.tif, replace
*lab var lr_dist "Absolute Distance to Party Judge is leaning towards"
exit