Skip to content

Commit 0b37739

Browse files
fix dollar sign typesetting in inference
1 parent 51c5b22 commit 0b37739

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/inference.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ population_proportion <- airbnb |>
174174
```
175175

176176
We can see that the proportion of `Entire home/apt` listings in
177-
the data set is `r round(population_proportion,3)`. This
177+
the data set is `r round(population_proportion,3)`. This
178178
value, `r round(population_proportion,3)`, is the population parameter. Remember, this
179179
parameter value is usually unknown in real data analysis problems, as it is
180180
typically not possible to make measurements for an entire population.
@@ -398,7 +398,7 @@ estimates
398398
```
399399

400400
The average value of the sample of size 40
401-
is \$`r round(estimates$mean_price, 2)`. This
401+
is \$`r format(round(estimates$mean_price, 2), nsmall=2)`. This
402402
number is a point estimate for the mean of the full population.
403403
Recall that the population mean was
404404
\$`r round(population_parameters$mean_price,2)`. So our estimate was fairly close to
@@ -771,7 +771,7 @@ and use a bootstrap distribution using just a single sample from the population.
771771
Once again, suppose we are
772772
interested in estimating the population mean price per night of all Airbnb
773773
listings in Vancouver, Canada, using a single sample size of 40.
774-
Recall our point estimate was \$`r round(estimates$mean_price, 2)`. The
774+
Recall our point estimate was \$`r format(round(estimates$mean_price, 2), nsmall=2)`. The
775775
histogram of prices in the sample is displayed in Figure \@ref(fig:11-bootstrapping1).
776776

777777
```{r, echo = F, message = F, warning = F}
@@ -791,7 +791,7 @@ one_sample_dist
791791
```
792792

793793
The histogram for the sample is skewed, with a few observations out to the right. The
794-
mean of the sample is \$`r round(estimates$mean_price, 2)`.
794+
mean of the sample is \$`r format(round(estimates$mean_price, 2), nsmall=2)`.
795795
Remember, in practice, we usually only have this one sample from the population. So
796796
this sample and estimate are the only data we can work with.
797797

@@ -1150,9 +1150,9 @@ boot_est_dist +
11501150
To finish our estimation of the population parameter, we would report the point
11511151
estimate and our confidence interval's lower and upper bounds. Here the sample
11521152
mean price per night of 40 Airbnb listings was
1153-
\$`r round(mean(one_sample$price),2)`, and we are 95\% "confident" that the true
1153+
\$`r format(round(mean(one_sample$price),2), nsmall=2)`, and we are 95\% "confident" that the true
11541154
population mean price per night for all Airbnb listings in Vancouver is between
1155-
\$(`r round(bounds[1],2)`, `r round(bounds[2],2)`).
1155+
\$`r round(bounds[1],2)` and \$`r round(bounds[2],2)`.
11561156
Notice that our interval does indeed contain the true
11571157
population mean value, \$`r round(mean(airbnb$price),2)`\! However, in
11581158
practice, we would not know whether our interval captured the population

0 commit comments

Comments
 (0)