Example 5.5, page 143; table 5.2, page 143.
use https://stats.idre.ucla.edu/stat/stata/examples/smss/books, clear
display (54+1)/2-sqrt(54)
20.151531
display (54+1)/2+sqrt(54)
34.848469
sort p
list in 20
c p
20. 1 11
list in 35
c p
35. 5 19
stem p, lines(2)
Stem-and-leaf plot for p
0* | 33444
0. | 555667789
1* | 00001112334
1. | 577778889999999
2* | 0012
2. |
3* | 0
3. |
4* | 34
4. | 78
5* | 4
5. |
6* |
6. |
7* | 1
7. |
8* |
8. |
9* | 2
9. | 7
10* |
10. |
11* |
11. |
12* |
12. |
13* |
13. |
14* | 0
Bootstrap, pages 143-144.
* Stata 8 code.
bs "summarize p, detail" r(p50), reps(1000)
* Stata 9 code and output.
bootstrap r(p50), reps(1000) nodots: summarize p, detail
Bootstrap results Number of obs = 54
Replications = 1000
command: summarize p , detail
_bs_1: r(p50)
------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_bs_1 | 17 2.133444 7.97 0.000 12.81853 21.18147
------------------------------------------------------------------------------
estat bootstrap, all
Bootstrap results Number of obs = 54
Replications = 1000
command: summarize p , detail
_bs_1: r(p50)
------------------------------------------------------------------------------
| Observed Bootstrap
| Coef. Bias Std. Err. [95% Conf. Interval]
-------------+----------------------------------------------------------------
_bs_1 | 17 -1.1955 2.1334435 12.81853 21.18147 (N)
| 11 19 (P)
| 15 19 (BC)
------------------------------------------------------------------------------
(N) normal confidence interval
(P) percentile confidence interval
(BC) bias-corrected confidence interval
