@@ -174,7 +174,7 @@ population_proportion <- airbnb |>
174
174
```
175
175
176
176
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
178
178
value, ` r round(population_proportion,3) ` , is the population parameter. Remember, this
179
179
parameter value is usually unknown in real data analysis problems, as it is
180
180
typically not possible to make measurements for an entire population.
@@ -398,7 +398,7 @@ estimates
398
398
```
399
399
400
400
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
402
402
number is a point estimate for the mean of the full population.
403
403
Recall that the population mean was
404
404
\$ ` 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.
771
771
Once again, suppose we are
772
772
interested in estimating the population mean price per night of all Airbnb
773
773
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
775
775
histogram of prices in the sample is displayed in Figure \@ ref(fig:11-bootstrapping1).
776
776
777
777
``` {r, echo = F, message = F, warning = F}
@@ -791,7 +791,7 @@ one_sample_dist
791
791
```
792
792
793
793
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) ` .
795
795
Remember, in practice, we usually only have this one sample from the population. So
796
796
this sample and estimate are the only data we can work with.
797
797
@@ -1150,9 +1150,9 @@ boot_est_dist +
1150
1150
To finish our estimation of the population parameter, we would report the point
1151
1151
estimate and our confidence interval's lower and upper bounds. Here the sample
1152
1152
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
1154
1154
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) ` .
1156
1156
Notice that our interval does indeed contain the true
1157
1157
population mean value, \$ ` r round(mean(airbnb$price),2) ` \! However, in
1158
1158
practice, we would not know whether our interval captured the population
0 commit comments