{"id":24111880,"url":"https://github.com/andybega/spduration","last_synced_at":"2025-09-18T00:32:31.137Z","repository":{"id":5298369,"uuid":"6479313","full_name":"andybega/spduration","owner":"andybega","description":"Split-population duration model in R","archived":false,"fork":false,"pushed_at":"2024-02-08T10:20:35.000Z","size":22633,"stargazers_count":4,"open_issues_count":15,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-02-09T09:47:57.414Z","etag":null,"topics":["mixture-model","r","regression","split-population","survival-analysis"],"latest_commit_sha":null,"homepage":"https://andybeger.com/spduration/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andybega.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2012-10-31T19:15:33.000Z","updated_at":"2024-02-09T09:47:57.415Z","dependencies_parsed_at":"2024-02-08T09:49:27.891Z","dependency_job_id":null,"html_url":"https://github.com/andybega/spduration","commit_stats":{"total_commits":199,"total_committers":5,"mean_commits":39.8,"dds":"0.24120603015075381","last_synced_commit":"3ded52c2a6c07e59e2280fd45032c06277edd66e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fspduration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fspduration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fspduration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andybega%2Fspduration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andybega","download_url":"https://codeload.github.com/andybega/spduration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233433065,"owners_count":18675527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mixture-model","r","regression","split-population","survival-analysis"],"created_at":"2025-01-11T02:52:13.729Z","updated_at":"2025-09-18T00:32:31.114Z","avatar_url":"https://github.com/andybega.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE,\n                      fig.path = \"man/figures/README-\")\n```\n\n# spduration \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"120\" /\u003e\n\n[![R-CMD-check](https://github.com/andybega/spduration/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/andybega/spduration/actions/workflows/R-CMD-check.yaml)\n[![CRAN version](http://www.r-pkg.org/badges/version/spduration)](https://cran.r-project.org/package=spduration)\n[![Codecov test coverage](https://codecov.io/gh/andybega/spduration/branch/master/graph/badge.svg)](https://app.codecov.io/gh/andybega/spduration?branch=master)\n\nspduration 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. \n\n```{r}\nlibrary(\"spduration\")\n\n# Prepare data\ndata(coups)\ndur.coups \u003c- add_duration(coups, \"succ.coup\", unitID=\"gwcode\", tID=\"year\",\n                          freq=\"year\")\n\n# Estimate model\nmodel.coups \u003c- spdur(duration ~ polity2, atrisk ~ polity2, data = dur.coups,\n                     silent = TRUE)\nsummary(model.coups)\n```\n\n```{r, fig.width=6, fig.height = 5, fig.align='center'}\n#| fig.alt: \u003e\n#|   Plot of the conditional hazard rate over time for coups. It shows a relatively\n#|   constant hazard of around 0.013, going almost 40 years on the x-axis. The plot\n#|   includes confidence bands, which range from around 0.005 to 0.020, with slightly\n#|   less uncertainty around 2-3 years out.\nplot(model.coups, type = \"hazard\")\n```\n\n\n## Install\n\n* the latest released version from CRAN: \n```{r, eval = FALSE}\ninstall.packages(\"spduration\")\n```\n\n* the latest development version: \n```{r, eval = FALSE}\nlibrary(devtools)\ninstall_github(\"andybega/spduration\")\n```\n\n## Contact\n\n- submit suggestions, bugs, issues, questions at: [https://github.com/andybega/spduration/issues](https://github.com/andybega/spduration/issues)\n- email: [adbeger+spduration@gmail.com](mailto:adbeger+spduration@gmail.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybega%2Fspduration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandybega%2Fspduration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandybega%2Fspduration/lists"}