suchestoncampbelllab / gwasurvivr

GWAS Survival Package in R
11 stars 12 forks source link

Including 'cluster' in the coxph call #31

Open lucavd opened 1 year ago

lucavd commented 1 year ago

Hi, I'm using your package for a GWAS on patients collected in different centers.

Since the workforce behind the computation is the survival package, I was wandering if it is possible (and maybe how) to include the term "cluster" in the coxph call.

I've seen the you used the coxph.fit function to fit the models, but I can not see how to incorporate the cluster parameter in the function. Usually, I would have called coxph(Surv(time, event) ~ covariates + cluster(center), but I'm not sure on how to modify your code to make this happen.

I'll appreciate your help and congratulations for the wonderful package

aarizvi commented 8 months ago

We can add this to our list of future features. If you wanted to try yourself and add a PR you could take a look at coxParam.R function and extend that to work with cluster .

I'm also wondering why you can't just include your centers as a covariate in the model?

Thanks @lucavd