Skip to content

Commit e75f9d2

Browse files
use default colors in inference
1 parent ad3ebe4 commit e75f9d2

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

img/inference/intro-bootstrap.jpeg

-98.6 KB
Loading

source/inference.Rmd

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ sampling distribution directly for learning purposes.
292292

293293
```{r 11-example-proportions7, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", fig.cap = "Sampling distribution of the sample proportion for sample size 40.", fig.height = 3.3, fig.width = 4.2}
294294
sampling_distribution <- ggplot(sample_estimates, aes(x = sample_proportion)) +
295-
geom_histogram(fill = "dodgerblue3", color = "lightgrey", bins = 12) +
295+
geom_histogram(color = "lightgrey", bins = 12) +
296296
labs(x = "Sample proportions", y = "Count") +
297297
theme(text = element_text(size = 12))
298298
@@ -340,7 +340,7 @@ options(pillar.sigfig = 5)
340340

341341
```{r 11-example-means2, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", fig.cap = "Population distribution of price per night (dollars) for all Airbnb listings in Vancouver, Canada.", fig.height = 3.5, fig.width = 4.5}
342342
population_distribution <- ggplot(airbnb, aes(x = price)) +
343-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
343+
geom_histogram(color = "lightgrey") +
344344
labs(x = "Price per night (dollars)", y = "Count") +
345345
theme(text = element_text(size = 12))
346346
@@ -385,7 +385,7 @@ of our sample.\index{ggplot!geom\_histogram}
385385

386386
```{r 11-example-means-sample-hist, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", fig.cap = "Distribution of price per night (dollars) for sample of 40 Airbnb listings.", fig.height = 3.5, fig.width = 4.5}
387387
sample_distribution <- ggplot(one_sample, aes(price)) +
388-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
388+
geom_histogram(color = "lightgrey") +
389389
labs(x = "Price per night (dollars)", y = "Count") +
390390
theme(text = element_text(size = 12))
391391
@@ -433,7 +433,7 @@ sample_estimates <- samples |>
433433
sample_estimates
434434
435435
sampling_distribution_40 <- ggplot(sample_estimates, aes(x = mean_price)) +
436-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
436+
geom_histogram(color = "lightgrey") +
437437
labs(x = "Sample mean price per night (dollars)", y = "Count") +
438438
theme(text = element_text(size = 12))
439439
@@ -513,29 +513,29 @@ sample_estimates_500 <- rep_sample_n(airbnb, size = 500, reps = 20000) |>
513513
514514
## Sampling distribution n = 20
515515
sampling_distribution_20 <- ggplot(sample_estimates_20, aes(x = mean_price)) +
516-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
516+
geom_histogram(color = "lightgrey") +
517517
labs(x = "Sample mean price per night (dollars)", y = "Count") +
518518
ggtitle("n = 20")
519519
520520
## Sampling distribution n = 50
521521
sampling_distribution_50 <- ggplot(sample_estimates_50, aes(x = mean_price)) +
522-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
522+
geom_histogram(color = "lightgrey") +
523523
ylab("Count") +
524524
xlab("Sample mean price per night (dollars)") +
525525
ggtitle("n = 50") +
526526
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
527527
528528
## Sampling distribution n = 100
529529
sampling_distribution_100 <- ggplot(sample_estimates_100, aes(x = mean_price)) +
530-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
530+
geom_histogram(color = "lightgrey") +
531531
ylab("Count") +
532532
xlab("Sample mean price per night (dollars)") +
533533
ggtitle("n = 100") +
534534
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
535535
536536
## Sampling distribution n = 500
537537
sampling_distribution_500 <- ggplot(sample_estimates_500, aes(x = mean_price)) +
538-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
538+
geom_histogram(color = "lightgrey") +
539539
ylab("Count") +
540540
xlab("Sample mean price per night (dollars)") +
541541
ggtitle("n = 500") +
@@ -671,7 +671,7 @@ large enough sample.
671671
sample_10 <- airbnb |>
672672
rep_sample_n(10)
673673
sample_distribution_10 <- ggplot(sample_10, aes(price)) +
674-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
674+
geom_histogram(color = "lightgrey") +
675675
xlab("Price per night (dollars)") +
676676
ylab("Count") +
677677
ggtitle("n = 10")
@@ -680,7 +680,7 @@ sample_20 <- airbnb |>
680680
rep_sample_n(20)
681681
682682
sample_distribution_20 <- ggplot(sample_20, aes(price)) +
683-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
683+
geom_histogram(color = "lightgrey") +
684684
xlab("Price per night (dollars)") +
685685
ylab("Count") +
686686
ggtitle("n = 20")
@@ -689,7 +689,7 @@ sample_50 <- airbnb |>
689689
rep_sample_n(50)
690690
691691
sample_distribution_50 <- ggplot(sample_50, aes(price)) +
692-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
692+
geom_histogram(color = "lightgrey") +
693693
xlab("Price per night (dollars)") +
694694
ylab("Count") +
695695
ggtitle("n = 50")
@@ -698,7 +698,7 @@ sample_100 <- airbnb |>
698698
rep_sample_n(100)
699699
700700
sample_distribution_100 <- ggplot(sample_100, aes(price)) +
701-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
701+
geom_histogram(color = "lightgrey") +
702702
xlab("Price per night (dollars)") +
703703
ylab("Count") +
704704
ggtitle("n = 100")
@@ -707,7 +707,7 @@ sample_200 <- airbnb |>
707707
rep_sample_n(200)
708708
709709
sample_distribution_200 <- ggplot(sample_200, aes(price)) +
710-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
710+
geom_histogram(color = "lightgrey") +
711711
xlab("Price per night (dollars)") +
712712
ylab("Count") +
713713
ggtitle("n = 200")
@@ -783,7 +783,7 @@ one_sample <- one_sample |>
783783
one_sample
784784
785785
one_sample_dist <- ggplot(one_sample, aes(price)) +
786-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
786+
geom_histogram(color = "lightgrey") +
787787
labs(x = "Price per night (dollars)", y = "Count") +
788788
theme(text = element_text(size = 12))
789789
@@ -809,7 +809,7 @@ we change the argument for `replace` from its default value of `FALSE` to `TRUE`
809809
boot1 <- one_sample |>
810810
rep_sample_n(size = 40, replace = TRUE, reps = 1)
811811
boot1_dist <- ggplot(boot1, aes(price)) +
812-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
812+
geom_histogram(color = "lightgrey") +
813813
labs(x = "Price per night (dollars)", y = "Count") +
814814
theme(text = element_text(size = 12))
815815
@@ -849,7 +849,7 @@ six_bootstrap_samples <- boot20000 |>
849849
filter(replicate <= 6)
850850
851851
ggplot(six_bootstrap_samples, aes(price)) +
852-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
852+
geom_histogram(color = "lightgrey") +
853853
labs(x = "Price per night (dollars)", y = "Count") +
854854
facet_wrap(~replicate) +
855855
theme(text = element_text(size = 12))
@@ -880,7 +880,7 @@ boot20000_means
880880
tail(boot20000_means)
881881
882882
boot_est_dist <- ggplot(boot20000_means, aes(x = mean_price)) +
883-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
883+
geom_histogram(color = "lightgrey") +
884884
labs(x = "Sample mean price per night (dollars)", y = "Count") +
885885
theme(text = element_text(size = 12))
886886
@@ -898,7 +898,7 @@ sample_estimates <- samples |>
898898
summarize(mean_price = mean(price))
899899
900900
sampling_dist <- ggplot(sample_estimates, aes(x = mean_price)) +
901-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
901+
geom_histogram(color = "lightgrey") +
902902
ylab("Count") +
903903
xlab("Sample mean price per night (dollars)")
904904
@@ -988,7 +988,7 @@ boot1_dist <- boot1_dist + ggtitle("Samples with Replacement") +
988988
)
989989
990990
boot2_dist <- ggplot(boot2, aes(price)) +
991-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
991+
geom_histogram(color = "lightgrey") +
992992
theme(
993993
axis.title.x = element_blank(),
994994
axis.ticks.x = element_blank(),
@@ -999,7 +999,7 @@ boot2_dist <- ggplot(boot2, aes(price)) +
999999
)
10001000
10011001
boot3_dist <- ggplot(boot3, aes(price)) +
1002-
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
1002+
geom_histogram(color = "lightgrey") +
10031003
xlab("") +
10041004
theme(
10051005
axis.ticks.x = element_blank(),

0 commit comments

Comments
 (0)