You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the infer package, when trying to calculate the null distribution of the standard deviation, the wrong values are produced. The problem is that the bootstrap() function that is called by generate() does not impose the null hypothesis condition when the hypothesis is about the standard deviation (like it does for the mean and median).
Reproducible example
In this example, the histogram should be centred at 5 - the null hypothesized value for sigma. Instead, it's centred around the empirical sd of the raw x variable used as input. For a slightly longer discussion, see this question that I answered on SO.
library(tidyverse)
library(infer)
set.seed(207)
dat<- tibble(x= rnorm(100, mean=2, sd=2))
sd(data$x)
#> Error in data$x: object of type 'closure' is not subsettabledat %>%
specify(response=x) %>%
hypothesise(null="point", sigma=5) %>%
generate(reps=1000, type="bootstrap") %>%
calculate("sd") %>%
visualize()
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
The problem
Using the
infer
package, when trying to calculate the null distribution of the standard deviation, the wrong values are produced. The problem is that thebootstrap()
function that is called bygenerate()
does not impose the null hypothesis condition when the hypothesis is about the standard deviation (like it does for the mean and median).Reproducible example
In this example, the histogram should be centred at 5 - the null hypothesized value for sigma. Instead, it's centred around the empirical sd of the raw x variable used as input. For a slightly longer discussion, see this question that I answered on SO.
Created on 2024-01-26 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: