Releases: tidymodels/infer
infer 1.1.0
Arbitrary test statistics in calculate
In a change originally motivated by Allen Downey's posit::conf(2024) keynote notes, the package introduced support for arbitrary test statistics in calculate(). In addition to the pre-implemented calculate(stat) options, taken as strings, users can now supply any function defining a scalar-valued test statistic.
The function should have arguments stat(x, order, ...), where x is one replicate's worth of x. The order argument and ellipses will be supplied directly to the stat function. Internally, calculate() will split x up into data frames by replicate and pass them one-by-one to the supplied stat.
For example, to implement stat = "mean" as a function, one could write:
stat_mean <- function(x, order, ...) {mean(x$hours)}
obs_mean <-
gss %>%
specify(response = hours) %>%
calculate(stat = stat_mean)
set.seed(1)
null_dist_mean <-
gss %>%
specify(response = hours) %>%
hypothesize(null = "point", mu = 40) %>%
generate(reps = 5, type = "bootstrap") %>%
calculate(stat = stat_mean)Note that the same stat_mean function is supplied to both generate()d and non-generate()d infer objects--no need to implement support for grouping by replicate yourself.
See?calculate() to learn more (#542).
Bug fixes
Also, fixed a bug where adding shade_confidence_interval(NULL) or shade_p_value(NULL) to plots resulted in list() rather than the unmodified plot (#566).
infer 1.0.9
infer 1.0.8
-
The infer print method now truncates output when descriptions of explanatory or responses variables exceed the console width (#543).
-
Added missing commas and addressed formatting issues throughout the vignettes and articles. Backticks for package names were removed and missing parentheses for functions were added (@Joscelinrocha).
infer 1.0.7
-
The aliases
p_value()andconf_int(), first deprecated 6 years ago, now
return an error (#530). -
Addresses ggplot2 warnings when shading p-values for test statistics
that are outside of the range of the generated distribution (#528). -
Fixed bug in
shade_p_value()andshade_confidence_interval()wherefill = NULLwas ignored when it was documented as preventing any shading (#525).
infer 1.0.6
-
Updated infrastructure for errors, warnings, and messages (#513). Some of these changes will not be visible to users, though:
- Many longer error messages are now broken up into several lines.
- For references to help-files, users can now click on the error message's text to navigate to the cited documentation.
-
Various improvements to documentation (#501, #504, #508, #512).
-
Fixed bug where get_confidence_interval() would error uninformatively when the supplied distribution of estimates contained missing values. The function will now warn and return a confidence interval calculated using the non-missing estimates (#521).
-
Fixed bug where generate() could not be used without first specify()ing variables, even in cases where that specification would not affect resampling/simulation (#448).
infer 1.0.5
-
Implemented support for permutation hypothesis tests for paired data via the argument value
null = "paired independence"inhypothesize()(#487). The new vignette Tidy inference for paired data outlines these changes with an applied example. -
The
weight_byargument torep_slice_sample()can now be passed either as a vector of numeric weights or an unquoted column name in.data(#480). -
Newly accommodates variables with spaces in names in the wrapper functions
t_test()andprop_test()(#472). -
Fixed bug in two-sample
prop_test()where the response and explanatory variable were passed in place of each other toprop.test(). This enables usingprop_test()with explanatory variables with greater than 2 levels and, in the process, addresses a bug whereprop_test()collapsed levels other than thesuccesswhen the response variable had more than 2 levels.
infer 1.0.4
- Fixed bug in p-value shading where shaded regions no longer correctly overlaid histogram bars.
- Addressed deprecation warning ahead of upcoming dplyr release.
infer 1.0.3
- Fix R-devel HTML5 NOTEs.
infer 1.0.2
infer v1.0.2 is a minor release containing several bug fixes and miscellaneous improvements.
- Fix p-value shading when the calculated statistic falls exactly on the boundaries of a histogram bin (#424).
- Fix
generate()errors when columns are namedx(#431). - Fix error from
visualizewhen passedgenerate()dinfer_distobjects that had not been passed tohypothesize()(#432). - Update visual checks for
visualizeoutput to align with the R 4.1.0+ graphics engine (#438). specify()and wrapper functions now appropriately handle ordered factors (#439).- Clarify error when incompatible statistics and hypotheses are supplied (#441).
- Updated
generate()unexpectedtypewarnings to be more permissive—the warning will be raised less often whentype = "bootstrap"(#425). - Allow passing additional arguments to
stats::chisq.testvia...incalculate(). Ellipses are now always passed to the applicable base R hypothesis testing function, when applicable (#414)! - The package will now set the levels of logical variables on conversion to factor so that the first level (regarded as
successby default) isTRUE. Core verbs have warned without an explicitsuccessvalue already, and this change makes behavior consistent with the functions being wrapped by shorthand test wrappers (#440). - Added new statistic
stat = "ratio of means"(#452). - Simon Couch is now the CRAN-corresponding maintainer.
This release also ships changes from v1.0.1, a GitHub-only release, off to CRAN for the first time. Notably, the package is now released with an MIT license.
JOSS paper
This is a GitHub-only release—changes in this release will be reflected on CRAN in the next release. This release reflects the infer version accepted to the Journal of Open Source Software.