Bookmark and Share

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

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

st: Need Help with Datamanagement and Survival analysis

From   "Dudekula, Anwar" <>
To   "" <>
Subject   st: Need Help with Datamanagement and Survival analysis
Date   Sun, 2 Dec 2012 05:41:22 +0000


I need help with stata code 

In the following dataset : 

Telephone : Is a phone call made by the patient.
Office Visit: is a clinicl visit 
Inpatient: is admission to hospital 

I am trying to find a set of patients in whom a Telephone(Type of Encounter)is followed by Inpatient(Type of Encounter) without any interspread Office Visit 

My stata code was keep if (Type of Encounter=="Telephone"|Type of Encounter=="Inpatient") but I got lot of observations with successive telephone calls followed by inpatien. 

I only want to see only those observations if a telephone is followed by Inpatient(event) or only telephone(censored) ; Is there  a stata code for it .

In next step, is there any stata macro to convert that to survival dataset format if failure= havig inpatient admission after telephone call in observed timeperiod(year 2011)

Pt Name	 Date	      Type of Encounter
pt x	4-Apr-11	Office Visit
pt x	20-May-11	Telephone
pt x	12-Jun-11	Inpatient
pt x	15-Jun-11	Office Visit
pt x	8-Aug-11	Inpatient
pt y	12-Jul-11	Telephone
pt y	13-Jul-11	Telephone
pt y	14-Jul-11	Telephone
pt y	15-Jul-11	Telephone
pt y	16-Jul-11	Telephone
pt y	17-Jul-11	Telephone
pt y	19-Jul-11	Inpatient
pt y	4-Aug-11	Office Visit
pt y	4-Sep-11	Telephone

I would really appreciate the help .
Thank you .


*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index