mclements / rstpm2

An R package for generalised survival models
28 stars 11 forks source link

Matching case-control data #29

Closed LivUllmann closed 1 year ago

LivUllmann commented 1 year ago

Hello!

I wanted to ask if it is possible to account for matched case-control data, using rstpm2?

In particular, I want to include matched pair id in my regression, for example, stmp2(Surv(time, event) ~ exposure, strata(set_id), data=dt)

In my data, controls were matched by age and gender. Thank you for your help!

mclements commented 1 year ago

Liv,

I am a little confused by your question. If you meant a matched case-control study with incidence density sampling, then I would have used conditional or ordinary logistic regression for the analysis. Alternatively, you could have follow-up for the cases and controls, a matched cohort study or a case-cohort study.

Out of interest, which of these designs did you mean?

Sincerely, Mark.

LivUllmann commented 1 year ago

I wanted to clarify that I am conducting a cohort study. Exposed participants are individuals with a diagnosis of autoimmune disease at the start of follow-up and unexposed participants are their matched controls. We follow our study participants up until they develop an outcome (heart disease), die, migrate, or reach the end of the study. I wanted to know, if instead of including age and gender as covariates, I could include the matching variable in the model (coxph.strata).

Many thanks for your help!

mclements commented 1 year ago

The obvious approach is to use a stratified Cox model.

There is some literature for parametric survival models that integrate out the "nuisance" strata variables (see https://link.springer.com/article/10.1007/s10985-015-9337-9). Note that this "integrated likelihood" approach has not been implemented for rstpm2.

The standard approaches seem to be (a) adjustment using main effects or (b) using random effects. Both of these approaches are implemented in rstpm2.

Is this at all helpful?

Sincerely, Mark.

LivUllmann commented 1 year ago

Thank you for providing a detailed explanation. If I understood correctly random effects such as matching can be included in the model , using cluster (). Does coxph.strata has a different purpose than strata() in coxph model?

Kind regards,

Liv

mclements commented 1 year ago

For stratum $i$ with member $j$ and covariates $x{ij}$, a stratified Cox will give you $$h(t|x{ij}) = hi(t) \exp(\beta^T x{ij})$$ Remarkably, this allows the baseline hazard to vary for each stratum. In contrast, a random effects or frailty model will be $$h(t|x_{ij}) = u_i h0(t) \exp(\beta^T x{ij})$$ for a frailty $u_i$ - but this assumes the same baseline hazard. I suggest that a stratified Cox is your first choice - unless you want to estimate other parameters than a time-constant hazard ratio.

LivUllmann commented 1 year ago

Many thanks for detailed explanation! I really appreciate your help!