knitr::opts_chunk$set(echo = TRUE,
                      fig.path = "man/figures/README-")

spduration

R-CMD-check CRAN version Codecov test coverage

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

install.packages("spduration")
library(devtools)
install_github("andybega/spduration")

Contact



andybega/spduration documentation built on Feb. 9, 2024, 8:23 p.m.