{
  "name": "Risk sets at each event time in the worked time-varying covariate example",
  "description": "Illustrative composite of eight people with start/stop follow-up data, constructed for this page (not a real study). For each of the six event times the table gives the number at risk, the number at risk with the covariate currently 1 (treated) or 0, the covariate value of the person with the event, and the score contribution at beta = 0 (event person's covariate minus the expected value n1/n). The long-format layout follows the lifelines documentation; the partial-likelihood terms follow the extended Cox model in Zhang et al. (2018).",
  "page": "https://casrai.org/guides/time-varying-covariate",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-20T07:49:58Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Event time",
      "unit": "",
      "description": ""
    },
    {
      "name": "Event person id",
      "unit": "",
      "description": ""
    },
    {
      "name": "Number at risk",
      "unit": "",
      "description": ""
    },
    {
      "name": "At risk, z = 1",
      "unit": "",
      "description": ""
    },
    {
      "name": "At risk, z = 0",
      "unit": "",
      "description": ""
    },
    {
      "name": "Event person's z",
      "unit": "",
      "description": ""
    },
    {
      "name": "Score contribution at beta = 0",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Event time": 4,
      "Event person id": 4,
      "Number at risk": 8,
      "At risk, z = 1": 3,
      "At risk, z = 0": 5,
      "Event person's z": 0,
      "Score contribution at beta = 0": -0.375
    },
    {
      "Event time": 5,
      "Event person id": 2,
      "Number at risk": 7,
      "At risk, z = 1": 3,
      "At risk, z = 0": 4,
      "Event person's z": 0,
      "Score contribution at beta = 0": -0.4286
    },
    {
      "Event time": 7,
      "Event person id": 7,
      "Number at risk": 6,
      "At risk, z = 1": 4,
      "At risk, z = 0": 2,
      "Event person's z": 1,
      "Score contribution at beta = 0": 0.3333
    },
    {
      "Event time": 8,
      "Event person id": 1,
      "Number at risk": 5,
      "At risk, z = 1": 3,
      "At risk, z = 0": 2,
      "Event person's z": 1,
      "Score contribution at beta = 0": 0.4
    },
    {
      "Event time": 11,
      "Event person id": 8,
      "Number at risk": 2,
      "At risk, z = 1": 1,
      "At risk, z = 0": 1,
      "Event person's z": 0,
      "Score contribution at beta = 0": -0.5
    },
    {
      "Event time": 12,
      "Event person id": 5,
      "Number at risk": 1,
      "At risk, z = 1": 1,
      "At risk, z = 0": 0,
      "Event person's z": 1,
      "Score contribution at beta = 0": 0
    }
  ],
  "sources": [
    {
      "title": "Zhang Z et al. Time-varying covariates and coefficients in Cox regression models. Ann Transl Med 2018",
      "url": "https://atm.amegroups.org/article/view/18820/html",
      "accessed": "2026-11-20"
    },
    {
      "title": "lifelines: Time varying survival regression",
      "url": "https://lifelines.readthedocs.io/en/stable/Time%20varying%20survival%20regression.html",
      "accessed": "2026-11-20"
    }
  ]
}