Statalist


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

Re: st: reshape wide - conversion problem


From   Joseph McDonnell <[email protected]>
To   [email protected]
Subject   Re: st: reshape wide - conversion problem
Date   Sun, 12 Apr 2009 17:22:27 +0930

John

I'm not sure I understand what you are saying but I'll have a crack.
You could define an indicator within the combination (opioid_id,
contact) and reshape using that.

. sort opioid_id contact
. by opioid_id contact: generate recno=_n
. reshape wide relevant_data_stubnames, i(opioid_id) j(recno)

Hope this helps.

Joseph

On Sun, Apr 12, 2009 at 3:16 PM, John Henshaw <[email protected]> wrote:
> I am studying monthly opioid use (opioid_id) and haelthcare use (contacts) in the community.
> My data is in long form but I wish to declare it as panel data and need to convert to wide form.
> I have a unique opioid_id but my contacts variables for each opioid_id are often not unique.
> Therefore i(opioid_id) j(contacts) is not unique and reshape wide fails
> Is there a solution to this?
>
> Thankyou John Henshaw (University of Tasmania)
> *
> *   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