knitr::opts_chunk$set(echo = TRUE, fig.path = "man/figures/README-")
spduration implements a split-population duration model for duration data with time-varying covariates where a significant subset of the population or spells will not experience failure.
library("spduration") # Prepare data data(coups) dur.coups <- add_duration(coups, "succ.coup", unitID="gwcode", tID="year", freq="year") # Estimate model model.coups <- spdur(duration ~ polity2, atrisk ~ polity2, data = dur.coups, silent = TRUE) summary(model.coups)
plot(model.coups, type = "hazard")
install.packages("spduration")
library(devtools) install_github("andybega/spduration")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.