@@ -491,7 +491,7 @@ reliable—is there any way to improve the estimate? One way to improve a
491
491
point estimate is to take a * larger* sample. To illustrate what effect this
492
492
has, we will take many samples of size 20, 50, 100, and 500, and plot the
493
493
sampling distribution of the sample mean. We indicate the mean of the sampling
494
- distribution with a red vertical line.
494
+ distribution with a vertical dashed line.
495
495
496
496
``` {r 11-example-means6, echo = FALSE, message = FALSE, warning = FALSE}
497
497
## Sampling n = 20, 50, 100, 500
@@ -542,9 +542,9 @@ sampling_distribution_500 <- ggplot(sample_estimates_500, aes(x = mean_price)) +
542
542
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
543
543
```
544
544
545
- ``` {r 11-example-means7, echo = FALSE, message = FALSE, warning = FALSE, fig.cap = "Comparison of sampling distributions, with mean highlighted as a vertical red line."}
545
+ ``` {r 11-example-means7, echo = FALSE, message = FALSE, warning = FALSE, fig.cap = "Comparison of sampling distributions, with mean highlighted as a vertical dashed line."}
546
546
annotated_sampling_dist_20 <- sampling_distribution_20 +
547
- geom_vline(xintercept = mean(sample_estimates$mean_price), col = "red ") +
547
+ geom_vline(xintercept = mean(sample_estimates$mean_price), linetype = "dashed", linewidth = 1, color = "darkorange ") +
548
548
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20)) +
549
549
ggtitle("n = 20") +
550
550
annotate("text",
@@ -559,7 +559,7 @@ annotated_sampling_dist_20 <- sampling_distribution_20 +
559
559
# label = paste("sd = ", round(sd(sample_estimates$mean_price), 1)))
560
560
561
561
annotated_sampling_dist_50 <- sampling_distribution_50 +
562
- geom_vline(xintercept = mean(sample_estimates_50$mean_price), col = "red ") +
562
+ geom_vline(xintercept = mean(sample_estimates_50$mean_price), linetype = "dashed", linewidth = 1, color = "darkorange ") +
563
563
## x limits set the same as n = 20 graph, y is this graph
564
564
annotate("text",
565
565
x = max_x(sampling_distribution_20),
@@ -572,7 +572,7 @@ annotated_sampling_dist_50 <- sampling_distribution_50 +
572
572
# label = paste("sd = ", round(sd(sample_estimates_50$mean_price), 1)))
573
573
574
574
annotated_sampling_dist_100 <- sampling_distribution_100 +
575
- geom_vline(xintercept = mean(sample_estimates_100$mean_price), col = "red ") +
575
+ geom_vline(xintercept = mean(sample_estimates_100$mean_price), linetype = "dashed", linewidth = 1, color = "darkorange ") +
576
576
annotate("text",
577
577
x = max_x(sampling_distribution_20),
578
578
y = max_count(sampling_distribution_100),
@@ -584,7 +584,7 @@ annotated_sampling_dist_100 <- sampling_distribution_100 +
584
584
# label = paste("sd = ", round(sd(sample_estimates_100$mean_price), 1)))
585
585
586
586
annotated_sampling_dist_500 <- sampling_distribution_500 +
587
- geom_vline(xintercept = mean(sample_estimates_500$mean_price), col = "red ") +
587
+ geom_vline(xintercept = mean(sample_estimates_500$mean_price), linetype = "dashed", linewidth = 1, color = "darkorange ") +
588
588
annotate("text",
589
589
x = max_x(sampling_distribution_20),
590
590
y = max_count(sampling_distribution_500),
@@ -904,7 +904,7 @@ sampling_dist <- ggplot(sample_estimates, aes(x = mean_price)) +
904
904
905
905
annotated_sampling_dist <- sampling_dist +
906
906
xlim(min_x(sampling_dist), max_x(sampling_dist)) +
907
- geom_vline(xintercept = mean(sample_estimates$mean_price), col = "red ") +
907
+ geom_vline(xintercept = mean(sample_estimates$mean_price), linetype = "dashed", linewidth = 1, color = "darkorange ") +
908
908
annotate("text",
909
909
x = max_x(sampling_dist), y = max_count(sampling_dist),
910
910
hjust = 1,
@@ -915,7 +915,7 @@ boot_est_dist_limits <- boot_est_dist +
915
915
xlim(min_x(sampling_dist), max_x(sampling_dist))
916
916
917
917
annotated_boot_est_dist <- boot_est_dist_limits +
918
- geom_vline(xintercept = mean(boot20000_means$mean_price), col = "red ") +
918
+ geom_vline(xintercept = mean(boot20000_means$mean_price), linetype = "dashed", linewidth = 1, color = "darkorange ") +
919
919
annotate("text",
920
920
x = max_x(sampling_dist), y = max_count(boot_est_dist_limits),
921
921
vjust = 1,
@@ -1137,7 +1137,7 @@ visualize the interval on our distribution in Figure
1137
1137
1138
1138
``` {r 11-bootstrapping9, echo = F, message = FALSE, warning = FALSE, fig.cap = "Distribution of the bootstrap sample means with percentile lower and upper bounds.", fig.height=4, fig.width = 6.5}
1139
1139
boot_est_dist +
1140
- geom_vline(xintercept = bounds, col = "#E69F00 ", size = 2, linetype = 2 ) +
1140
+ geom_vline(xintercept = bounds, col = "darkorange ", linetype = "dashed", linewidth = 1 ) +
1141
1141
annotate("text",
1142
1142
x = bounds[1], max_count(boot_est_dist), hjust = 0.6, vjust = 2,
1143
1143
label = paste("2.5th percentile =", round(bounds[1], 2))
0 commit comments