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

weights option for TableSubgroupMultiCox #32

Closed
youmingmeia opened this issue Jun 20, 2024 · 2 comments
Closed

weights option for TableSubgroupMultiCox #32

youmingmeia opened this issue Jun 20, 2024 · 2 comments

Comments

@youmingmeia
Copy link

Hi prof. Jinseob Kim, thanks for your excellent work. The TableSubgroupMultiCox function in the jstable package has been extremely useful for my analyses, and I greatly appreciate the work you have put into developing it.
I am wondering if there are any plans to include a weight option within the TableSubgroupMultiCox function. This option would be very beneficial for analyses involving IPTW are necessary.

@jinseob2kim
Copy link
Owner

Currently, No coxph weight option in TableSubgroupMultiCox, But you can use weight with svydesign data. The below is example code (survey design)

library(survival)
library(dplyr)
lung %>%
  mutate(
    status = as.integer(status == 1),
    sex = factor(sex),
    kk = factor(as.integer(pat.karno >= 70)),
    kk1 = factor(as.integer(pat.karno >= 60))
  ) -> lung
TableSubgroupMultiCox(Surv(time, status) ~ sex,
  var_subgroups = c("kk", "kk1"),
  data = lung, time_eventrate = 100, line = TRUE
)

## survey design
library(survey)
data.design <- svydesign(id = ~1, data = lung)
TableSubgroupMultiCox(Surv(time, status) ~ sex,
  var_subgroups = c("kk", "kk1"),
  data = data.design, time_eventrate = 100
)

@jinseob2kim
Copy link
Owner

I add weights option, please install the latest version via remotes::install_github("jinseob2kim/jstable")

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

No branches or pull requests

2 participants