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

Document attribute "ratio" returned by counting_process() #311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jdblischak
Copy link
Collaborator

I updated the documentation for counting_process() to match its latest behavior. The returned attribute is now ratio.

xref: #276, #281

Idea for future improvement: It would be a good idea to also document the attribute ratio in the documentation for sim_pw_surv() too. The counting_process() code describes the simple ratio of event counts as the "empirical ratio", so I assume that sim_pw_surv() must be doing something different to calculate its ratio.

# if `x` is generated by sim_pw_surv
if ("generate_by_simpwsurv" %in% names(attributes(x))) {
ratio <- attributes(x)$ratio
} else {
# if not, calcualte the emperical ratio
ratio <- sum(x$treatment == arm) / sum(x$treatment != arm)
}
attr(ans, "ratio") <- ratio

@jdblischak jdblischak requested a review from LittleBeannie March 4, 2025 21:13
@jdblischak jdblischak self-assigned this Mar 4, 2025
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.

1 participant