Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: STATA 12 very slow compared to STATA 10


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   Re: st: STATA 12 very slow compared to STATA 10
Date   Tue, 12 Mar 2013 13:18:08 -0400

Sara,

Your loop opens data1.dta and data2.dta 500 times. How much time does
Stata need to open one file?

At one point in the history of Stata the format of data files was
changed. Files saved in the old format took longer to open in the
newer version of Stata than in the previous version. I don't think
there is a difference between Stata 10 and Stata 12 in that respect
but the time needed to open one file is something you may want to look
at.

Friedrich


On Tue, Mar 12, 2013 at 9:40 AM, Sara Borelli <[email protected]> wrote:
> Hi Martin
> you are right, I did not ask the question correctly. I thought there
> was maybe a common problem for STATA 12 being slow in general that
> others might have encountered. I apologize for that
>
> I write here below an extract of the program I am running. If you have
> any insight of what is going wrong I would really appreciate it. I
> also tried to run the entire program using "version 10" at the
> beginning of the do file, but it is still very slow
> I let the program run all night but is still not done. When I was
> using STATA 10 it was taking only 15 minutes overall
>
>
> before this "mat define" command line I am running some glm estimation
> that works at usual speed
>
> mat define P=J(618,1,.)
>
> set seed 55982264
>
> forvalues x=1/500 {
>
> mat define BS_r`x'=J(618,1,.)
>
> use data1
> for each var of varlist v1 v2 v3 v4 ....v10 {
> bsample
> mkmat `var', mat(Z_`var'_r`x')
> mat BS_r`x'=BS_r`x',Z_`var'_r`x'
> }
> drop v1-v10
> svmat BS_r`x', names(col)
> gen id=_n
> save BS_r`x', replace
>
> use data2, clear
> gen id=_n
> mmerge id using BS_r`x'
> save replication `x'
> predict prediction`x'
> mkmat prediction`x', mat(P_`x')
> mat P=P, P_`x'
> }
>
> It seem to run smoothly until the "predict", but seems to get slow at
> the time of running the command  mkmat prediction`x', mat(P_`x')
>
> thanks for any insight you might have
>
> Sara
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index