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: loop
Muhammad Anees <email@example.com>
Re: st: loop
Mon, 27 Aug 2012 12:22:06 +0500
tab cat12, gen(newcat12)
will give you those required variables (categorical or dummies).
On Mon, Aug 27, 2012 at 11:32 AM, Chiara Mussida <firstname.lastname@example.org> wrote:
> Dear all,
> the variable cat12 takes the values from 1 to 12. I want to create 12
> different scalars or variables for each cat. The problem is that each
> scalar must take the values correspondent to the log of the number of
> obs in each cat (weighted) since i have to write an index which needs
> those numbers. I tried with forvalues but i did not succeed!
> Ps: cat12 is a variable for occupational categories (from 1 to 12). In
> the index i put the weighted values (weight available in my dataset).
> Chiara Mussida
> PhD candidate
> Doctoral school of Economic Policy
> Catholic University, Piacenza (Italy)
> * 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/
Assistant Professor/Programme Coordinator
COMSATS Institute of Information Technology
Attock 43600, Pakistan
* For searches and help try: