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: rehape query?
Tim Evans <Tim.Evans@wmciu.nhs.uk>
st: rehape query?
Mon, 23 Jul 2012 12:11:13 +0100
Hi, I'm using Stata 11.2.
I have a dataset in the following format:
year dep_val m0004 m0509 m1014
1981 Affluent 536212 595619 719034
1981 Average 278534 299131 364013
1981 Deprived 638771 651976 800071
1982 Affluent 544452 564154 700325
1982 Average 283399 283462 353927
1982 Deprived 652394 618789 776801
1983 Affluent 551374 542624 680392
1983 Average 287977 272890 343038
1983 Deprived 666933 597369 751282
I wish to reconfigure the dataset so that it looks more like this:
Year dep_val sex age_grp pop
1981 Affluent m 0004 536212
1981 Affluent m 0509 595619
1981 Affluent m 1014 719034
1981 Average m 0004 278534
1981 Average m 0509 299131
1981 Average m 1014 364013
I would group the data by year - i.e. 1981, each age_grp in each dep_val.
Does anyone have a solution I could use, which is going to use some aspect of -reshape- I've got a little confused by it.
Any help appreciated.
This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.
* For searches and help try: