Skip to content

Commit ec1c98b

Browse files
Merge pull request #515 from UBC-DSCI/shorten-cad-to-dollars
Inference chapter: Canadian dollars to just "dollars"
2 parents e02391a + 8e87df9 commit ec1c98b

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

source/inference.Rmd

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ We can visualize the population distribution of the price per night with a histo
338338
options(pillar.sigfig = 5)
339339
```
340340

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}
341+
```{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)) +
343343
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
344-
labs(x = "Price per night (Canadian dollars)", y = "Count") +
344+
labs(x = "Price per night (dollars)", y = "Count") +
345345
theme(text = element_text(size = 12))
346346
347347
population_distribution
@@ -383,10 +383,10 @@ We can create a histogram to visualize the distribution of observations in the
383383
sample (Figure \@ref(fig:11-example-means-sample-hist)), and calculate the mean
384384
of our sample.
385385

386-
```{r 11-example-means-sample-hist, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", fig.cap = "Distribution of price per night (Canadian dollars) for sample of 40 Airbnb listings.", fig.height = 3.5, fig.width = 4.5}
386+
```{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)) +
388388
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
389-
labs(x = "Price per night (Canadian dollars)", y = "Count") +
389+
labs(x = "Price per night (dollars)", y = "Count") +
390390
theme(text = element_text(size = 12))
391391
392392
sample_distribution
@@ -434,7 +434,7 @@ sample_estimates
434434
435435
sampling_distribution_40 <- ggplot(sample_estimates, aes(x = sample_mean)) +
436436
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
437-
labs(x = "Sample mean price per night (Canadian dollars)", y = "Count") +
437+
labs(x = "Sample mean price per night (dollars)", y = "Count") +
438438
theme(text = element_text(size = 12))
439439
440440
sampling_distribution_40
@@ -514,30 +514,30 @@ sample_estimates_500 <- rep_sample_n(airbnb, size = 500, reps = 20000) |>
514514
## Sampling distribution n = 20
515515
sampling_distribution_20 <- ggplot(sample_estimates_20, aes(x = sample_mean)) +
516516
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
517-
labs(x = "Sample mean price per night\n(Canadian dollars)", y = "Count") +
517+
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 = sample_mean)) +
522522
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
523523
ylab("Count") +
524-
xlab("Sample mean price per night\n(Canadian dollars)") +
524+
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 = sample_mean)) +
530530
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
531531
ylab("Count") +
532-
xlab("Sample mean price per night\n(Canadian dollars)") +
532+
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 = sample_mean)) +
538538
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
539539
ylab("Count") +
540-
xlab("Sample mean price per night\n(Canadian dollars)") +
540+
xlab("Sample mean price per night (dollars)") +
541541
ggtitle("n = 500") +
542542
xlim(min_x(sampling_distribution_20), max_x(sampling_distribution_20))
543543
```
@@ -672,7 +672,7 @@ sample_10 <- airbnb |>
672672
rep_sample_n(10)
673673
sample_distribution_10 <- ggplot(sample_10, aes(price)) +
674674
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
675-
xlab("Price per night (Canadian dollars)") +
675+
xlab("Price per night (dollars)") +
676676
ylab("Count") +
677677
ggtitle("n = 10")
678678
@@ -681,7 +681,7 @@ sample_20 <- airbnb |>
681681
682682
sample_distribution_20 <- ggplot(sample_20, aes(price)) +
683683
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
684-
xlab("Price per night (Canadian dollars)") +
684+
xlab("Price per night (dollars)") +
685685
ylab("Count") +
686686
ggtitle("n = 20")
687687
@@ -690,7 +690,7 @@ sample_50 <- airbnb |>
690690
691691
sample_distribution_50 <- ggplot(sample_50, aes(price)) +
692692
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
693-
xlab("Price per night (Canadian dollars)") +
693+
xlab("Price per night (dollars)") +
694694
ylab("Count") +
695695
ggtitle("n = 50")
696696
@@ -699,7 +699,7 @@ sample_100 <- airbnb |>
699699
700700
sample_distribution_100 <- ggplot(sample_100, aes(price)) +
701701
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
702-
xlab("Price per night (Canadian dollars)") +
702+
xlab("Price per night (dollars)") +
703703
ylab("Count") +
704704
ggtitle("n = 100")
705705
@@ -708,7 +708,7 @@ sample_200 <- airbnb |>
708708
709709
sample_distribution_200 <- ggplot(sample_200, aes(price)) +
710710
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
711-
xlab("Price per night (Canadian dollars)") +
711+
xlab("Price per night (dollars)") +
712712
ylab("Count") +
713713
ggtitle("n = 200")
714714
@@ -779,12 +779,12 @@ one_sample <- one_sample |>
779779
ungroup() |> select(-replicate)
780780
```
781781

782-
```{r 11-bootstrapping1, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", fig.cap = "Histogram of price per night (Canadian dollars) for one sample of size 40.", fig.height = 3.5, fig.width = 4.5}
782+
```{r 11-bootstrapping1, echo = TRUE, message = FALSE, warning = FALSE, fig.pos = "H", out.extra="", fig.cap = "Histogram of price per night (dollars) for one sample of size 40.", fig.height = 3.5, fig.width = 4.5}
783783
one_sample
784784
785785
one_sample_dist <- ggplot(one_sample, aes(price)) +
786786
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
787-
labs(x = "Price per night (Canadian dollars)", y = "Count") +
787+
labs(x = "Price per night (dollars)", y = "Count") +
788788
theme(text = element_text(size = 12))
789789
790790
one_sample_dist
@@ -810,7 +810,7 @@ boot1 <- one_sample |>
810810
rep_sample_n(size = 40, replace = TRUE, reps = 1)
811811
boot1_dist <- ggplot(boot1, aes(price)) +
812812
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
813-
labs(x = "Price per night (Canadian dollars)", y = "Count") +
813+
labs(x = "Price per night (dollars)", y = "Count") +
814814
theme(text = element_text(size = 12))
815815
816816
boot1_dist
@@ -850,7 +850,7 @@ six_bootstrap_samples <- boot20000 |>
850850
851851
ggplot(six_bootstrap_samples, aes(price)) +
852852
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
853-
labs(x = "Price per night (Canadian dollars)", y = "Count") +
853+
labs(x = "Price per night (dollars)", y = "Count") +
854854
facet_wrap(~replicate) +
855855
theme(text = element_text(size = 12))
856856
```
@@ -881,7 +881,7 @@ tail(boot20000_means)
881881
882882
boot_est_dist <- ggplot(boot20000_means, aes(x = mean)) +
883883
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
884-
labs(x = "Sample mean price per night \n (Canadian dollars)", y = "Count") +
884+
labs(x = "Sample mean price per night (dollars)", y = "Count") +
885885
theme(text = element_text(size = 12))
886886
887887
boot_est_dist
@@ -900,7 +900,7 @@ sample_estimates <- samples |>
900900
sampling_dist <- ggplot(sample_estimates, aes(x = sample_mean)) +
901901
geom_histogram(fill = "dodgerblue3", color = "lightgrey") +
902902
ylab("Count") +
903-
xlab("Sample mean price per night \n (Canadian dollars)")
903+
xlab("Sample mean price per night (dollars)")
904904
905905
annotated_sampling_dist <- sampling_dist +
906906
xlim(min_x(sampling_dist), max_x(sampling_dist)) +

0 commit comments

Comments
 (0)