Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | László Sándor <sandorl@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: indicator variables from -by- |
Date | Sun, 25 Aug 2013 12:52:25 -0400 |
That said, the wrapper bys'd already runs 12 times slower on sysuse auto expanded 10000 times than sum itself by'd. Very disappointing. Or maybe this is the same issue, still fixable? In any case, I'm still curious how not to run the by loop over missing values of byvar. Somehow I cannot find the option for this. Thanks. On Sun, Aug 25, 2013 at 12:42 PM, László Sándor <sandorl@gmail.com> wrote: > That said, the wrapper bys'd already runs 12 times slower on sysuseauto > (expanded 10000 times) than sum itself by'd. Very disappointing. Or maybe > this is the same issue, still fixable? > > In any case, I'm still curious how not to run the by loop over missing > values of byvar. Somehow I cannot find the option for this. Thanks. > > > On Sun, Aug 25, 2013 at 11:55 AM, László Sándor <sandorl@gmail.com> wrote: >> >> Hi, >> I have so many observations that even the byte tempvars of >> -marksample- might make me run out of memory. >> >> But -by- must be inefficient in this, as if you -bys- over many groups >> (e.g. households), you never run out of memory because a new touse >> tempvar was created for each group. >> >> Thus I don't understand why this wrapper for -sum, meanonly- (just to >> collect saved results lost otherwise) runs out of copious amounts of >> memory (bying over 20 groups) while the -bys: sum, meanonly- is still >> much, much faster than any tabbing or tabstating or statsbying or Mata >> alternative. What does -by- handle differently about the latter what >> it cannot do with the former? >> >> prog mymns, byable(recall, noheader) >> syntax [varlist] [if] [in] >> marksample touse >> sum `varlist' if `touse', mean >> mat A=nullmat(A)\r(mean) >> end >> >> Thanks, >> >> Laszlo >> * >> * 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/ > > * * 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/