Skip to content

Commit a42ed8f

Browse files
consistent style in inference
1 parent 3d4ec8b commit a42ed8f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

source/inference.Rmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ reliable—is there any way to improve the estimate? One way to improve a
491491
point estimate is to take a *larger* sample. To illustrate what effect this
492492
has, we will take many samples of size 20, 50, 100, and 500, and plot the
493493
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.
495495

496496
```{r 11-example-means6, echo = FALSE, message = FALSE, warning = FALSE}
497497
## Sampling n = 20, 50, 100, 500
@@ -542,9 +542,9 @@ sampling_distribution_500 <- ggplot(sample_estimates_500, aes(x = mean_price)) +
542542
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
543543
```
544544

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."}
546546
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") +
548548
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20)) +
549549
ggtitle("n = 20") +
550550
annotate("text",
@@ -559,7 +559,7 @@ annotated_sampling_dist_20 <- sampling_distribution_20 +
559559
# label = paste("sd = ", round(sd(sample_estimates$mean_price), 1)))
560560
561561
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") +
563563
## x limits set the same as n = 20 graph, y is this graph
564564
annotate("text",
565565
x = max_x(sampling_distribution_20),
@@ -572,7 +572,7 @@ annotated_sampling_dist_50 <- sampling_distribution_50 +
572572
# label = paste("sd = ", round(sd(sample_estimates_50$mean_price), 1)))
573573
574574
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") +
576576
annotate("text",
577577
x = max_x(sampling_distribution_20),
578578
y = max_count(sampling_distribution_100),
@@ -584,7 +584,7 @@ annotated_sampling_dist_100 <- sampling_distribution_100 +
584584
# label = paste("sd = ", round(sd(sample_estimates_100$mean_price), 1)))
585585
586586
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") +
588588
annotate("text",
589589
x = max_x(sampling_distribution_20),
590590
y = max_count(sampling_distribution_500),
@@ -904,7 +904,7 @@ sampling_dist <- ggplot(sample_estimates, aes(x = mean_price)) +
904904
905905
annotated_sampling_dist <- sampling_dist +
906906
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") +
908908
annotate("text",
909909
x = max_x(sampling_dist), y = max_count(sampling_dist),
910910
hjust = 1,
@@ -915,7 +915,7 @@ boot_est_dist_limits <- boot_est_dist +
915915
xlim(min_x(sampling_dist), max_x(sampling_dist))
916916
917917
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") +
919919
annotate("text",
920920
x = max_x(sampling_dist), y = max_count(boot_est_dist_limits),
921921
vjust = 1,
@@ -1137,7 +1137,7 @@ visualize the interval on our distribution in Figure
11371137

11381138
```{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}
11391139
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) +
11411141
annotate("text",
11421142
x = bounds[1], max_count(boot_est_dist), hjust = 0.6, vjust = 2,
11431143
label = paste("2.5th percentile =", round(bounds[1], 2))

0 commit comments

Comments
 (0)