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:56:49 +0900

Sorry.  You'd never have been able to see any influence of estimation and
testing amid all of the post file opening and closing in the inner loop; fixed
below.  Still no trend indicating bogging down from -test-, though.

Joseph Coveney


version 11.0
clear *
set more off
sysuse auto

tempname memhold
tempfile tmpfil0


forvalues iterations = 100(200)900 {
	timer clear 1
	timer on 1
	postfile `memhold' int iteration str11 predictor ///
			double p using `tmpfil0', replace
	quietly forvalues iteration = 1/`iterations' {
		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


Iterations: 100
   1:      1.94 /        1 =       1.9430
1.94 s / 100


Iterations: 300
   1:      5.77 /        1 =       5.7680
1.92 s / 100


Iterations: 500
   1:      8.98 /        1 =       8.9830
1.80 s / 100


Iterations: 700
   1:     12.69 /        1 =      12.6880
1.81 s / 100


Iterations: 900
   1:     16.14 /        1 =      16.1440
1.79 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