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

Do not error when bootstrapping CIs if sample is too sparse #550

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

etiennebacher
Copy link
Member

@etiennebacher etiennebacher commented Oct 7, 2024

Close #540

library(datawizard)

set.seed(123456)
describe_distribution(mtcars[mtcars$cyl=="6",], wt, centrality = "map", ci = 0.95)
#> Warning: When bootstrapping CIs, sample was too sparse to find TD. Returning NA
#>   for CIs.
#> Variable |  MAP |  IQR | 95% CI |        Range | Skewness | Kurtosis | n | n_Missing
#> ------------------------------------------------------------------------------------
#> wt       | 3.43 | 0.67 |        | [2.62, 3.46] |    -0.36 |    -2.08 | 7 |         0

Created on 2024-10-07 with reprex v2.1.1

Copy link
Member

@IndrajeetPatil IndrajeetPatil left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks!

NEWS.md Outdated Show resolved Hide resolved
@etiennebacher etiennebacher merged commit db85541 into main Oct 7, 2024
22 checks passed
@etiennebacher etiennebacher deleted the bootstrap-error branch October 7, 2024 21:12
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.

Fail more gracefully when CI computations fails for MAP estimates in describe_distribution()
2 participants