Statalist


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

Re: st: RE: RE: combining values distributed over multiple observations


From   Mark Pachucki <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: combining values distributed over multiple observations
Date   Wed, 9 Dec 2009 06:58:15 -0500

Martin - collapse was, in fact, the easiest path to the solution. I'm grateful for your advice! 

Mark 

On Dec 8, 2009, at 5:51 PM (12/8/09), Martin Weiss wrote:

> 
> <>
> 
> " It seems to be at the intersection of ideas behind reshape / stack"
> 
> 
> 
> -reshape- does indeed look like a great solution here, but really your
> dataset is neither exactly "long" nor "wide"...
> 
> -stack- seems a little far fetched. I rarely try to use it for this kind of
> data management problem...
> 
> HTH
> Martin
> 
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Martin Weiss
> Sent: Dienstag, 8. Dezember 2009 23:39
> To: [email protected]
> Subject: st: RE: combining values distributed over multiple observations
> 
> 
> <>
> 
> Could be as easy as
> 
> 
> *******
> clear*
> 
> inp var:mylabel T1      T2      T3      T4     T5 , auto
> A   .129       .         .          .         .
> A      .          .647   .          .         .
> A      .           .        .991    .         .
> A      .           .         .        .582    .
> A      .           .         .         .       .043
> end
> 
> compress
> 
> collapse (min) T?, by(var)
> list, noo
> *******
> 
> 
> HTH
> Martin
> 
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Mark Pachucki
> Sent: Dienstag, 8. Dezember 2009 23:35
> To: [email protected]
> Subject: st: combining values distributed over multiple observations
> 
> Hello - this seems like an exceedingly simple question, but couldn't find a
> reference to relevant syntax in the help. What I'm essentially trying to do
> is go from the below format, where a given variable "A" takes different
> values at discrete observations arrayed over T1-T5: 
> 
> var   T1      T2      T3      T4     T5
> 
> A   .129       .         .          .         .
> A      .          .647   .          .         .
> A      .           .        .991    .         .
> A      .           .         .        .582    .
> A      .           .         .         .       .043
> 
> 
> to the following format, wherein all values of A at each time are compressed
> into one observation : 
> 
> var      T1        T2      T3      T4     T5
> 
> A       .129     .647  .991   .582  .043
> 
> It seems to be at the intersection of ideas behind reshape / stack (and even
> stjoin - except it's not survival-time data). Yet doesn't fall neatly within
> any (or does it?) 
> 
> Thanks in advance, 
> Mark 
> *
> *   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/



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