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) +
295
-
ylab("Count") +
296
-
xlab("Sample proportions") +
296
+
labs(x = "Sample proportions", y = "Count") +
297
297
theme(text = element_text(size = 12))
298
298
299
299
sampling_distribution
@@ -338,11 +338,10 @@ We can visualize the population distribution of the price per night with a histo
338
338
options(pillar.sigfig = 5)
339
339
```
340
340
341
-
```{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}
341
+
```{r 11-example-means2, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", 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") +
390
-
ylab("Count") +
391
-
xlab("Price per night (Canadian dollars)") +
389
+
labs(x = "Price per night (Canadian dollars)", y = "Count") +
392
390
theme(text = element_text(size = 12))
393
391
394
392
sample_distribution
@@ -427,7 +425,7 @@ samples
427
425
Now we can calculate the sample mean for each replicate and plot the sampling
428
426
distribution of sample means for samples of size 40.
429
427
430
-
```{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}
428
+
```{r 11-example-means4, echo = TRUE, message = FALSE, fig.pos = "H", out.extra="", warning = FALSE, fig.cap= "Sampling distribution of the sample means for sample size of 40.", fig.height = 3.5, fig.width = 4.5}
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
520
-
ylab("Count") +
521
-
xlab("Sample mean price per night\n(Canadian dollars)") +
517
+
labs(x = "Sample mean price per night\n(Canadian dollars)", y = "Count") +
522
518
ggtitle("n = 20")
523
519
524
520
## Sampling distribution n = 50
@@ -623,7 +619,7 @@ mean is roughly bell-shaped. \index{sampling distribution!effect of sample size}
623
619
> In general, the sampling distribution—for both means and proportions—only
624
620
> becomes bell-shaped *once the sample size is large enough*.
625
621
> How large is "large enough?" Unfortunately, it depends entirely on the problem at hand. But
626
-
> as a rule of thumb for many problems in practice, having a sample size of at least 20 will suffice.
622
+
> as a rule of thumb, often a sample size of at least 20 will suffice.
627
623
628
624
<!--- > **Note:** If random samples of size $n$ are taken from a population, the sample mean $\bar{x}$ will be approximately Normal with mean $\mu$ and standard deviation $\frac{\sigma}{\sqrt{n}}$ as long as the sample size $n$ is large enough. $\mu$ is the population mean, $\sigma$ is the population standard deviation, $\bar{x}$ is the sample mean, and $n$ is the sample size.
629
625
> If samples are selected from a finite population as we are doing in this chapter, we should apply a finite population correction. We multiply $\frac{\sigma}{\sqrt{n}}$ by $\sqrt{\frac{N - n}{N - 1}}$ where $N$ is the population size and $n$ is the sample size. If our sample size, $n$, is small relative to the population size, this finite correction factor is less important.
@@ -671,7 +667,7 @@ see that the sample’s distribution looks like that of the population for a
671
667
large enough sample.
672
668
673
669
674
-
```{r 11-example-bootstrapping0, echo = FALSE, message = FALSE, warning = FALSE, fig.height = 7, fig.cap = "Comparison of samples of different sizes from the population."}
670
+
```{r 11-example-bootstrapping0, echo = FALSE, message = FALSE, warning = FALSE, fig.height = 6.8, fig.cap = "Comparison of samples of different sizes from the population."}
0 commit comments