From fe3d3fcf2e8a5c4207350ce5c723195cfc6a3eca Mon Sep 17 00:00:00 2001 From: wmorgan485 <59260332+wmorgan485@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:22:53 -0400 Subject: [PATCH] correct description of CIs for MLR Confidence intervals for coefficients with multiple explanatory variables workflow did not include the point estimates. Removed the hypothesize() command and set generate() to type = "bootstrap" fix the problem. Also removed alternative method for generating null_dist2. --- vignettes/observed_stat_examples.Rmd | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/vignettes/observed_stat_examples.Rmd b/vignettes/observed_stat_examples.Rmd index 7fbd24db..bff1d82d 100644 --- a/vignettes/observed_stat_examples.Rmd +++ b/vignettes/observed_stat_examples.Rmd @@ -1692,41 +1692,30 @@ obs_fit <- gss %>% fit() ``` -Generating a distribution of fits with the response variable permuted, - -```{r} -null_dist <- gss %>% - specify(hours ~ age + college) %>% - hypothesize(null = "independence") %>% - generate(reps = 1000, type = "permute") %>% - fit() -``` - -Alternatively, generating a distribution of fits where each explanatory variable is permuted independently, +Then, generating a bootstrap distribution, ```{r} -null_dist2 <- gss %>% +boot_dist <- gss %>% specify(hours ~ age + college) %>% - hypothesize(null = "independence") %>% - generate(reps = 1000, type = "permute", variables = c(age, college)) %>% + generate(reps = 1000, type = "bootstrap") %>% fit() ``` -Calculating confidence intervals from the null fits, +Use the bootstrap distribution to find a confidence interval, ```{r} conf_ints <- get_confidence_interval( - null_dist, + boot_dist, level = .95, point_estimate = obs_fit ) ``` -Visualizing the observed fit alongside the null fits, +Visualizing the observed statistic alongside the distribution, ```{r} -visualize(null_dist) + +visualize(boot_dist) + shade_confidence_interval(endpoints = conf_ints) ```