I study coups d'etat. I would like to understand the relationship between leader/country characteristics and the likelihood of coup attempts.

I have a leader-country-year dataset with one entry for every year that a given leader in a given country was in power. I also have data on leader and country characteristics. Some of these variables do not vary over time (e.g., was the leader elected) and some do (e.g., whether the country is at war with another country). I've made a mock dataset below to illustrate what my data look like.

leader_id country_id years_since_entering elected war coup_attempt
1 1 0 1 0 0
1 1 1 1 1 0
1 1 2 1 1 1
1 1 3 1 1 0
1 1 4 1 1 0
1 1 5 1 1 1
--------- -------- ------------------- -------- --- --- ---
2 1 0 0 1 0
2 1 1 0 1 0
2 1 2 0 0 0
2 1 3 0 0 0

I would like to use a Cox PH model to understand the effect that these variables have on a leader's survival time until a coup attempt is made. So, the Cox PH "event" is coup_attempt. The covariates are elected and war.

Some details I want to note:

  • There can be multiple coup attempts in one leader's tenure. (leader_id == 1 in the mock dataset experiences two coup attempts)
  • The same country can have multiple leaders, though they are never in the leadership position at the same time. (country_id == 1 in the mock dataset has two leaders)

I'm planning to use the survival package in R and run a model like this:

fit <- coxph(Surv(start, stop, coup_attempt) ~ elected + war +
 strata(country_id) + cluster(country_id), data = df)

Some questions I have: (I will explain the strata and cluster choices in the second question)

  1. I know that I need to reshape my data to have start and stop intervals to use with the coxph function. Can I make all of the start and stop intervals in my coxph dataset the same length? Specifically, can I make them one year intervals so that they capture all of the changes in the war variable? The dataset would look like this:
leader_id country_id years_since_entering elected war coup_attempt start stop
1 1 0 1 0 0 0 1
1 1 1 1 1 0 1 2
1 1 2 1 1 1 2 3
1 1 3 1 1 0 3 4
1 1 4 1 1 0 4 5
1 1 5 1 1 1 5 6
--------- -------- ------------------- -------- --- --- --- ---
2 1 0 0 1 0 0 1
2 1 1 0 1 0 1 2
2 1 2 0 0 0 2 3
2 1 3 0 0 0 3 4
  1. I included strata(country_id) + cluster(country_id) in the coxph function to account for the correlation between leaders of the same country. There might be a country specific effect (e.g., Iraq has a higher baseline likelihood of coups than Canada), which I aim to capture with strata(country_id). There may also be correlation in the observations of leaders of the same country (e.g., leaders from Iraq are correlated), which I aim to capture with the cluster(country_id). Does this use of strata and cluster make sense? Or would you recommend another way to address these issues?
  2. A leader can experience multiple coup attempts. How do I account for the fact that a single unit can have multiple "events" in the Cox PH?
  3. What, if anything, should I do about data censoring? My data end in 2019, but that doesn't mean that all leaders leave office or stop experiencing coup attempts in 2019.

Any help with any of these questions would be very much appreciated. Thank you in advance!

  • 1
    $\begingroup$ This person-period data set that might be evaluated directly with binomial regression, in a discrete-time survival model. That's particularly the case as you seem already to have time bins of 1 year widths. A complementary log-log link instead of the usual logistic link results in a grouped proportional hazards model; see this page. You could handle correlations with random effects in the binomial model. Censoring is handled as it would be in a Cox model: an individual is omitted from analysis when no longer known to be at risk. $\endgroup$
    – EdM
    May 22, 2023 at 21:26
  • $\begingroup$ Thanks, @EdM! This is really helpful. One question -- how is a discrete-time survival model different from running a logit with coup_attempt as the DV and years_since_entering as an independent variable? Or are they the same? I have actually tried running this logit to predict the probability of a coup attempt in a given year (controlling for a leader's time since entering office), but I was worried that I wasn't capturing the "time until coup attempt" hazard element that I cared about. $\endgroup$
    – Rabbit
    May 23, 2023 at 16:56

1 Answer 1


A discrete-time survival model with a single event type (even if repeated) can be modeled as a binomial regression with data as you seem to have already, in a person-period format. That is, you have one row of data for each individual at risk during each time period, with each row indicating the corresponding individual, the time period, the covariate values in effect during the period, and an indicator of whether or not the event happened during that period. In that format, there simply are no data values for an individual after the last observation, handling censoring as in other survival models and posing no problems so long as censoring in uninformative.

Capturing the relationship between years_since_entering and outcome is a matter of how you choose to model that predictor. If there are only a few values of years_since_entering covering all cases, you might treat that as a multi-level categorical predictor and get a separate coefficient for each year. That's analogous to what you would get with a Cox model, in which the baseline hazard over time is zero between event times and can take arbitrary positive values at each event time.

If you have many values of years_since_entering and wish to model it as a numeric predictor, you should use a flexible modeling strategy like a regression spline. If you just include it as a numeric predictor the usual way you are imposing, in a logistic regression model, a strictly linear association between that variable and the log-odds of outcome. That's not likely to hold.

There might be some advantage to using a complementary log-log link in your binomial regression instead of the usual logistic link, as that directly represents what you would get in a proportional-hazards model with times grouped like this.

You can then incorporate the intra-individual and intra-country considerations as random effects, in principle including things like random "slopes" for covariates if there are enough data (probably only on an among-country rather than an among-individual level).

If there was at most one event possible per individual you wouldn't have to include random effects per individual, but in your situation that would be important, presumably as a random intercept. For an individual with more than 1 coup attempt, you also need to think about whether and how to incorporate the prior coup attempt into the model; otherwise, you assume independence among coup attempts on the same individual, which seems unlikely.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.