Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Re: RE: Multiple commands under "By varlist"?

From   "Michael Blasnik" <>
To   <>
Subject   st: Re: Re: RE: Multiple commands under "By varlist"?
Date   Sat, 26 Jun 2004 10:22:14 -0400

I wonder if you are using an up-to-date -statsby- that included some
dramatic speed improvements for larger panel datasets like you are
sing.  -which statsby- shows the following for me:

*! version 2.0.5  13apr2004

The key speed improvement is from doing away with the -if- statements in the
group identification in the code and instead using -in-.  I find that
statsby with a regression on 1000 panels takes only slightly longer than
by...:regress.  Your finding of 15-20x longer indicates that you are most
likely using the older version.

Michael Blasnik

----- Original Message ----- 
From: "Subhankar Nayak" <>
To: <>
Sent: Saturday, June 26, 2004 9:57 AM
Subject: st: Re: RE: Multiple commands under "By varlist"?

> Thanks Nick,
> I tried the -statsby- command as Scott Merryman suggested and the -forval-
> command that you are suggesting. But both these take almost exactly the
> amount of time as the -while- looping command... (Given my program code,
> each simulation round is taking about 240-330 seconds, and I have got 1000
> simulation rounds, if not more).
> The -by- command is so much faster than the -while- command...
> If I compare
> by month: regress returns factor
> vs.
> local i = 1
> while i <= 1000 {
> regress returns factor if `i' == month
> local i = `i' + 1
> }
> I find that the -by- command is atleast 15-20 times faster than
the -while-
> loop.
> Given this, it would be really wonderful to be able to execute multiple
> commands under -by-...
> Some wishful thinking!

*   For searches and help try:

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