documentation/data-structures.md

title: "Possible Data Structures" output: html_document: keep_md: yes toc: yes toc_depth: 5

Current Structure

| client id| referral id| referral date| removal begin date| removal end date| | -------- | ---------- | ------------ | ----------------- | --------------- | | 1| 1| 2014-01| - | - | | 1| 1| 2014-01| 2014-02| 2014-04| | 1| 2| 2015-01| 2015-02| 2015-06| | 1| 3| 2016-01| - | - | | | | | | | | 2| 4| 2014-01| - | - | | 2| 5| 2014-07| 2014-08| 2014-10| | 2| 6| 2015-01| 2015-03| - | | | | | | | | 3| 7| 2014-01| - | - | | 3| 8| 2015-01| - | - | | | | | | | | 4| 9| 2015-01| - | - | | | | | | | | 5| 10| 2014-08| 2014-11| 2014-12|

Proposed structure

(Transformed for just client 1 above)

| client id | span index | start date | start event | stop date | stop event | state | iss | |-----------|------------|------------|---------------|-----------|---------------|-------|-----| | 1 | 1 | 2014-01 | referral | 2014-02 | removal | in | n | | 1 | 2 | 2014-02 | removal | 2014-04 | reunification | out | y | | 1 | 3 | 2014-04 | reunification | 2015-01 | referral | in | n | | 1 | 4 | 2015-01 | referral | 2015-02 | removal | in | y | | 1 | 5 | 2015-02 | removal | 2015-06 | reunification | out | y | | 1 | 6 | 2015-06 | reunification | 2016-01 | referral | in | n | | 1 | 7 | 2016-01 | referral | + | censored | in | y |

References

  1. Therneau, Crowson, & Atkinson (2016). survival package vignette: "Multi-state models and competing risks" https://cran.r-project.org/web/packages/survival/vignettes/compete.pdf
  2. "Multistate Models" section of the "Survival Analysis" CRAN Task View: https://cran.r-project.org/web/views/Survival.html
  3. Putter, Fiocco, & Geskus (2007). "Tutorial in biostatistics: Competing risks and multi-state models" Statistics in Medicine. S:/BBMC/literature/dhs/survival/putter-fiocco-geskus-2007-competing-risks-and-multistate-models.pdf
  4. Yung, & Liu (2007). "A joint frailty model for survival and gap times between recurrent events." Biometrics. https://www.ncbi.nlm.nih.gov/pubmed/17688491
  5. Zhao, Zhou (2012). "Modeling gap times between recurrent events by marginal rate function." Computation Statistics & Data Analysis. http://www.sciencedirect.com/science/article/pii/S0167947311002829


OuhscBbmc/referral-exposure documentation built on May 7, 2019, 9:42 p.m.