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

Require a single formula syntax for rmst() #242

Merged
merged 3 commits into from
May 3, 2024

Conversation

jdblischak
Copy link
Collaborator

@jdblischak jdblischak commented May 2, 2024

Closes #220

Follow-up to #216

The formula argument of rmst() now requires a single syntax, Surv(tte, event) ~ group). However, to be consistent with user expectations, it is aware of the argument names of Surv(), so it is flexible enough to handle valid input such as Surv(event = event, tte) ~ group. Thanks to @nanxstats for the argument parsing code.

Below are examples of valid and invalid formulas:

# valid
Surv(tte, event) ~ group)
Surv(event = event, time = tte) ~ group)
Surv(tte, event = event) ~ group)
Surv(event = event, tte) ~ group)

# invalid
Surv(tte | event) ~ group)
~ Surv(tte, evntd, group)
tte ~ event + group
~ tte + event + group

@jdblischak jdblischak self-assigned this May 2, 2024
Copy link
Collaborator

@LittleBeannie LittleBeannie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jdblischak! I have no comments. Shall I merge it before I merge #229?

@jdblischak
Copy link
Collaborator Author

Shall I merge it before I merge #229?

Yes, you can. The two PRs are unrelated

@nanxstats
Copy link
Collaborator

You might want to merge this shortly after we release 0.4.1.

@nanxstats nanxstats merged commit 770a551 into Merck:main May 3, 2024
7 checks passed
@jdblischak jdblischak deleted the rmst-formula-strict branch May 3, 2024 20:03
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

Successfully merging this pull request may close these issues.

Formula parsing: match by argument names instead of by position
3 participants