Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: increasing time burden during resampling


From   "Joseph Coveney" <[email protected]>
To   <[email protected]>
Subject   st: Re: increasing time burden during resampling
Date   Wed, 30 Dec 2009 06:39:37 +0900

Al Feiveson wrote:

Thanks for your suggestion, but I don't think it's -bs-.  I tested to see what
would happen if I didn't resample at all, but kept estimating and testing on the
original data - same problem. In this test program, I also took out all the
-lincoms- and -test- commands and just redid the estimation. There was still a
very small increase in execution time with iteration number, but nowhere near
what it was before.

--------------------------------------------------------------------------------

A mystery to me . . .  In a limited trend test (below), estimation followed by
-test- doesn't seem to give any indication that they would progressively bog
things down.  Maybe you could have Stata-savvy colleagues take a look at your
code-- they might be able to see something you're overlooking.

Joseph Coveney

===============do-file================================

version 11.0
clear *
set more off
sysuse auto

tempname memhold
tempfile tmpfil0


forvalues iterations = 100(200)900 {
	timer clear 1
	timer on 1
	quietly forvalues iteration = 1/`iterations' {
		postfile `memhold' int iteration str11 predictor ///
			double p using `tmpfil0', replace
		regress price c.(mpg headroom trunk weight length ///
			turn displacement gear_ratio) i.(rep78 foreign)
		foreach predictor in mpg headroom trunk weight ///
			length turn displacement gear_ratio {
			test `predictor'
			post `memhold' (`iteration') ("`predictor'") (`r(p)')
		}
		postclose `memhold'
	}
	timer off 1
	display in smcl as text _newline(2) "Iterations: `iterations'"
	timer list 1
	display in smcl as text %4.2f r(t1) / `iterations' * 100  " s / 100"
}

exit

===============Output===========================

Iterations: 100
   1:      3.07 /        1 =       3.0740
3.07 s / 100


Iterations: 300
   1:      9.79 /        1 =       9.7940
3.26 s / 100


Iterations: 500
   1:     16.53 /        1 =      16.5340
3.31 s / 100


Iterations: 700
   1:     21.27 /        1 =      21.2700
3.04 s / 100


Iterations: 900
   1:     27.42 /        1 =      27.4200
3.05 s / 100

. 
. exit

end of do-file



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index