Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: should ard_survival_survfit() have a conf.level argument? #216

Closed
3 tasks done
larmarange opened this issue Sep 26, 2024 · 3 comments · Fixed by #217
Closed
3 tasks done

[Feature Request]: should ard_survival_survfit() have a conf.level argument? #216

larmarange opened this issue Sep 26, 2024 · 3 comments · Fixed by #217
Assignees
Labels
enhancement New feature or request

Comments

@larmarange
Copy link

Feature description

Currently, only 95% of confidence intervals are returned. Customizing the confidence interval may be relevant.

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@larmarange larmarange added the enhancement New feature or request label Sep 26, 2024
@ddsjoberg
Copy link
Collaborator

Thanks @larmarange ! Users can control the confidence level by specifying it in the survfit(conf.int) call. BUT we should make this mode clear by adding an example with a different conf level and I also think we should return the conf.level with the results.

library(cardx)

survival::survfit(ggsurvfit::Surv_CNSR(AVAL, CNSR) ~ 1, cards::ADTTE, conf.int = 0.80) |>
  ard_survival_survfit(times = 60) 
#> {cards} data frame: 5 x 9
#>   variable variable_level  context stat_name stat_label  stat
#> 1     time             60 survival    n.risk  Number o…    93
#> 2     time             60 survival  estimate  Survival… 0.457
#> 3     time             60 survival std.error  Standard… 0.033
#> 4     time             60 survival conf.high  CI Upper… 0.502
#> 5     time             60 survival  conf.low  CI Lower… 0.416
#> ℹ 3 more variables: fmt_fn, warning, error

survival::survfit(ggsurvfit::Surv_CNSR(AVAL, CNSR) ~ 1, cards::ADTTE, conf.int = 0.90) |>
  ard_survival_survfit(times = 60) 
#> {cards} data frame: 5 x 9
#>   variable variable_level  context stat_name stat_label  stat
#> 1     time             60 survival    n.risk  Number o…    93
#> 2     time             60 survival  estimate  Survival… 0.457
#> 3     time             60 survival std.error  Standard… 0.033
#> 4     time             60 survival conf.high  CI Upper… 0.515
#> 5     time             60 survival  conf.low  CI Lower… 0.405
#> ℹ 3 more variables: fmt_fn, warning, error

Created on 2024-09-26 with reprex v2.1.1

@ddsjoberg
Copy link
Collaborator

ddsjoberg commented Sep 26, 2024

I went to add conf.level to the returned results, but I wasn't sure exactly what it should look like ... so just updated the example instead. #218

@larmarange
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants