ps_btscs() allows you to create spells ("peace years" in
the international conflict context) between observations of some event. This
will allow the researcher to better model temporal dependence in binary time-series
cross-section ("BTSCS") models. It is an improvement on
sbtscs() (included in
this package) by its ability to more flexibly work with data that have lots of
that bracket the observed event data. It is used in the
ps_btscs(data, event, tvar, csunit, pad_ts = FALSE)
the data set with which you are working
some event (0, 1) for which you want spells or peace years
the time variable (e.g. a year)
the cross-sectional unit (likely a dyad if you're doing boilerplate international conflict stuff)
should time-series be filled when panels are unbalanced/have gaps? Defaults to FALSE.
This function is derived from
sbtscs(). See documentation there for more information.
ps_btscs() takes a data frame and returns the data frame with a new variable
David A. Armstrong, Steven V. Miller
Armstrong, Dave. 2016. “DAMisc: Dave Armstrong's Miscellaneous Functions.” R package version 1.4-3.
Miller, Steven V. 2017. “Quickly Create Peace Years for BTSCS Models with
library(dplyr) library(stevemisc) data(usa_mids) # notice: no quotes ps_btscs(usa_mids, midongoing, year, dyad)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.