@@ -514,30 +514,30 @@ sample_estimates_500 <- rep_sample_n(airbnb, size = 500, reps = 20000) |>
514
514
## Sampling distribution n = 20
515
515
sampling_distribution_20 <- ggplot(sample_estimates_20, aes(x = sample_mean)) +
516
516
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
517
- labs(x = "Sample mean price per night\n (dollars)", y = "Count") +
517
+ labs(x = "Sample mean price per night (dollars)", y = "Count") +
518
518
ggtitle("n = 20")
519
519
520
520
## Sampling distribution n = 50
521
521
sampling_distribution_50 <- ggplot(sample_estimates_50, aes(x = sample_mean)) +
522
522
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
523
523
ylab("Count") +
524
- xlab("Sample mean price per night\n (dollars)") +
524
+ xlab("Sample mean price per night (dollars)") +
525
525
ggtitle("n = 50") +
526
526
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
527
527
528
528
## Sampling distribution n = 100
529
529
sampling_distribution_100 <- ggplot(sample_estimates_100, aes(x = sample_mean)) +
530
530
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
531
531
ylab("Count") +
532
- xlab("Sample mean price per night\n (dollars)") +
532
+ xlab("Sample mean price per night (dollars)") +
533
533
ggtitle("n = 100") +
534
534
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
535
535
536
536
## Sampling distribution n = 500
537
537
sampling_distribution_500 <- ggplot(sample_estimates_500, aes(x = sample_mean)) +
538
538
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
539
539
ylab("Count") +
540
- xlab("Sample mean price per night\n (dollars)") +
540
+ xlab("Sample mean price per night (dollars)") +
541
541
ggtitle("n = 500") +
542
542
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
543
543
```
@@ -881,7 +881,7 @@ tail(boot20000_means)
881
881
882
882
boot_est_dist <- ggplot(boot20000_means, aes(x = mean)) +
883
883
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
884
- labs(x = "Sample mean price per night \n (dollars)", y = "Count") +
884
+ labs(x = "Sample mean price per night (dollars)", y = "Count") +
885
885
theme(text = element_text(size = 12))
886
886
887
887
boot_est_dist
@@ -900,7 +900,7 @@ sample_estimates <- samples |>
900
900
sampling_dist <- ggplot(sample_estimates, aes(x = sample_mean)) +
901
901
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
902
902
ylab("Count") +
903
- xlab("Sample mean price per night \n (dollars)")
903
+ xlab("Sample mean price per night (dollars)")
904
904
905
905
annotated_sampling_dist <- sampling_dist +
906
906
xlim(min_x(sampling_dist), max_x(sampling_dist)) +
0 commit comments