Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Karen Rappaport <karenmrappaport@yahoo.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: reshape command without a j( ) variable using Stata 8 |
Date | Mon, 14 Feb 2011 21:20:17 -0800 (PST) |
Not every patient is observed more than once, but some are. Some patients might be observed more than 2 times. It depends on the number of medications they are taking, but all are taking at least one. Karen ________________________________ From: Justina Fischer <JAVFischer@gmx.de> To: statalist@hsphsun2.harvard.edu Sent: Mon, February 14, 2011 6:59:13 PM Subject: Re: st: reshape command without a j( ) variable using Stata 8 HI are you sure you have a panel ? Is each patient observed > once ? Justina -------- Original-Nachricht -------- > Datum: Mon, 14 Feb 2011 17:47:08 -0800 (PST) > Von: Karen Rappaport <karenmrappaport@yahoo.com> > An: statalist@hsphsun2.harvard.edu > Betreff: st: reshape command without a j( ) variable using Stata 8 > I have a data set that I want to reshape from long to wide using Stata 8. > It > contains 2748 unique respondent sequence numbers and a total of 3191 > observations. It is a data set of patients and medications they take. > Some > patients take two medications. > Here are the variables: > seqn (unique patient number; numeric) > medID (medication ID number; string) > medic (medication name; string) > days90 (number of days medication taken in last 90 days; numeric) > days30 (number of days medication taken in last 30 days; numeric) > quant (quantity of medication taken daily) > serving (label serving size; double) > reason (reason for taking medication; double) > > At first, I thought this would be a straight forward case of reshaping > "long to > wide" with more than one variable. > > reshape wide medID medic days90 days30 quant serving reason , i(seqn) j( > ??? ) > > Essentially, all variables are shaped long to wide so that I have only > one set > of observations per patient or "seqn". (Is this essentially correct?) But > what > do I put in the j( ) position? > > Thank you! > Karen > > > > > * > * 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/ -- Justina AV Fischer, PhD Senior Researcher Faculty of Economics University of Mannheim homepage: http://www.justinaavfischer.de/ e-mail: javfischer@gmx.de papers: http://ideas.repec.org/e/pfi55.html * * 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/