Thanks Martin! Ok, but I guess I found the proper way to sort out the issue:
I have 3 rows for each individual that contain individual
characteristics + L mk info (in which I'm particularly interested)
surveyed yearly in 3 different waves. I guess the most proper way is
to separate my datasate into 3 files - 1 for each year - by obviously
renaming the variables of each year. Then, with a double merge (by my
newID) I will get the final file with 1 row for each subject.
I hope this will work
Cheers
Chiara
2009/3/26 Martin Weiss <[email protected]>:
>
> <>
>
> Also: Give an excerpt of your data, or frame your question in terms of a
> dataset shipped with Stata...
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Martin Weiss
> Gesendet: Donnerstag, 26. März 2009 10:20
> An: [email protected]
> Betreff: st: AW: one row for each individual
>
>
> <>
>
> 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...
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] 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:
> * 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/
>
--
Chiara Mussida
PhD candidate
Doctoral school of Economic Policy
Catholic University, Piacenza (Italy)
*
* 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/