|
Yes Art I see!,
I walked through the code and this time it certainly is sampling with
replacement. I tried to amend it to work with data in long format (instead
of having the data being sampled in wide column format), but I was
unsuccessful.
In general though I don't see why I would prefer this to the approach I
posted at the onset of series of emails (feel free to enlighten me). To make
your approach work you would need to flip the original data, which is an
expensive procedure. You also need to externally write a file with XSAVE.
While you are right in these things aren't a big deal for small datasets,
this is more code, making it intrinsically more complicated. So again, why
exactly would your approach be preferable?
David,
I liked your prior MATRIX bootstrap code better than the new snippet (and
the code I provided at the beginning of the post, which is almost an exact
duplicate of what you wrote in 1996 holy poopers
<https://groups.google.com/group/sci.stat.consult/msg/710ea4ab83ddf24a?dmode=source&pli=1>
!).
Mainly I'm concerned about the VARSTOCASES when either the number of
original cases is larger or the number of samples needed is larger. I
wouldn't want to stack the dataset and then sample if the original OP's
request was with a population of 40,000 cases and he wanted 1,000 samples
(i.e. a stacked dataset of 40 million). The problem grows with the size of
the original population even if the number or size of samples needed does
not. It does plug away though like a charm even with 40,000 cases and 1,000
samples!
Of course, whatever procedures individuals utilize will be dependent on the
nature of the task and size of the data. I believe your MATRIX procedure
could be modified to work in alot of situations. Either by calculating the
stats right within a MATRIX loop, or by piping out to a new dataset,
calculating the stats, and iterating for the number of repetitions one
wants.
I'm thinking of here problems that are too big to practically stack the data
and use split file. Otherwise, I'm personally pretty cool with the solution
you posted over 16 years ago!
Andy
|