Sunday, June 23, 2013

I guessed wrong (kind of)

In a recent post, I argued that Edward Snowden's extradition from Hong Kong was likely. Now this happens:
US whistle-blower Edward Snowden has left Hong Kong and is on a commercial flight to Russia, but Moscow will not be his final destination. 
The fugitive whistle-blower boarded the Moscow-bound flight earlier on Sunday and would continue on to another country, possibly Cuba then Venezuela, according to media reports. 
The Hong Kong government said in a statement that Snowden had departed "on his own accord for a third country through a lawful and normal channel".
 The Hong Kong government played the politics of this case very well. From their press release
The US Government earlier on made a request to the HKSAR Government for the issue of a provisional warrant of arrest against Mr Snowden. Since the documents provided by the US Government did not fully comply with the legal requirements under Hong Kong law, the HKSAR Government has requested the US Government to provide additional information so that the Department of Justice could consider whether the US Government's request can meet the relevant legal conditions. As the HKSAR Government has yet to have sufficient information to process the request for provisional warrant of arrest, there is no legal basis to restrict Mr Snowden from leaving Hong Kong.
Provisions that allow for requests of "additional information" are common in many extradition treaties. Certainly its not known what was in the documents provided by the United States government and precisely how they did not comply with Hong Kong law, but it is very clear that this was the easiest way to deny extradition without explicitly refusing it. Snowden's case is a particularly challenging one, given that the U.S. chose to indict Snowden under the Espionage act. The Hong Kong government may have a strong argument that the initial documents were insufficient, even if it's unlikely that the United States will believe it. The novelty of this case makes a request for additional information perfectly legitimate, even if  convenient given Snowden's subsequent departure. While the H.K.-U.S. legal cooperation may have been somewhat slighted, the HK government's decision is unlikely to affect its relationships with other states since they held to the letter and intent of the treaty and, more importantly, China did not appear to overtly intervene.

So, I was wrong...somewhat. In the original post, I included the caveat that my prediction assumed Snowden would not choose to flee Hong Kong, since a long and drawn-out extradition process would also give him ample time to escape. I thought that for Snowden, transit to a non-extraditable third country was undesirable, otherwise he would have simply gone there in the first place. However, it appears that self-preservation ultimately won out and Venezuela is Snowden's new destination. lthough the United States does have an extradition treaty with Venezuela, it dates back to 1923. Moreover, the U.S. and Venezuela historically have had an extremely rocky relationship over legal cooperation particularly after the high profile refusal of the U.S. to extradite accused airline bomber Luis Posada Carriles .The current Venezuelan government certainly would oppose Snowden's transfer, but even if it chose to dust off the old agreement and comply with its exact provisions, the United States would have an extremely weak case. Unlike the U.S.-HK agreement, it does not have a mutual criminality clause, meaning that the only offenses that are extraditable are the ones explicitly listed in the agreement. The list is very short and extremely dated ("willfull and unlawful destruction or obstruction of railroads" is the 6th offense on the list). Espionage would certainly be treated as a political offense, and under Article 3, even offenses connected to a political offense (in Snowden's case, "theft of government property") are non-extraditable. Despite the treaty, Snowden seems to be untouchable while in Venezuela. [EDIT: Apparently Snowden is instead seeking asylum in Ecuador]

While it is impossible to know what would have happened had Snowden stayed in HK, his flight does suggest that he did not believe that his defense against extradition would have been successful. The HKSAR's hands are more tied than are Venezuela's. All things being equal, Snowden would certainly have preferred to stay in HK rather than Venezuela. However, the Hong Kong government seemed to have made it clear that it could not hold out against extradition for much longer without putting its legal arrangements into much more serious jeopardy. That China chose not to explicitly intervene at the outset does illustrate that international law does operate as a constraint, even if states can strategically use it to their advantage. Delaying extradition while offloading Snowden to a less constrained third party was an inexpensive way of satisfying the Chinese government's preference against extradition while minimizing damage to Hong Kong's international legal standing.

The closing paragraph of the press release is also absolutely perfect from a political standpoint
Meanwhile, the HKSAR Government has formally written to the US Government requesting clarification on earlier reports about the hacking of computer systems in Hong Kong by US government agencies. The HKSAR Government will continue to follow up on the matter so as to protect the legal rights of the people of Hong Kong.
Translation: "I am altering the deal, pray I don't alter it any further"

Monday, June 17, 2013

Marginal Effect Plots for Interaction Models in R

Political scientists often want to test hypotheses regarding interactive relationships. Typically, a theory might imply that the effect of one variable on another depends on the value of some third quantity. For example, political structures like institutional rules might mediate the effect of individual preferences on political behavior. Scholars using regression to test these types of hypotheses will include interaction terms in their models. These models take on the basic form (in the linear case)

$$y = \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2 + \epsilon$$

where $\beta_3$ is the coefficient on the "interaction term" $x_1x_2$. However, interaction terms are often tricky to work with. Bear Braumoeller's 2004 article in International Organization illustrated how published quantitative papers often made basic mistakes in interpreting interaction models. Scholars frequently would mis-interpret the lower-order coefficients, $\beta_1$ and $\beta_2$. Published research articles would argue that a significant coefficient on $x_1$  suggests a meaningful relationship between $x_1$ and $y$. In a model with an interaction term, this is not necessarily the case. The marginal effect of $x_1$ on $y$ in a linear model is not equal to $\beta_1$, it is actually $\beta_1 + \beta_2x_2$. That is, $\beta_1$, is the relationship between $x_1$ and $y$ when $x_2$ is zero. Often this is a meaningless quantity since some variables (for example, the age of a registered voter) cannot possibly equal zero.

The correct way to interpret an interaction model is to plot out the relationship between $x_1$ and $y$ for the possible values of $x_2$. It's not a matter of simply looking at a single coefficient and declaring a positive or negative effect. Even if the interaction coefficient $\beta_3$ is significant, the actual meaning of the interaction can differ. One interpretation may be that $x_1$ is always positively related with y, but the effect is greater for some values of $x_2$. Another is that $x_1$ is sometimes positively associated with $y$ and sometimes negatively associated with y, depending on the value of $x_2$. Looking only at the coefficients does not capture these two different types of relationships.

Luckily, figuring out the marginal effect of $x_1$ on $y$ is rather easy. In a linear model, the point estimate for how much $y$ increases when $x_1$ is increased by 1, $\hat{\delta_1}$, is equal to

$$\hat{\delta_1} = \hat{\beta_1} + \hat{\beta_3}x_2$$

The variance of the estimator $\hat{\delta_1}$ is

$$Var(\delta_1) = Var(\hat{\beta_1} + \hat{\beta_3}x_2)$$
$$Var(\delta_1) = Var(\hat{\beta_1}) + Var(\hat{\beta_3}x_2) + 2Cov(\hat{\beta_1}, \hat{\beta_3}x_2)$$
$$Var(\delta_1) = Var(\hat{\beta_1}) + x_2^2Var(\hat{\beta_3}) + 2x_2Cov(\hat{\beta_1}, \hat{\beta_3})$$

Note that when $x_2 = 0$, $\hat{\delta_1} = \hat{\beta_1}$ and $Var(\hat{\delta_1}) = Var(\hat{\beta_1})$. The standard deviation or standard error of $\hat{\delta_1}$ is equal to the square root of this variance. Extending these formulae to the non-linear case is easy - the coefficient estimates and variances are computed the same way, and from there one can simulate relevant quantities of interest (probabilities, predicted counts).

An even simpler way to calculate the marginal effect of $x_1$ for an arbitrary value of $x_2$ is to re-center $x_2$ by subtracting from it some value $k$ and re-estimating the regression model. The coefficient and standard error of $x_1$ will be the marginal effect of x_1 on  y when $x_2 = k$. A handy trick is to mean-center $x_2$ (subtract the mean of $x_2$ from each value of $x_2$). Then, the coefficient on $x_1$ (in a linear model) is equal to the average effect of $x_1$ on $y$ over all of the values of $x_2$.*

Braumoeller's article came with Stata code to make interaction plots (though I can't seem to find it online anymore). In 2011, Stata 12 added the marginsplot command, making these sorts of figures even easier to create. Quantitative political scientists appear to have taken notice. I could not find a single article in the 2012/2013 issues of the American Political Science Review, American Journal of Political Science, and International Organization that used an interaction model without including a corresponding marginal effects plot. Correctly interpreting interaction effects is now about as easy as running the regression itself.

This is all well and good for Stata users, but what about R? Coding up these sorts of plots from scratch can get a little tedious, and no canned function (to my knowledge) exists on CRAN. Moreover, the availability of easy-to-use functions for statistical methods seems to encourage wider use among applied quantitative researchers. 

So here's my code for quickly making decent-looking two-variable interaction plots in R. The first function, interaction_plot_continuous(), plots the estimated marginal effect for one variable that is interacted with a continuous "moderator." In simple terms, it plots $\delta_1$ for the range of values of $x_2$.

Below is an example of the output. For the sake of demonstration, I took the built-in R dataset airquality, which contains air quality measurements in New York taken during the 70s, and regressed maximum daily temperature on ozone content, wind speed and an interaction of ozone and wind. The plot below shows the marginal effect of wind speed moderated by ozone content:

Note that just interpreting the main effect of wind speed at zero (the regression coefficient) gives a misleading picture of the actual relationship. At 0 parts per billion of ozone, wind speed is negatively associated with temperature. But for higher values of ozone content wind speed becomes positively associated with temperature (I have no idea why this is the case, or why there would even be an interaction - my guess is there's some omitted variable). For the average value of ozone concentration (the red-dashed line), wind speed is not significantly associated with temperature.

Sometimes the moderating variable is a binary indicator. In these cases, a continuous interaction plot like the one above is probably less useful - we just want the effect when the moderator is "0" and when it's "1". The second function in the file, interaction_plot_binary(), handles this case. Again to demonstrate, I took the classic LaLonde job training experiment dataset and fitted a simple (and very much wrong) regression model. The model predicted real 1978 wages using assignment to a job training program (treatment), marital status and an interaction of the two. I then estimated the marginal "effect" of treatment assignment on wages for each of the two marital status levels. In this case, the interaction was not statistically significant.

So hopefully these two functions will save R users some time. Note that these functions also work perfectly fine with non-linear models, but the quantity plotted will be the regression coefficient and not necessarily something with substantive meaning. Unlike simple OLS, the coefficients of most non-linear models do not have a clear interpretation. You'll have to do a little bit of work to convert the coefficient estimates into something actually meaningful.

Feel free to copy and share this code, and let me know if there are any bugs. If there's enough demand, I might clean it up more and put together an R package (time permitting of course).

* I'm using the word "effect" here loosely and as shorthand for "relationship between." Assigning a causal relationship between two variables requires further conditional independence assumptions that may or may not hold.

Edit: Thanks to Patrick Lam for pointing out a typo in the variance formula (missed the 2) - fixed above and in the code.

Edit 6/18: Forgot to also include a link to Brambor, Clark, and Golder's excellent 2006 paper in Political Analysis which discussed similar issues regarding interpretation of interaction terms.

Monday, June 10, 2013

Will Edward Snowden be Extradited?

On Sunday, 29-year old Booz Allen Hamilton employee Edward Snowden was revealed to be the source behind the recent disclosure of highly classified documents describing top secret National Security Agency surveillance programs of telephone and internet data. Snowden disclosed his identity to the Guardian in an interview from Hong Kong, where he currently remains. His choice to leave the U.S. for Hong Kong was, in his words, driven by the belief that the Chinese-administered region has a "spirited commitment to free speech and the right of political dissent." But Snowden is not completely free from the reach of U.S. law. The United States and Hong Kong have in force an extradition treaty under which the U.S. could obtain his return for prosecution.

Why did Snowden escape to Hong Kong, likely knowing that he could be extradited? My sense is that it isn't because he was poorly informed, but rather because his no-extradition alternatives were not particularly great. The overlap between countries with "spirited commitments" to freedom and countries with which the United States does not have an extradition treaty is virtually nil. Even Iceland, Snowden's asylum target, has an extradition treaty with the U.S. in force since the 1900s.

Countries the US has extradition treaties with (light blue, US shown here in dark blue) From Wikimedia Commons
But will Snowden be extradited back to the United States? I would argue that yes, extradition is probable*, but the process will be very tedious simply because the offense is so different from previous extradition cases. Whereas most extradition requests concern explicitly criminal matters, Snowden's may be a "political offense" for which extradition is not permitted. Working out this question will take time, but Hong Kong's track record of typically approving requests suggests that the odds are in the U.S. government's favor. Moreover, I do not think that Beijing will be able to tip the legal scales towards rejection if it so desires, despite its influence in Hong Kong.

China's preferences in this matter are certainly relevant, but the law is much more of a constraint in this process than some commentators have suggested. The security stakes are actually rather low. Snowden is not particularly useful as an intelligence asset. He no longer has access to NSA databases - all he has are whatever documents or files he could bring with him to Hong Kong, documents that were apparently selectively chosen. This is not a Cablegate-style data-dump and PRISM is hardly China's greatest intelligence fear. Certainly Beijing might want to obtain anything that Snowden still has in his possession, but it's unclear how cooperative he would be given his political leanings.

Influencing the extradition proceedings is also not costless for Beijing. Despite China's sovereignty over Hong Kong, the SAR has significant political autonomy in most areas. Indeed, it can and has concluded a number of extradition and mutual legal assistance treaties with other states. Hong Kong is a global financial hub and devotes significant legal and administrative resources to combating money laundering, financial crimes, trafficking and other such offenses. The high cross-border mobility of these types of offenders gives the Government of Hong Kong significant incentives to maintain the integrity of its extradition agreements in order to prosecute financial criminals who flee its territory. Undue influence by Beijing in the process might jeopardize the credibility of Hong Kong's other agreements. While China's ability to weigh in on extradition is clear, the decision to refuse extradition ultimately lies with the Chief Executive of Hong Kong.

Moreover, Hong Kong is also much more limited in its ability to reject extradition than some news reports have suggested. This South China Morning Post article, quoted by Doug Mataconis at OTB, gives the impression that China has de-facto veto power over any extradition request. This is not the case.

The SCMP article states that, according to the 1996 treaty, "Hong Kong has the "right of refusal when surrender implicates the 'defense, foreign affairs or essential public interest or policy'." However, this provision is irrelevant to the Snowden case since, according to Article 3, it only applies when the subject of the extradition request is a national of the PRC.
...(3) The executive authority of the Government of Hong Kong reserves the right to refuse the surrender of nationals of the State whose government is responsible for the foreign affairs relating to Hong Kong in cases in which: 
(a) The requested surrender relates to the defence, foreign affairs or essential public interest or policy of the State whose government is responsible for the foreign affairs relating to Hong Kong, or...
The article also notes that Hong Kong could reject a request if it determines that the extradition is "politically motivated." However, the article omits the fact that this determination is to be made by the "competent authority of the requested Party" which, according to the committee report that accompanied the treaty's ratification, is interpreted as the judiciary and not the executive of Hong Kong.
...Notwithstanding the terms of paragraph (2) of this Article, surrender shall not be granted if the competent authority of the requested Party, which for the United States shall be the executive authority, determines: 
(a) that the request was politically motivated...
Meddling with Hong Kong's independent judiciary would be politically costly for Beijing. In fact, it could jeopardize the extradition agreement itself. When the U.S. Senate ratified the treaty, it attached an understanding emphasizing the continued independence of Hong Kong's judiciary
"Any attempt by the Government of Hong Kong or the Government of the People's Republic of China to curtail the jurisdiction and power of final adjudication of the Hong Kong courts may be considered grounds for withdrawal from the Agreement."
It's unlikely that Snowden could win a political persecution argument. Regardless of whether his actions are justified, they very clearly violated U.S. statute - he is not being arbitrarily singled out. A more potentially persuasive case for refusal might be made in light of Bradley Manning's treatment in pre-trial detention. Article 7 permits the refusal of extradition "when such surrender is likely to entail exceptionally serious consequences related to age or health." However, concerns over treatment are typically resolved by bilateral legal assurances that the extradited person will not be mistreated. Indeed, U.S. authorities have strong incentives to not mistreat Snowden if he is extradited as such actions would likely jeopardize future legal cooperation with Hong Kong.

This is not to say that extradition is a sure thing, but the challenges facing Snowden's extradition are currently more legal than political. Pretty much all previous extradition proceedings between the U.S. and Hong Kong have concerned clear-cut criminal offenses - violent and white-collar crimes in particular. Hong Kong has consistently accepted U.S. requests for extradition for these cases. But the leaking of classified information might fall under the category of "political offenses" for which extradition is prohibited. Extradition treaties have, for centuries contained provisions that refuse extradition for "offenses of a political character." The exception emerged in treaties during the 1800s as a way of limiting the ability of states to pursue dissenters and political opponents. However, interpretation of what constitutes a "political offense" has always been unclear and open to interpretation. Fearing that a vague interpretation of "political offense" would unduly burden states, most treaties since then have included provisions delineating offenses that cannot be considered "political." Compared to most modern treaties, the U.S.-Hong Kong treaty has relatively few political offense exceptions: murder or other crimes committed against a head of state are exempt as are offenses criminalized by a multilateral international agreement. This leaves a lot of grey area.

Most treaties signed in the last half-century do not explicitly enumerate offenses for which extradition is granted, typically defining an extraditable offense as anything criminalized under the laws of both parties. However, the Hong Kong treaty has both a list and a provision for extradition for "dual criminality." A request for extradition under the Espionage Act would likely fall under the scope of extraditable offenses since Hong Kong's Official Secrets Ordinance has similar provisions criminalizing the release of classified information, but could potentially be ruled a political offense. Law professor Julian Ku suggests that the U.S. might choose to pursue an alternative route and seek extradition under an offense explicitly enumerated in the treaty.
The Snowden leaks have now been referred to the Justice Department, and U.S. prosecutors have several options available to them. According to Ku, prosecutors may avoid charging Snowden under the Espionage Act -- which could be considered a political prosecution by courts in Hong Kong -- and indict him under a different statute. 
Among the crimes listed on the U.S.-Hong Kong agreement as within the bounds of extradition, one offense in particular stands out: "the unlawful use of computers."
Requesting extradition for an explicitly enumerated offense might help support an argument that the offense is not a political one. The patchwork of U.S. classification law also appears to have provisions relating to the "unlawful use of computers" - the Computer Fraud and Abuse Act.  According to a CRS report,
18 U.S.C. Section 1030(a)(1) punishes the willful retention, communication, or transmission, etc., of classified information retrieved by means of knowingly accessing a computer without (or in excess of) authorization, with reason to believe that such information “could be used to the injury of the United States, or to the advantage of any foreign nation.”...The provision imposes a fine or imprisonment for not more than 10 years, or both, in the case of a first offense or attempted violation. Repeat offenses or attempts can incur a prison sentence of up to 20 years.
Moreover, the sentences under the Computer Fraud and Abuse Act are comparable to those in the relevant Espionage Act provisions. Assuming U.S. prosecutors are strategic, I would expect the forthcoming request  to be for offenses under the CFAA and not the Espionage Act.

The base rate for extradition approval is high so the easiest bet is that Snowden will likely be extradited (assuming he does not successfully flee Hong Kong as well). But this case is markedly different from previous ones. There is not much "data" for extradition when the offense involves the leaking of classified information. It has certainly occurred in other contexts, but is entirely new ground for the U.S.-Hong Kong legal cooperation relationship (I'd love it if anyone could point me to more examples). Snowden may have some basis for challenging a request and extradition proceedings are likely to drag on for some time. Indeed, it's not entirely impossible for Hong Kong to deny extradition, though it would generate significant political friction with the U.S. The legal deck is stacked in the United States' favor, despite the novelty of this case. So be wary of pop-Realist foreign policy commentaries that claim it's all about China - Chinese influence in Hong Kong's affairs is neither infinite, nor cost-free.

*Sadly, I don't have a model for making a more precise claim/prediction here, though an interesting project might involve using GDELT to identify successful/failed extradition cases and model P(approval) using a combination of political and legal variables. Certainly more than a blog post can carry.