insightsengineering / tern

Table, Listings, and Graphs (TLG) library for common outputs used in clinical trials
https://insightsengineering.github.io/tern/
Other
75 stars 19 forks source link

[Question]: More information needed about how univariate summarize_coxph() inputs are passed to survival::coxph() #1267

Open chelseadickens opened 1 month ago

chelseadickens commented 1 month ago

What is your question?

  1. In trying to reproduce the estimates produced by the examples for summarize_coxph() in Cox proportional hazards regression using survival::coxph(), @adcascone and I were able to deduce that it's necessary to supply ties = "exact" as input. Is it possible to add details about this in function's documentation?
  2. Is it possible to add details about how the univariate and multivariate use cases differ in the documentation? From what we can tell, the univariate case takes any covariates and passes them to sequential models fitted with survival::coxph() (e.g., in the examples shown on the website, the first model contains only ARM as a predictor, the second model contains ARM + COVAR1 as predictors, and the third model contains ARM + COVAR2 as predictors, like below). Then the estimates for ARM only are extracted and presented in the outputs. However, for the multivariate use case, all predictors and covariates are passed to a single model. Is that correct?
    
    coxph_summary1 <- summary(survival::coxph(Surv(TIME, STATUS) ~ ARM, 
                                          data = data.frame(dta_bladder), ties = "exact"))
    coxph_summary1

coxph_summary2 <- summary(survival::coxph(Surv(TIME, STATUS) ~ ARM + COVAR1, data = data.frame(dta_bladder), ties = "exact")) coxph_summary2

coxph_summary3 <- summary(survival::coxph(Surv(TIME, STATUS) ~ ARM + COVAR2, data = data.frame(dta_bladder), ties = "exact")) coxph_summary3



3. In addition, we're a bit confused why the output from `summarize_coxph()` provides the hazard ratios and associated CIs/pvalues for the ARM term but the labels would imply the hazard ratios are from the covariates (indicated by "A Covariate Label" and "Sex (F/M)". Is this done because there is a primary interest in the hazard ratios for the ARM variable (thus only the corresponding hazard ratios are shown and no outputs for the covariates that are supplied)?

![tern_coxph](https://github.com/user-attachments/assets/080ab739-8d51-48fc-8f63-37ad3c55cc24)

Thank you!

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct.

### Contribution Guidelines

- [X] I agree to follow this project's Contribution Guidelines.

### Security Policy

- [X] I agree to follow this project's Security Policy.
shajoezhu commented 1 month ago

Dear @chelseadickens , hope you are well. Could you please repost the question to the StackOverflow, and nest-tern and nest-rtables. Thanks! We will be able to track the answers there.

chelseadickens commented 1 month ago

Hi @shajoezhu, thanks for the reply. Hope you are well also. I tried posting to StackOverflow and tagging nest-tern and nest-rtables. However, nest-tern is not a current tag and requires 1500 reputation to create a new tag. In addition, I'm not able to upload the images supplied in my GitHub issue, as that requires 10 reputation to include images, so I tried removing the image. Then went to add the nest-tern tag and was faced with not having enough reputation also. See below.

For new users, using StackOverflow for package-specific questions will likely be somewhat limiting.

image

image

shajoezhu commented 1 month ago

hi @chelseadickens , thanks for the reply, we will create the tag for "nest-tern" asap. Hi @ddsjoberg , I was wondering if you could help us to create the tag please. Thanks!

ddsjoberg commented 1 month ago

hi @chelseadickens , thanks for the reply, we will create the tag for "nest-tern" asap. Hi @ddsjoberg , I was wondering if you could help us to create the tag please. Thanks!

Can you link to the stackoverflow post and I'll add/create the tag?

chelseadickens commented 1 month ago

I haven't created the post yet since the tag was not available. I'm new to StackOverflow. Can a tag be added after the post is created?

chelseadickens commented 1 month ago

https://stackoverflow.com/questions/78754595/more-information-needed-about-how-univariate-ternsummarize-coxph-inputs-are

ddsjoberg commented 1 month ago

Thank you @chelseadickens !!

@shajoezhu we spoke about creating nest-rtables and nest-teal tags. I think we decided previously that tern questions would use the nest-rtables tag. Is that still the case?

chelseadickens commented 1 month ago

Thanks for your help @ddsjoberg and @shajoezhu !

shajoezhu commented 1 month ago

Thank you @chelseadickens !!

@shajoezhu we spoke about creating nest-rtables and nest-teal tags. I think we decided previously that tern questions would use the nest-rtables tag. Is that still the case?

hi @ddsjoberg , yes we did. But I think we might need "nest-tern" tag as well. especially this case it will be more related to tern. Thanks so much Daniel!