- h egen,seq()-
HTH
Martin
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Supnithadnaporn, Anupit
Sent: Thursday, October 16, 2008 5:12 AM
To: [email protected]
Subject: st: Use foreach or forvalues to create the long form data
Dear all,
Would you please suggest me how to create data in the long form
by *not* using reshape? I would like to avoid reshape because reshape
takes very very long time. In fact, the final & total number of records
that I have to create would be around 12,000,000.
I think foreach and forvalues can do this work.
But, I am a novice in Stata programming and could not figure out so far.
In the beginning, I have only Obsid which is created by
gen Obsid = _n
The desired data would look like this:
Obsid Vid Imp
1 1 1
2 1 2
3 1 3
4 1 4
5 2 1
6 2 2
7 2 3
8 2 4
...
100 25 4
Would anybody please help?
Thank you,
Anupit
*
* 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/