Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Stata script to replicate "Why is democracy declining in Latin America?"
* The main model
xtscc pressfree leftism presvrl leftismXpresvrl ief gdpcapita
* Effect of VRLpres at in-sample min, ave, and max, values of presidential leftism
lincom _b[presvrl] + _b[leftismXpresvrl]*1.5
lincom _b[presvrl] + _b[leftismXpresvrl]*7.194014
lincom _b[presvrl] + _b[leftismXpresvrl]*18
* Figure 1 data (the 'xtscc' add-on does not accept the # operator, so the 'margins'
* command could not be used to graph the interaction)
lincom _b[presvrl] + _b[leftismXpresvrl]*0
lincom _b[presvrl] + _b[leftismXpresvrl]*1
lincom _b[presvrl] + _b[leftismXpresvrl]*2
lincom _b[presvrl] + _b[leftismXpresvrl]*3
lincom _b[presvrl] + _b[leftismXpresvrl]*4
lincom _b[presvrl] + _b[leftismXpresvrl]*5
lincom _b[presvrl] + _b[leftismXpresvrl]*6
lincom _b[presvrl] + _b[leftismXpresvrl]*7
lincom _b[presvrl] + _b[leftismXpresvrl]*8
lincom _b[presvrl] + _b[leftismXpresvrl]*9
lincom _b[presvrl] + _b[leftismXpresvrl]*10
lincom _b[presvrl] + _b[leftismXpresvrl]*11
lincom _b[presvrl] + _b[leftismXpresvrl]*12
lincom _b[presvrl] + _b[leftismXpresvrl]*13
lincom _b[presvrl] + _b[leftismXpresvrl]*14
lincom _b[presvrl] + _b[leftismXpresvrl]*15
lincom _b[presvrl] + _b[leftismXpresvrl]*16
lincom _b[presvrl] + _b[leftismXpresvrl]*17
lincom _b[presvrl] + _b[leftismXpresvrl]*18
lincom _b[presvrl] + _b[leftismXpresvrl]*19
lincom _b[presvrl] + _b[leftismXpresvrl]*20
* Uruguay and Bolivia examples
lincom _b[presvrl] + _b[leftismXpresvrl]*5.53
lincom _b[presvrl] + _b[leftismXpresvrl]*14.76
lincom _b[presvrl] + _b[leftismXpresvrl]*5.31
lincom _b[presvrl] + _b[leftismXpresvrl]*16.12
* Disaggregating press freedom (and rechecking the interaction)
* legal subcomponent
xtscc legalfree leftism presvrl leftismXpresvrl ief gdpcapita
lincom _b[presvrl] + _b[leftismXpresvrl]*0
lincom _b[presvrl] + _b[leftismXpresvrl]*1
lincom _b[presvrl] + _b[leftismXpresvrl]*2
lincom _b[presvrl] + _b[leftismXpresvrl]*3
lincom _b[presvrl] + _b[leftismXpresvrl]*4
lincom _b[presvrl] + _b[leftismXpresvrl]*5
lincom _b[presvrl] + _b[leftismXpresvrl]*6
lincom _b[presvrl] + _b[leftismXpresvrl]*7
lincom _b[presvrl] + _b[leftismXpresvrl]*8
lincom _b[presvrl] + _b[leftismXpresvrl]*9
lincom _b[presvrl] + _b[leftismXpresvrl]*10
lincom _b[presvrl] + _b[leftismXpresvrl]*11
lincom _b[presvrl] + _b[leftismXpresvrl]*12
lincom _b[presvrl] + _b[leftismXpresvrl]*13
lincom _b[presvrl] + _b[leftismXpresvrl]*14
lincom _b[presvrl] + _b[leftismXpresvrl]*15
lincom _b[presvrl] + _b[leftismXpresvrl]*16
lincom _b[presvrl] + _b[leftismXpresvrl]*17
lincom _b[presvrl] + _b[leftismXpresvrl]*18
lincom _b[presvrl] + _b[leftismXpresvrl]*19
lincom _b[presvrl] + _b[leftismXpresvrl]*20
* political subcomponent
xtscc polfree leftism presvrl leftismXpresvrl ief gdpcapita
lincom _b[presvrl] + _b[leftismXpresvrl]*0
lincom _b[presvrl] + _b[leftismXpresvrl]*1
lincom _b[presvrl] + _b[leftismXpresvrl]*2
lincom _b[presvrl] + _b[leftismXpresvrl]*3
lincom _b[presvrl] + _b[leftismXpresvrl]*4
lincom _b[presvrl] + _b[leftismXpresvrl]*5
lincom _b[presvrl] + _b[leftismXpresvrl]*6
lincom _b[presvrl] + _b[leftismXpresvrl]*7
lincom _b[presvrl] + _b[leftismXpresvrl]*8
lincom _b[presvrl] + _b[leftismXpresvrl]*9
lincom _b[presvrl] + _b[leftismXpresvrl]*10
lincom _b[presvrl] + _b[leftismXpresvrl]*11
lincom _b[presvrl] + _b[leftismXpresvrl]*12
lincom _b[presvrl] + _b[leftismXpresvrl]*13
lincom _b[presvrl] + _b[leftismXpresvrl]*14
lincom _b[presvrl] + _b[leftismXpresvrl]*15
lincom _b[presvrl] + _b[leftismXpresvrl]*16
lincom _b[presvrl] + _b[leftismXpresvrl]*17
lincom _b[presvrl] + _b[leftismXpresvrl]*18
lincom _b[presvrl] + _b[leftismXpresvrl]*19
lincom _b[presvrl] + _b[leftismXpresvrl]*20
* economic subcomponent
xtscc econfree leftism presvrl leftismXpresvrl ief gdpcapita
lincom _b[presvrl] + _b[leftismXpresvrl]*0
lincom _b[presvrl] + _b[leftismXpresvrl]*1
lincom _b[presvrl] + _b[leftismXpresvrl]*2
lincom _b[presvrl] + _b[leftismXpresvrl]*3
lincom _b[presvrl] + _b[leftismXpresvrl]*4
lincom _b[presvrl] + _b[leftismXpresvrl]*5
lincom _b[presvrl] + _b[leftismXpresvrl]*6
lincom _b[presvrl] + _b[leftismXpresvrl]*7
lincom _b[presvrl] + _b[leftismXpresvrl]*8
lincom _b[presvrl] + _b[leftismXpresvrl]*9
lincom _b[presvrl] + _b[leftismXpresvrl]*10
lincom _b[presvrl] + _b[leftismXpresvrl]*11
lincom _b[presvrl] + _b[leftismXpresvrl]*12
lincom _b[presvrl] + _b[leftismXpresvrl]*13
lincom _b[presvrl] + _b[leftismXpresvrl]*14
lincom _b[presvrl] + _b[leftismXpresvrl]*15
lincom _b[presvrl] + _b[leftismXpresvrl]*16
lincom _b[presvrl] + _b[leftismXpresvrl]*17
lincom _b[presvrl] + _b[leftismXpresvrl]*18
lincom _b[presvrl] + _b[leftismXpresvrl]*19
lincom _b[presvrl] + _b[leftismXpresvrl]*20
* Disaggregating economic freedom (and rechecking the interaction)
xtscc pressfree leftism presvrl leftismXpresvrl business trade fiscal financial property investment gdpcapita
lincom _b[presvrl] + _b[leftismXpresvrl]*0
lincom _b[presvrl] + _b[leftismXpresvrl]*1
lincom _b[presvrl] + _b[leftismXpresvrl]*2
lincom _b[presvrl] + _b[leftismXpresvrl]*3
lincom _b[presvrl] + _b[leftismXpresvrl]*4
lincom _b[presvrl] + _b[leftismXpresvrl]*5
lincom _b[presvrl] + _b[leftismXpresvrl]*6
lincom _b[presvrl] + _b[leftismXpresvrl]*7
lincom _b[presvrl] + _b[leftismXpresvrl]*8
lincom _b[presvrl] + _b[leftismXpresvrl]*9
lincom _b[presvrl] + _b[leftismXpresvrl]*10
lincom _b[presvrl] + _b[leftismXpresvrl]*11
lincom _b[presvrl] + _b[leftismXpresvrl]*12
lincom _b[presvrl] + _b[leftismXpresvrl]*13
lincom _b[presvrl] + _b[leftismXpresvrl]*14
lincom _b[presvrl] + _b[leftismXpresvrl]*15
lincom _b[presvrl] + _b[leftismXpresvrl]*16
lincom _b[presvrl] + _b[leftismXpresvrl]*17
lincom _b[presvrl] + _b[leftismXpresvrl]*18
lincom _b[presvrl] + _b[leftismXpresvrl]*19
lincom _b[presvrl] + _b[leftismXpresvrl]*20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment