Based on Nick's comments, I worked to minimize the number of times I used
the "mkmat" command. I did this by combining subsets of observations into
larger matrices, and then generated sub-matrices for each observation. This
meant that I only needed to use "mkmat" 24 times, rather than 2500 times. I
ended up creating a lot of sub-matrices, but this was still far faster than
using mkmat.
Then I used Kit's (revised) mkmat2 to speed up the mkmat subroutine.
Together these changes resulted in an enormous increase in speed. Thanks
again!
Elizabeth
*
* 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/