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

st: AW: one row for each individual

From   "Martin Weiss" <>
To   <>
Subject   st: AW: one row for each individual
Date   Thu, 26 Mar 2009 10:19:53 +0100


Stata does not randomly select in your example, but keeps exactly the first
observation for every "newID" if you specify -_n==1-. 

You may want to look at -reshape- for a solution...


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Chiara Mussida
Gesendet: Donnerstag, 26. März 2009 10:10
An: statalist
Betreff: st: one row for each individual

Dear All,
i'm trying to get 1 row for each individual in my dataset.
The actual situation of my data: I have 3 rows for each, and
the indivv are identifiesd with the variable newID. Anyway, by
employing the command: bysort newID: keep if _n==1, I get 1 row for
each, but stata randomly select 1 row for every individual in this way
causing the loss of relevant info. each indiv has been interv in 3
waves (2004,2005, 2006), for each wave I gen the corresponding
categorical variables, which are the lase 36 colums of the dataset. I
would be pleased, given that these represent the labour market story
of each subject, to get all this info in 1 row.
Does anybody know the precise command to get this result?

Thanks a lot

Chiara Mussida
PhD candidate
Doctoral school of Economic Policy
Catholic University, Piacenza (Italy)
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index