-
Notifications
You must be signed in to change notification settings - Fork 8
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
Enable formula to wlr()
#280
Comments
Decision: wait for Larry's weighted cox regression. |
A reference R package |
xref:
|
Medium priority |
@LittleBeannie could you please provide some examples that demonstrate the current interface of For example, how can I call wlr(
data = ex1_delayed_effect,
formula = Surv(month, evntd) ~ trt ,
weight = fh(0, 0.5)
)
|
Hi @jdblischak! The following code is equivalent to your example.
Please kindly note that, for |
To make sure I understand: the point of the argument Also, thinking from a documentation and code perspective, is this |
Yes. The user-created data sets, such as
It is crucial because while statisticians are acquainted with survival formulas, however, their familiarity with the mandatory column names (
The wlr-formula is akin to the one found in the |
Ok. That makes sense. If they are already familiar with the formula syntax from the {survival} package, then it shouldn't take them long to figure out how to use it for
I'm still a bit confused. My plan was to use the ex1_delayed_effect |>
mutate(treatment = trt, tte = month) |>
head(2)
## # A tibble: 2 × 6
## id month evntd trt treatment tte
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 0.321 1 1 1 0.321
## 2 2 0.321 1 1 1 0.321 I assume that ex1_delayed_effect |>
mutate(treatment = trt, tte = month, event = evntd) |>
head(2)
## # A tibble: 2 × 7
## id month evntd trt treatment tte event
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 0.321 1 1 1 0.321 1
## 2 2 0.321 1 1 1 0.321 1 |
If the user creates a dataset like
|
For unstratified design, i.e., For stratified design, i.e., |
There is no column named "stratum" ex1_delayed_effect |>
mutate(treatment = trt, tte = month) |>
select(treatment, stratum, tte, event)
## Error in `select()`:
## ! Can't select columns that don't exist.
## ✖ Column `stratum` doesn't exist.
## Run `rlang::last_trace()` to see where the error occurred. |
If there is no "stratum" column, this means it is an unstratified design, which is equivalent to the dataset with
|
The
rmst()
allows formula interface, i.e.,Shall we enable formula interface to
wlr()
?If there are strata, what is the best way to save it in the formula?
Keaven's suggestion:
The text was updated successfully, but these errors were encountered: