Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: RE: Reshaping question


From   Anders Gaarsdal Holst <[email protected]>
To   [email protected]
Subject   Re: st: RE: Reshaping question
Date   Mon, 22 Feb 2010 13:48:37 +0100

Sorry for not being detailed enough in my description. As you see in my post
to Martin I solved the problem using "collapse (max)", but thanks a lot for
your help.

Sincere regards,
Anders Gaarsdal Holst
MD, Research Fellow
Department of Cardiology, B2142
University Hospital Rigshospitalet
Blegdamsvej 9
2100 Copenhagen

Phone: +45 35450639
Email: [email protected]


On Fri, Feb 19, 2010 at 4:11 PM, Nick Cox <[email protected]> wrote:

> You don't spell out what you are finding difficult or what you tried and
> why it didn't work or exactly what your variables are. Any of those
> would enable better advice.
>
> A -reshape wide-, which is what you seek, could not go as far as the
> Boolean. -egen rowmax()- would do the second as the row maximum of a
> Boolean is precisely an indicator of whether any value in the row is 1.
>
> However, this sounds like a panel and panels are usually better left as
> is. Then -egen  max() by(id)- would be the way to get your indicator.
>
> Nick
> [email protected]
>
> Anders Gaarsdal Holst
>
> I have a multiple observations per (person) id dataset and a boolean
> variable of interest "antibio". I would like to reshape this into a a
> single observation per id dataset with a boolean variable indicating
> whether the id has one or more observation with antiobio==1.
>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index