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

add function to transform sample output_type data to quantile #8

Open
nickreich opened this issue Jun 6, 2023 · 4 comments
Open

add function to transform sample output_type data to quantile #8

nickreich opened this issue Jun 6, 2023 · 4 comments

Comments

@nickreich
Copy link
Contributor

A common task to support plotting of sample output_type data could be to transform that data to quantile-format and then plot, so that medians/intervals could be plotted. This is a simple transformation task, given a hub_df with sample data, turn it into quantiles.

@nickreich
Copy link
Contributor Author

Noting that some care might need to be taken (and/or assumptions made) to impute quantiles that are not directly translatable from samples. e.g. what if you request a 2.5th and 97.5th quantile but only have 100 samples. Take the midpoint between the 97th and 98th ordered samples?

@elray1
Copy link
Contributor

elray1 commented Jun 7, 2023

r.e. assumptions required to get quantiles, I suggest using R's built-in stats::quantile function, which has several options for how to handle this, specified by the type argument. The function we write in this package could also have a type argument which would then be passed to stats::quantile.

@elray1
Copy link
Contributor

elray1 commented Jul 19, 2023

see also issue #11

@annakrystalli annakrystalli transferred this issue from hubverse-org/hubUtils Feb 29, 2024
@nickreich nickreich added this to the sample output_type v1.0 milestone Apr 4, 2024
@nickreich nickreich changed the title add sample_to_quantile_hub_df function add sample_to_quantile_model_out_tbl function Apr 4, 2024
@nickreich nickreich changed the title add sample_to_quantile_model_out_tbl function add function to transform sample output_type data to quantile Apr 4, 2024
@elray1
Copy link
Contributor

elray1 commented Apr 29, 2024

I am proposing that this be an internal (i.e., not exported) function, with the user-facing function being a general-purpose function for converting between output types as in #11.

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

No branches or pull requests

2 participants