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
geom_histogram(fill = "dodgerblue3", color = "lightgrey", bins = 12) +
293
293
ylab("Count") +
@@ -335,7 +335,7 @@ We can visualize the population distribution of the price per night with a histo
335
335
options(pillar.sigfig = 5)
336
336
```
337
337
338
-
```{r 11-example-means2, echo = TRUE, message = FALSE, warning = FALSE, fig.cap = "Population distribution of price per night (Canadian dollars) for all Airbnb listings in Vancouver, Canada.", fig.retina = 2, out.width = "100%"}
338
+
```{r 11-example-means2, echo = TRUE, message = FALSE, warning = FALSE, fig.cap = "Population distribution of price per night (Canadian dollars) for all Airbnb listings in Vancouver, Canada.", fig.height = 3.5, fig.width = 4.5}
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
386
386
ylab("Count") +
@@ -422,7 +422,7 @@ samples
422
422
Now we can calculate the sample mean for each replicate and plot the sampling
423
423
distribution of sample means for samples of size 40.
424
424
425
-
```{r 11-example-means4, echo = TRUE, message = FALSE, warning = FALSE, fig.cap= "Sampling distribution of the sample means for sample size of 40.", fig.retina = 2, out.width = "100%"}
425
+
```{r 11-example-means4, echo = TRUE, message = FALSE, warning = FALSE, fig.cap= "Sampling distribution of the sample means for sample size of 40.", fig.height = 3.5, fig.width = 4.5}
426
426
sample_estimates <- samples |>
427
427
group_by(replicate) |>
428
428
summarize(sample_mean = mean(price))
@@ -468,15 +468,15 @@ Notice that the mean of the sample means is \$`r round(mean(sample_estimates$sam
468
468
was \$`r round(mean(airbnb$price),2)`.
469
469
-->
470
470
471
-
```{r 11-example-means5, echo = FALSE, message = FALSE, warning = FALSE, fig.cap = "Comparison of population distribution, sample distribution, and sampling distribution."}
471
+
```{r 11-example-means5, echo = FALSE, message = FALSE, warning = FALSE, fig.height = 5.5, fig.width = 4, fig.cap = "Comparison of population distribution, sample distribution, and sampling distribution."}
472
472
grid.arrange(population_distribution +
473
473
ggtitle("Population") +
474
474
xlim(min(airbnb$price), 600),
475
475
sample_distribution +
476
476
ggtitle("Sample (n = 40)") +
477
477
xlim(min(airbnb$price), 600),
478
478
sampling_distribution_40 +
479
-
ggtitle("Sampling distribution of the mean for samples of size 40") +
479
+
ggtitle("Sampling distribution of the mean \n for samples of size 40") +
480
480
xlim(min(airbnb$price), 600),
481
481
nrow = 3
482
482
)
@@ -664,7 +664,7 @@ see that the sample’s distribution looks like that of the population for a
664
664
large enough sample.
665
665
666
666
667
-
```{r 11-example-bootstrapping0, echo = FALSE, message = FALSE, warning = FALSE, fig.cap = "Comparison of samples of different sizes from the population."}
667
+
```{r 11-example-bootstrapping0, echo = FALSE, message = FALSE, warning = FALSE, fig.height = 7, fig.cap = "Comparison of samples of different sizes from the population."}
Let's compare the bootstrap distribution—which we construct by taking many samples from our original sample of size 40—with
885
885
the true sampling distribution—which corresponds to taking many samples from the population.
886
886
887
-
```{r 11-bootstrapping6, echo = F, message = FALSE, warning = FALSE, fig.cap = "Comparison of the distribution of the bootstrap sample means and sampling distribution.", out.height = "70%"}
887
+
```{r 11-bootstrapping6, echo = F, message = FALSE, warning = FALSE, fig.cap = "Comparison of the distribution of the bootstrap sample means and sampling distribution.", fig.height = 3.5}
0 commit comments