Statalist


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

st: How to quickly generate variables by adding observations


From   "Mike Kim" <[email protected]>
To   <[email protected]>
Subject   st: How to quickly generate variables by adding observations
Date   Wed, 13 Jan 2010 12:18:49 -0600

Dear all,

I would like to create the follwong variables from the following data:

gen abc=abc_a + abc_b + abc_x
gen def=def_a + def_d
......

  yr    abc_a  abc_b  abc_x  def_a  def_d
1994 0 2 1 0 0
1995 0 0 1 2 0
1996 0 1 1 0 1
1997 0 1 0 1 0
1998 0 1 0 1 0
......

The problem is that I have a lot of these variables that need to be 
generated in this way. Is there any easy way to generate them?

Thank you in advance.
Mike.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index