How do you specify a binary time-series-cross-section model in lme4? I have a standard binary time-series–cross-section (BTSCS) model that I would like to specify as a mixed effects model using the lme4 package. I've read elsewhere that time-series–cross-section (TSCS) models can be conceptually understood as multilevel models (i.e., years [time] are nested within countries [cross-section]). How would you specify the model if the DV is binary, which coincides with a broader issue of temporal dependence?
Assume the standard BTSCS model as it's routinely applied in Stata. For example:
logit y x1 x2 x3 spline1 spline2 spline3, cluster(country)

How would this be specified in lme4? Are year and country separate random effects? Are they nested? What about the cubic splines and the issue of temporal dependence (see: Beck, Katz and Tucker (1998))?
I'm proficient in using lme4, but, to date, the random effect had been simple and easy to identify. Any help in tackling a more complicated puzzle would be appreciated.
References
Beck, Nathaniel, Jonathan N. Katz, and Richard Tucker. "Taking time seriously: Time-series-cross-section analysis with a binary dependent variable." American Journal of Political Science (1998): 1260-1288.
 A: I don't know Stata, but I'm going to guess that the equivalent is something like this:
library(lme4)
library(splines)  ## a 'base' package

glmer(y~x1+x2+x3+ns(time,3)+(1|country),family=binomial,data=dat)

where splines::ns(time,3) indicates a natural cubic spline with 3 knots (knot placement is chosen automatically: see ?ns).
If you have access to Stata you could try it and see whether you get similar results ...
This allows for different overall levels in different countries, but not for variation in time courses across countries.  If you have enough data you might try (ns(time,3)|country) for the random effect instead.  If you want to allow for a random effect of time (which only makes sense if you have multiple measurements of each country at each time point, or at least at most time points), then you could instead use (1|country)+(1|time) (crossed random effects of country and time).
I looked briefly at the linked reference and it doesn't seem I'm missing anything really obvious, but I'm not going to claim I read it really carefully ... (if you want to use a complementary log-log link as suggested there, just use family=binomial(link="cloglog")).
