Statalist


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

st: AW: AW: one row for each individual


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: AW: one row for each individual
Date   Thu, 26 Mar 2009 10:51:51 +0100

<> 

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/



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