{"id":384816,"date":"2024-06-03T22:00:00","date_gmt":"2024-06-04T04:00:00","guid":{"rendered":"https:\/\/www.spsanderson.com\/steveondata\/posts\/2024-06-04\/"},"modified":"2024-06-03T22:00:00","modified_gmt":"2024-06-04T04:00:00","slug":"unveiling-new-tools-in-the-tidydensity-arsenal-distribution-parameter-wrangling","status":"publish","type":"post","link":"https:\/\/www.r-bloggers.com\/2024\/06\/unveiling-new-tools-in-the-tidydensity-arsenal-distribution-parameter-wrangling\/","title":{"rendered":"Unveiling New Tools in the TidyDensity Arsenal: Distribution Parameter Wrangling"},"content":{"rendered":"<!-- \r\n<div style=\"min-height: 30px;\">\r\n[social4i size=\"small\" align=\"align-left\"]\r\n<\/div>\r\n-->\r\n\r\n<div style=\"border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;\">\r\n[This article was first published on <strong><a href=\"https:\/\/www.spsanderson.com\/steveondata\/posts\/2024-06-04\/\"> Steve's Data Tips and Tricks<\/a><\/strong>, and kindly contributed to <a href=\"https:\/\/www.r-bloggers.com\/\" rel=\"nofollow\">R-bloggers<\/a>]. (You can report issue about the content on this page <a href=\"https:\/\/www.r-bloggers.com\/contact-us\/\">here<\/a>)\r\n<hr>Want to share your content on R-bloggers?<a href=\"https:\/\/www.r-bloggers.com\/add-your-blog\/\" rel=\"nofollow\"> click here<\/a> if you have a blog, or <a href=\"http:\/\/r-posts.com\/\" rel=\"nofollow\"> here<\/a> if you don't.\r\n<\/div>\n \n\n\n\n\n\n<section id=\"introduction\" class=\"level1\">\n<h1>Introduction<\/h1>\n<p>Greetings, fellow data enthusiasts! Today, we\u2019re thrilled to unveil a fresh wave of functionalities in the ever-evolving TidyDensity package. Buckle up, as we delve into the realm of distribution statistics!<\/p>\n<p>This update brings a bounty of new functions that streamline the process of extracting key parameters from various probability distributions. These functions adhere to the familiar naming convention <code>util_distribution_name_stats_tbl()<\/code>, making them easily discoverable within your R workflow.<\/p>\n<p>Let\u2019s meet the newcomers:<\/p>\n<ul>\n<li><code>util_zero_truncated_negative_binomial_stats_tbl()<\/code>: Uncovers the secrets of the zero-truncated negative binomial distribution.<\/li>\n<li><code>util_zero_truncated_poisson_stats_tbl()<\/code>: Demystifies the zero-truncated Poisson distribution.<\/li>\n<li><code>util_zero_truncated_geometric_stats_tbl()<\/code>: Unveils the hidden characteristics of the zero-truncated geometric distribution.<\/li>\n<li><code>util_pareto1_stats_tbl()<\/code>: Extracts the essence of the Pareto Type I distribution.<\/li>\n<li><code>util_paralogistic_stats_tbl()<\/code>: Unlocks the mysteries of the paralogistic distribution.<\/li>\n<li><code>util_inverse_weibull_stats_tbl()<\/code>: Illuminates the parameters of the inverse Weibull distribution.<\/li>\n<li><code>util_inverse_pareto_stats_tbl()<\/code>: Provides insights into the inverse Pareto distribution.<\/li>\n<li><code>util_inverse_burr_stats_tbl()<\/code>: Offers a glimpse into the world of the inverse Burr distribution.<\/li>\n<li><code>util_generalized_pareto_stats_tbl()<\/code>: Simplifies extracting parameters from the generalized Pareto distribution.<\/li>\n<\/ul>\n<p>Now, you might be wondering, \u201cHow do I put these new functions to use?\u201d Fear not, for the answer is as easy as pie!<\/p>\n<\/section>\n<section id=\"examples\" class=\"level1\">\n<h1>Examples<\/h1>\n<p>Let\u2019s explore the zero-truncated binomial distribution. Suppose we\u2019re simulating the number of successes in 10 trials with a success probability of 0.1 (but hey, successes of zero aren\u2019t possible in this scenario!).<\/p>\n<div class=\"cell\">\n<pre>library(dplyr)\nlibrary(TidyDensity) # Assuming you've installed TidyDensity\n\nset.seed(123)\ntidy_zero_truncated_binomial(.size = 10, .prob = 0.1) |>\n util_zero_truncated_binomial_stats_tbl() |>\n glimpse()<\/pre>\n<div class=\"cell-output cell-output-stdout\">\n<pre>Rows: 1\nColumns: 15\n$ tidy_function <chr> "tidy_zero_truncated_binomial"\n$ function_call <chr> "Zero Truncated Binomial c(10, 0.1)"\n$ distribution <chr> "Zero Truncated Binomial"\n$ distribution_type <chr> "discrete"\n$ points <dbl> 50\n$ simulations <dbl> 1\n$ mean <dbl> 1.58\n$ mode <dbl> 1\n$ range <chr> "1 to 4"\n$ std_dv <dbl> 0.8103917\n$ coeff_var <dbl> 0.5129061\n$ computed_std_skew <dbl> 1.133051\n$ computed_std_kurt <dbl> 3.212143\n$ ci_lo <dbl> 1\n$ ci_hi <dbl> 3<\/pre>\n<\/div>\n<\/div>\n<p>This code snippet generates a dataset of zero-truncated binomial values and then utilizes the <code>util_zero_truncated_binomial_stats_tbl()<\/code> function to extract a summary table containing key parameters like the mean, variance, and quantiles.<\/p>\n<\/section>\n<section id=\"your-turn-to-explore\" class=\"level1\">\n<h1>Your Turn to Explore!<\/h1>\n<p>We encourage you to jump in and experiment with these new additions. Explore the documentation for each function (accessible through <code>?util_distribution_name_stats_tbl<\/code>) to discover their specific functionalities and supported distributions.<\/p>\n<p>With these new tools at your disposal, you\u2019ll be well-equipped to gain deeper insights into your data and unlock the power of various probability distributions in your R adventures!<\/p>\n\n\n<\/section>\n\n \n<div style=\"border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;\">\r\n<div style=\"text-align: center;\">To <strong>leave a comment<\/strong> for the author, please follow the link and comment on their blog: <strong><a href=\"https:\/\/www.spsanderson.com\/steveondata\/posts\/2024-06-04\/\"> Steve's Data Tips and Tricks<\/a><\/strong>.<\/div>\r\n<hr \/>\r\n<a href=\"https:\/\/www.r-bloggers.com\/\" rel=\"nofollow\">R-bloggers.com<\/a> offers <strong><a href=\"https:\/\/feedburner.google.com\/fb\/a\/mailverify?uri=RBloggers\" rel=\"nofollow\">daily e-mail updates<\/a><\/strong> about <a title=\"The R Project for Statistical Computing\" href=\"https:\/\/www.r-project.org\/\" rel=\"nofollow\">R<\/a> news and tutorials about <a title=\"R tutorials\" href=\"https:\/\/www.r-bloggers.com\/how-to-learn-r-2\/\" rel=\"nofollow\">learning R<\/a> and many other topics. <a title=\"Data science jobs\" href=\"https:\/\/www.r-users.com\/\" rel=\"nofollow\">Click here if you're looking to post or find an R\/data-science job<\/a>.\r\n\r\n<hr>Want to share your content on R-bloggers?<a href=\"https:\/\/www.r-bloggers.com\/add-your-blog\/\" rel=\"nofollow\"> click here<\/a> if you have a blog, or <a href=\"http:\/\/r-posts.com\/\" rel=\"nofollow\"> here<\/a> if you don't.\r\n<\/div>","protected":false},"excerpt":{"rendered":"\n<p>Introduction<br \/>\nGreetings, fellow data enthusiasts! Today, we\u2019re thrilled to unveil a fresh wave of functionalities in the ever-evolving TidyDensity package. Buckle up, as we delve into the realm of distribution statistics!<br \/>\nThis update brings a bo…<\/p>\n","protected":false},"author":2847,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"aioseo_notices":[],"jetpack-related-posts":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/posts\/384816"}],"collection":[{"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/users\/2847"}],"replies":[{"embeddable":true,"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/comments?post=384816"}],"version-history":[{"count":1,"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/posts\/384816\/revisions"}],"predecessor-version":[{"id":384817,"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/posts\/384816\/revisions\/384817"}],"wp:attachment":[{"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/media?parent=384816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/categories?post=384816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.r-bloggers.com\/wp-json\/wp\/v2\/tags?post=384816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}