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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: reshape data


From   Tyler Frazier <tyfrazier@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: reshape data
Date   Sat, 24 Jul 2010 14:02:49 -0400

I am trying to reshape a set of data such that

bldg_id       No_jobs       zone_id        bldg_type
1                    3                  2                 1
2                    4                  2                 1
3                    2                  1                 2
4                    2                  2                 3


becomes


job_id             bldg_id           zone_id        bldg_type
1                         1                   2                   1
2                         1                   2                   1
3                         1                   2                   1
4                         2                   2                   1
5                         2                   2                   1
6                         2                   2                   1
7                         2                   2                   1
8                         3                   1                   2
9                         3                   1                   2
10                       4                   2                   3
11                       4                   2                   3

in spss this was fairly simple, but I can't seem to get the command
right in Stata

isn't it reshape? bldg_id, zone_id and bldg_type are all strings

thanks,
Ty
*
*   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