Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: create local macros named after the values of a categorial variable


From   Jeph Herrin <stata@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: create local macros named after the values of a categorial variable
Date   Fri, 13 Aug 2010 09:18:55 -0400

Will

  tab citycode, matcell(A) matrow(cities)

do what you want?


On 8/13/2010 8:47 AM, Oliver Jones wrote:
Hi,
thanks for all of the answers. Especially the detailed
answer from Sergiy helped me very much.

Here is a little more background information on the task
I'm working on:
I want to generate a matrix of frequencies.
The idea is do just on loop over all my observations and
increment the appropriate frequencies matrix entries.

I need the locals named after the city codes as an index
telling me in which row of my frequency matrix I need
to increment the entries.

The -collapse- command is not going to work for me because
of its vast need of memory, see my post:
"RE: st: RE: collapse is too memory demanding"
from Tue, 27 Jul 2010.
The workaround is working but is quite slow, it took about
20 hours to complete. That's why I'm thinking of a way to
program more efficient.


Kind regards
Oliver
*
* 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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index