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]

st: Duplicate rows in long dataset


From   Michele Santacatterina <[email protected]>
To   [email protected]
Subject   st: Duplicate rows in long dataset
Date   Wed, 6 Jun 2012 21:38:16 +0200

Hello Statalisters,

I have a dataset in this form:

ID	Date mutation	Mutation	treatstart	treatstop
26	15-Jul-99	A71T	3-Oct-96	17-Mar-97
26	15-Jul-99	I93L	10-Mar-00	23-Mar-00
26	15-Jul-99	K101E	2-Apr-03	16-Apr-03
26	15-Jul-99	M184V	25-May-03	12-Jun-09
26	2-Sep-99	A71T	25-Sep-03	13-Oct-03
26	2-Sep-99	I93L	 	=20

so i have different mutation (several at the same time) and different =
treatment regiment for each patient. I would like to make the dataset in =
this way:

ID	Date mutation	Mutation	treatstart	treatstop
26	15-Jul-99	A71T	3-Oct-96	17-Mar-97
26	15-Jul-99	A71T	10-Mar-00	23-Mar-00
26	15-Jul-99	A71T	2-Apr-03	16-Apr-03
26	15-Jul-99	A71T	25-May-03	12-Jun-09
26	15-Jul-99	A71T	25-Sep-03	13-Oct-03
26	15-Jul-99	I93L	3-Oct-96	17-Mar-97
26	15-Jul-99	I93L	10-Mar-00	23-Mar-00
26	15-Jul-99	I93L	2-Apr-03	16-Apr-03
26	15-Jul-99	I93L	25-May-03	12-Jun-09
26	15-Jul-99	I93L	25-Sep-03	13-Oct-03
26	15-Jul-99	K101E	3-Oct-96	17-Mar-97
26	15-Jul-99	K101E	10-Mar-00	23-Mar-00
26	15-Jul-99	K101E	2-Apr-03	16-Apr-03
26	15-Jul-99	K101E	25-May-03	12-Jun-09
26	15-Jul-99	K101E	25-Sep-03	13-Oct-03
26	15-Jul-99	M184V	3-Oct-96	17-Mar-97
26	15-Jul-99	M184V	10-Mar-00	23-Mar-00
26	15-Jul-99	M184V	2-Apr-03	16-Apr-03
26	15-Jul-99	M184V	25-May-03	12-Jun-09
26	15-Jul-99	M184V	25-Sep-03	13-Oct-03
26	2-Sep-99	A71T	3-Oct-96	17-Mar-97
26	2-Sep-99	A71T	10-Mar-00	23-Mar-00
26	2-Sep-99	A71T	2-Apr-03	16-Apr-03
26	2-Sep-99	A71T	25-May-03	12-Jun-09
26	2-Sep-99	A71T	25-Sep-03	13-Oct-03
26	2-Sep-99	I93L	3-Oct-96	17-Mar-97
26	2-Sep-99	I93L	10-Mar-00	23-Mar-00
26	2-Sep-99	I93L	2-Apr-03	16-Apr-03
26	2-Sep-99	I93L	25-May-03	12-Jun-09
26	2-Sep-99	I93L	25-Sep-03	13-Oct-03

so i have to repeat for each date of mutation all the date of start and =
stop of treatment.=20

how can i do it? Any idea?

Thank you so much.


MS
*
*   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