Skip to content

Releases: tidymodels/infer

infer 1.1.0

18 Dec 14:12
8c51276

Choose a tag to compare

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

27 Jun 12:53
4219435

Choose a tag to compare

  • Replaced usage of deprecated functions ahead of a new release of the ggplot2 package (#557).

  • Addressed narrative mistakes in the t_test vignette (#556).

  • Increased the minimum required R version to R 4.1

infer 1.0.8

14 Apr 17:15
c9d3f4b

Choose a tag to compare

  • 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

26 Mar 12:07
63aaaa0

Choose a tag to compare

  • The aliases p_value() and conf_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() and shade_confidence_interval() where fill = NULL was ignored when it was documented as preventing any shading (#525).

infer 1.0.6

31 Jan 15:51
fdbcece

Choose a tag to compare

  • 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

06 Sep 12:48
5ad0087

Choose a tag to compare

  • Implemented support for permutation hypothesis tests for paired data via the argument value null = "paired independence" in hypothesize() (#487). The new vignette Tidy inference for paired data outlines these changes with an applied example.

  • The weight_by argument to rep_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() and prop_test() (#472).

  • Fixed bug in two-sample prop_test() where the response and explanatory variable were passed in place of each other to prop.test(). This enables using prop_test() with explanatory variables with greater than 2 levels and, in the process, addresses a bug where prop_test() collapsed levels other than the success when the response variable had more than 2 levels.

infer 1.0.4

02 Dec 00:12
1da7f38

Choose a tag to compare

  • 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

22 Aug 19:01
3839dcb

Choose a tag to compare

  • Fix R-devel HTML5 NOTEs.

infer 1.0.2

12 Jun 20:07
06e2977

Choose a tag to compare

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 named x (#431).
  • Fix error from visualize when passed generate()d infer_dist objects that had not been passed to hypothesize() (#432).
  • Update visual checks for visualize output 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() unexpected type warnings to be more permissive—the warning will be raised less often when type = "bootstrap" (#425).
  • Allow passing additional arguments to stats::chisq.test via ... in calculate(). 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 success by default) is TRUE. Core verbs have warned without an explicit success value 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

13 Sep 23:38

Choose a tag to compare

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.

  • Re-licensed the package from CC0 to MIT (#413). See the LICENSE and LICENSE.md files.
  • Various improvements to documentation (#417, #418).
  • Contributed a paper to the Journal of Open Source Software, a draft of which is available in /figs/paper (#401).