Hello Statalisters,
I am trying to find out if the number of repetitions in the process of
bootstraping ,has any weight on the reliability of the process .In so
doing I have run the following program for 1000 reps and for 100 reps ,for
which I got the output ,pasted after the program .
qui
clear
set obs 100
gen a = int(invnorm(uniform()))*25+75
gen aa = _n
sort aa
save a,replace
local i = 1
while `i'<= 100 {
use a,clear
sample 1
drop aa
rename a b
gen aa = `i'
sort aa
save b`i',replace
local i = `i'+1
}
use b1,clear
local i = 2
while `i'<=100 {
merge aa using b`i'
drop _merge
sort aa
local i = `i'+1
}
sort aa
save b,replace
merge aa using a.dta
drop _merge
order a b aa
}
tab a
tab b
........Output for 1000 reps...........
. qui
. tab a
a Freq. Percent Cum.
25 1 1.00 1.00
50 11 11.00 12.00
75 66 66.00 78.00
100 21 21.00 99.00
125 1 1.00 100.00
Total 100 100.00
. tab b
b Freq. Percent Cum.
25 8 0.80 0.80
50 102 10.20 11.00
75 655 65.50 76.50
100 226 22.60 99.10
125 9 0.90 100.00
Total 1000 100.00
........output for 100 reps ...........
qui
. tab a
a Freq. Percent Cum.
25 4 4.00 4.00
50 12 12.00 16.00
75 67 67.00 83.00
100 14 14.00 97.00
125 3 3.00 100.00
Total 100 100.00
. tab b
b Freq. Percent Cum.
25 5 5.00 5.00
50 11 11.00 16.00
75 68 68.00 84.00
100 15 15.00 99.00
125 1 1.00 100.00
Total 100 100.00
...........................
I would like to be able to run this experiment for a number of times ,but
each time I would like to save the Percent of each observation in "a "
(the population I am interested in) and the Percent of each observation
in "b" ,so that I could then test for tendency in discrepancy ,for
different reps , given different population sizes.
I could do it by hand ,but I suspect that it could be done more smartly .
Thanks before hand,
Victor Michael Zammit
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/