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]

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: AW: Reorganization of pael data |

Date |
Wed, 14 Apr 2010 19:01:26 +0200 |

<> -collapse- is shipped with official Stata. What does -which collapse- give you? HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of mareikehahr@aol.com Sent: Mittwoch, 14. April 2010 18:59 To: statalist@hsphsun2.harvard.edu Subject: Re: st: AW: Reorganization of pael data Hello Martin, I now downloaded the ado-file to be able to use the command "collapse (firstname)". In its description it says that one has to tsset the data before being able to use the new operator. But whenever I try to do so (by giving the command: tsset year), stata comes up with an error criticiszing that there are repeated time values in the data. And this is the problem I'm trying to get rid of .... -----Original Message----- rom: Martin Weiss <martin.weiss1@gmx.de> To: statalist@hsphsun2.harvard.edu Sent: Wed, Apr 14, 2010 6:48 pm Subject: RE: st: AW: Reorganization of pael data <> " Maybe you could you collapse with if and by?" I think there was enough -by()- to go around in my line ******* collapse (firstnm) var1 var2, by(country year) ******* What do you want to add to that? What kind of -if- qualifier do you have in mind? HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Abhimanyu Arora Sent: Mittwoch, 14. April 2010 18:27 To: statalist@hsphsun2.harvard.edu Subject: RE: st: AW: Reorganization of pael data Maybe you could you collapse with if and by? Abhimanyu -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of mareikehahr@aol.com Sent: woensdag 14 april 2010 18:06 To: statalist@hsphsun2.harvard.edu Subject: Re: st: AW: Reorganization of pael data Thanks to your help, Martin, I got rid of my initial probelm, but unfortunately I'm still not totally happy with the result. Now my dataset looks like follows: country year var1 var2 var3 A x 1 . . A y 2 . . A x . 3 . A y . 4 . A x . . 5 A y . . 6 But I would like to have all the observations for the different variables of the same country and year to appear in the same row, like A x 1 3 5 A y 2 4 6 Thanks in advance Mareike -----Original Message----- From: Martin Weiss <martin.weiss1@gmx.de> To: statalist@hsphsun2.harvard.edu Sent: Wed, Apr 14, 2010 11:59 am Subject: st: AW: Reorganization of pael data <> You could also try: ************* clear* inp country:mylabel str4 variable int year obs, auto A var1 2000 3 A var1 2001 4 A var2 2000 7 A var2 2001 11 B var1 2000 13 B var1 2001 32 B var2 2000 23 B var2 2001 34 end compress list, noo gen var1=obs if variable=="var1" gen var2=obs if variable=="var2" collapse (firstnm) var1 var2, by(country year) list, noo ************* HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Mareike Gesendet: Mittwoch, 14. April 2010 11:36 An: statalist@hsphsun2.harvard.edu Betreff: st: Reorganization of pael data Dear Statalist, I have a panel dataset that is structured the following way: country variable year observation A var1 x obs_A_var1_x A var1 y obs_A_var1_y A var2 x obs_A_var2_x A var2 y obs_A_var2_y B var1 x obs_B_var1_x . . . But I want it to be structured as followed: country year var1 var2 A x A y B x B y Is there a command for transposing the data like that? Thanks in advance Mareike * * 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/ * * 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/ * * 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/ * * 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/

**Follow-Ups**:**Re: st: AW: Reorganization of pael data***From:*mareikehahr@aol.com

**RE: st: AW: Reorganization of pael data***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**References**:**st: Reorganization of pael data***From:*"Mareike" <MareikeHahr@aol.com>

**st: AW: Reorganization of pael data***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**Re: st: AW: Reorganization of pael data***From:*mareikehahr@aol.com

**RE: st: AW: Reorganization of pael data***From:*"Abhimanyu Arora" <abhimanyu.arora@student.kuleuven.be>

**RE: st: AW: Reorganization of pael data***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**Re: st: AW: Reorganization of pael data***From:*mareikehahr@aol.com

- Prev by Date:
**RE: st: AW: Reorganization of pael data** - Next by Date:
**Re: st: AW: Reorganization of pael data** - Previous by thread:
**Re: st: AW: Reorganization of pael data** - Next by thread:
**RE: st: AW: Reorganization of pael data** - Index(es):