-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathV-Dem.sas
194 lines (147 loc) · 6.58 KB
/
V-Dem.sas
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
*VARIETIES OF DEMOCRACY DATASET ANALYSIS;
PROC IMPORT DATAFILE="/home/u49757561/Honors project/datasets/V-Dem-CY-Full+Others-v12.csv"
DBMS=csv OUT=VDemAll REPLACE;
RUN;
*save import to library;
data VDemE;
set VDemAll;
where region in(1 2 3 4) and country_text_id not in("MKD" "MLT" "BIH" "MDA" "BLR" "UKR" "XKX" "RUS" "ALB");
label v2x_libdem="Liberal Democracy Index (0-1)"
v2x_polyarchy = "Electoral Democracy Index"
year="Year";
run;
proc format;
value regionr 1 = "Western Europe"
2 = "Northern Europe"
3 = "Southern Europe"
4 = "Eastern Europe";
run;
***********************************MACRO LEVEL ANALYSIS ACROSS THE ENTIRE WORLD AND EUROPE *******************************************
****************ANALYSIS ACROSS THE ENTIRE WORLD*********************************
*part of illustratoin on Huntignton's surges and delcines in democracy;
title "Trends in Liberal Democracy Worldwide";
footnote "Figure 4.1. Liberal democracy scores throughout the world";
proc sgplot data =VDemAll;
vline Year / response=v2x_libdem stat=mean markers; *group=country_text_id;
xaxis grid values=(1986 to 2021 by 5);
yaxis grid values=(.15 to .5 by .05);
label v2x_libdem="Liberal Democracy Index"
v2x_polyarchy = "Electoral Democracy Index"
year="Year";
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
run;
****************ANALYSIS ACROSS EUROPE SORTING OUT TO MATCH THE ESS*********************************;
title "Trends in Liberal Democracy Throughout Europe";
footnote "Figure 4.2. Liberal democracy scores throughout Europe";
proc sgplot data =VDemE;
vline Year / response=v2x_libdem stat=mean markers; *group=country_text_id;
xaxis grid values=(1986 to 2021 by 5);
yaxis grid values=(.5 to .85 by .05);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
run;
********************************GROUPED BY THE 4 DIFFERENT REGIONS OF EUROPE************************************************;
******Europe by groups from 2005 onward;
title "Trends in Liberal Democracy Across the Four European Regions from 2006";
footnote "Figure 4.3. Liberal democracy scores throughout Europe";
proc sgplot data =VDemE;
vline Year / response=v2x_libdem stat=mean markers group=region; *group=country_text_id;
xaxis grid values=(2006 to 2021 by 1);
yaxis grid values=(.45 to .9 by .05);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
format region regionr.;
run;
******Europe by groups from 1950 onward;
title "Trends in Liberal Democracy Across the Four European Regions from 1950";
footnote "Figure 1.8. Liberal democracy scores throughout Europe";
proc sgplot data =VDemE;
vline Year / response=v2x_libdem stat=mean markers group=region; *group=country_text_id;
xaxis grid values=(1950 to 2021 by 5);
yaxis grid values=(0 to .9 by .1);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
format region regionr.;
run;
****************ANALYSIS ACROSS WESTERN EUROPE ******************************;
data VDemWE;
set VDemE;
where region =1;
run;
title "Trends in Liberal Democracy across Western Europe";
footnote "Figure 1.8. Liberal democracy scores throughout Western Europe";
proc sgplot data =VDemWE;
vline Year / response=v2x_libdem stat=mean markers; *group=country_text_id;
xaxis grid values=(2006 to 2021 by 1);
yaxis grid values=(.7 to 1 by .05);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
run;
****************ANALYSIS ACROSS NORTHERN EUROPE ******************************;
data VDemNE;
set VDemE;
where region =2;
run;
title "Trends in Liberal Democracy across Northern Europe";
footnote "Figure 1.8. Liberal democracy scores throughout Northern Europe";
proc sgplot data =VDemNE;
vline Year / response=v2x_libdem stat=mean markers; *group=country_text_id;
xaxis grid values=(2006 to 2021 by 1);
yaxis grid values=(.7 to 1 by .05);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
run;
****************ANALYSIS ACROSS SOUTHERN EUROPE ******************************;
data VDemSE;
set VDemE;
where region =3;
run;
title "Trends in Liberal Democracy across Southern Europe";
footnote "Figure 1.8. Liberal democracy scores throughout Southern Europe";
proc sgplot data =VDemSE;
vline Year / response=v2x_libdem stat=mean markers group=country_text_id;
xaxis grid values=(2006 to 2021 by 1);
yaxis grid values=(.2 to .9 by .05);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
run;
****************ANALYSIS ACROSS EASTERN EUROPE ******************************;
proc format;
value $regionEE "HUN" = "Hungary"
"POL" = "Poland"
"ROU" = "Romania"
"BGR" = "Bulgaria"
"CZE" = "Czech Republic"
"SVK" = "Slovakia";
run;
data VDemEE;
set VDemE;
where region =4;
run;
title "Trends in Liberal Democracy Across Eastern Europe";
footnote "Figure 6.1. Liberal democracy scores throughout Eastern Europe by individual countries";
proc sgplot data =VDemEE;
vline Year / response=v2x_libdem stat=mean markers group=country_text_id;
xaxis grid values=(2006 to 2021 by 1);
yaxis grid values=(.30 to .9 by .05);
label country_text_id = "Country Abbreviation";
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
format country_text_id $regionEE.;
run;
proc print data=VDemE (obs=1000);
var year country_name country_text_id country_id v2x_libdem region;
where region in (1 2 ) and year =2019;
format region regionr.;
run;
***********************************INDIVUDAL ANALYSIS ACROSS COUNTRIES OF INTEREST*******************************************;
proc sort data =VDemAll out=VDemSorted;
by year;
where country_text_id in ("MEX" "USA" "HUN" "VEN" "POL" "FRA" "BRA" "GRB" "UKR") and year>=1900;
*where country_name ="Ukraine";
label v2x_libdem="Liberal Democracy Index"
v2x_polyarchy = "Electoral Democracy Index";
run;
%let Country= HUN;
title"Scatterplot for Liberal Democracy and Electoral Democracy index for &Country";
footnote "Figure 1.8. Liberal democracy scores throughout Eastern Europe";
proc sgplot data =VDemSorted noautolegend;
where country_text_id = "&Country";
vline Year / response=v2x_libdem stat=mean markers; *group=country_text_id;
xaxis grid values=(2006 to 2021 by 1);
yaxis grid values=(.45 to .8 by .05);
inset "Data obtained from Varieties of Democracy (V-Dem) version 12"/ position=topright border;
run;