I would like to bootstrap a vector in Mata but I am not sure if I am
doing it correctly. My code is:
mata
mata clear
st_view(a=.,.,"x")
nr = rows(a)
for (i = 1; i <=1000; i++) {
line5: b = floor(uniform(nr,1)*nr + J(nr,1,1))
line6: boot=a[b]
//other commands using boot
}
end
Are lines 5 and 6 sufficient to bootstrap vector "a"?
Thanks you,
Scott
*
* 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/