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/