Hi everyone,
First time posting; this will hopefully be a simple fix. I'm a political scientist doing a separation-of-powers-based project, and the literature in this area typically features models with variables accounting for when institutions are 'constrained' and thus their behavior expected to be different compared to when they are not 'constrained'. So, I need a variable which is coded as 0 when the Court is within the Pareto set of the three other major political institutions (House, Senate, and President), and when it is not, coded as the absolute value of the ideological distance between the Court's ideal point and the nearest of those three.
The variable needs to be coded as 'unconstrained' (=0) when we have a situation where the Court's ideal point is within the Pareto set, e.g. any one of the three other ideal points is to the left or the right of the Court (i.e. the Court is not the most extreme of the four);
And constrained (=absolute value of Court and closest institution) when not within the Pareto set, e.g. when the Court's ideal point is to the left or the right of all three other ideal points.
So I wrote the following code built on existing variables measuring the ideal points of the President, and the medians of the Court, House, and Senate, but it is not giving me what I need. Because all of these ideology measures are modeled as real numbers between [-1, 1], they are in the same space, and so I had the idea to use a set of inequalities to tell Stata what to do. I made one command for each scenario.
(note: JCS measures the Supreme Court's ideal point)
gen SOPconstraint=.
*** unconstrained
replace SOPconstraint=0 if house < JCS < senate < pres
replace SOPconstraint=0 if house < JCS < pres < senate
replace SOPconstraint=0 if house < pres < JCS < senate
replace SOPconstraint=0 if senate < pres < JCS < house
replace SOPconstraint=0 if senate < JCS < pres < house
replace SOPconstraint=0 if senate < JCS < house < pres
replace SOPconstraint=0 if pres < JCS < house < senate
replace SOPconstraint=0 if pres < house < JCS < senate
replace SOPconstraint=0 if pres < JCS < senate > house
*** house
replace SOPconstraint=abs(JCS-house) if JCS < house < pres < senate
replace SOPconstraint=abs(JCS-house) if JCS < house < senate < pres
replace SOPconstraint=abs(JCS-house) if JCS > house > senate > pres
replace SOPconstraint=abs(JCS-house) if JCS > house > pres > senate
*** sen
replace SOPconstraint=abs(JCS-senate) if JCS < senate < pres < house
replace SOPconstraint=abs(JCS-senate) if JCS < senate < house < pres
replace SOPconstraint=abs(JCS-senate) if JCS > senate > house > pres
replace SOPconstraint=abs(JCS-senate) if JCS > senate > pres > house
*** pres
replace SOPconstraint=abs(JCS-pres) if JCS < pres < senate < house
replace SOPconstraint=abs(JCS-pres) if JCS < pres < house < senate
replace SOPconstraint=abs(JCS-pres) if JCS > pres > house > senate
replace SOPconstraint=abs(JCS-pres) if JCS > pres > senate > house
The problem seems to be that the commands are overlapping and thus overwriting one another for some reason. The variable I get depends on which commands get run first. Second, the commands modeling the unconstrained scenarios do not leave any results. There are no entries coded as 0 once the commands are all run. And of course there should be a great many such scenarios.
I'm getting the sense that my commands are structured incorrectly. I'm not sure if I can use four-term inequalities as I'm trying to do here, or perhaps I need more detailed commands built from other terms like & or |. Any thoughts?
P.S.: a note on theory--
The theory is based on a simple formal-modeling setup where, for example, the Supreme Court is represented as a single point in a one-dimensional ideological space (defined by the median member of the institution) along with other institutions with power to punish the Court for untoward behavior. The Senate, House, and President are also all represented as single points in ideological space. The Court, for example, is defined as 'unconstrained' when its ideal point is within the Pareto set--that is, when it sits between the ideal points of the other three institutions. That means that the Court can behave as it likes, and given that generally all three institutions would have to agree to punish the Court for its behavior, at least one of them will prefer the Court's ideal point to any status quo point in the space. If the Court is outside of that set, then there are status quos which the Court cannot move because all three will prefer an alternative to the Court's ideal point. Thus, constrained when outside of the three other institutions' ideal points, and unconstrained when between them. Because these SOP models are often trying to find changes in behavior due to other institutions' actions or preferences, accounting for these constrained/unconstrained scenarios empirically becomes important.
First time posting; this will hopefully be a simple fix. I'm a political scientist doing a separation-of-powers-based project, and the literature in this area typically features models with variables accounting for when institutions are 'constrained' and thus their behavior expected to be different compared to when they are not 'constrained'. So, I need a variable which is coded as 0 when the Court is within the Pareto set of the three other major political institutions (House, Senate, and President), and when it is not, coded as the absolute value of the ideological distance between the Court's ideal point and the nearest of those three.
The variable needs to be coded as 'unconstrained' (=0) when we have a situation where the Court's ideal point is within the Pareto set, e.g. any one of the three other ideal points is to the left or the right of the Court (i.e. the Court is not the most extreme of the four);
And constrained (=absolute value of Court and closest institution) when not within the Pareto set, e.g. when the Court's ideal point is to the left or the right of all three other ideal points.
So I wrote the following code built on existing variables measuring the ideal points of the President, and the medians of the Court, House, and Senate, but it is not giving me what I need. Because all of these ideology measures are modeled as real numbers between [-1, 1], they are in the same space, and so I had the idea to use a set of inequalities to tell Stata what to do. I made one command for each scenario.
(note: JCS measures the Supreme Court's ideal point)
gen SOPconstraint=.
*** unconstrained
replace SOPconstraint=0 if house < JCS < senate < pres
replace SOPconstraint=0 if house < JCS < pres < senate
replace SOPconstraint=0 if house < pres < JCS < senate
replace SOPconstraint=0 if senate < pres < JCS < house
replace SOPconstraint=0 if senate < JCS < pres < house
replace SOPconstraint=0 if senate < JCS < house < pres
replace SOPconstraint=0 if pres < JCS < house < senate
replace SOPconstraint=0 if pres < house < JCS < senate
replace SOPconstraint=0 if pres < JCS < senate > house
*** house
replace SOPconstraint=abs(JCS-house) if JCS < house < pres < senate
replace SOPconstraint=abs(JCS-house) if JCS < house < senate < pres
replace SOPconstraint=abs(JCS-house) if JCS > house > senate > pres
replace SOPconstraint=abs(JCS-house) if JCS > house > pres > senate
*** sen
replace SOPconstraint=abs(JCS-senate) if JCS < senate < pres < house
replace SOPconstraint=abs(JCS-senate) if JCS < senate < house < pres
replace SOPconstraint=abs(JCS-senate) if JCS > senate > house > pres
replace SOPconstraint=abs(JCS-senate) if JCS > senate > pres > house
*** pres
replace SOPconstraint=abs(JCS-pres) if JCS < pres < senate < house
replace SOPconstraint=abs(JCS-pres) if JCS < pres < house < senate
replace SOPconstraint=abs(JCS-pres) if JCS > pres > house > senate
replace SOPconstraint=abs(JCS-pres) if JCS > pres > senate > house
The problem seems to be that the commands are overlapping and thus overwriting one another for some reason. The variable I get depends on which commands get run first. Second, the commands modeling the unconstrained scenarios do not leave any results. There are no entries coded as 0 once the commands are all run. And of course there should be a great many such scenarios.
I'm getting the sense that my commands are structured incorrectly. I'm not sure if I can use four-term inequalities as I'm trying to do here, or perhaps I need more detailed commands built from other terms like & or |. Any thoughts?
P.S.: a note on theory--
The theory is based on a simple formal-modeling setup where, for example, the Supreme Court is represented as a single point in a one-dimensional ideological space (defined by the median member of the institution) along with other institutions with power to punish the Court for untoward behavior. The Senate, House, and President are also all represented as single points in ideological space. The Court, for example, is defined as 'unconstrained' when its ideal point is within the Pareto set--that is, when it sits between the ideal points of the other three institutions. That means that the Court can behave as it likes, and given that generally all three institutions would have to agree to punish the Court for its behavior, at least one of them will prefer the Court's ideal point to any status quo point in the space. If the Court is outside of that set, then there are status quos which the Court cannot move because all three will prefer an alternative to the Court's ideal point. Thus, constrained when outside of the three other institutions' ideal points, and unconstrained when between them. Because these SOP models are often trying to find changes in behavior due to other institutions' actions or preferences, accounting for these constrained/unconstrained scenarios empirically becomes important.
Comment