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]

RE: st: Need Help with Datamanagement and Survival analysis


From   "Dudekula, Anwar" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Need Help with Datamanagement and Survival analysis
Date   Sun, 2 Dec 2012 06:27:26 +0000

Dear Prakash , 
When I use & ,I will still end up with a list like the following 
Pt Name  Date          Type of Encounter
--------------------------------------
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

The goal is to get two consecutive observations for each patient where the Type of encounter is Telephone and next observation id Inpatient.

Thank you,
Yours Sincerely,
Anwar

________________________________________
From: [email protected] [[email protected]] on behalf of Prakash Singh [[email protected]]
Sent: Sunday, December 02, 2012 1:03 AM
To: statalist
Subject: Re: st: Need Help with Datamanagement and Survival analysis

Dear Anwar, I think you just need to use & in place of | in your command.



Prakash

On Sun, Dec 2, 2012 at 11:11 AM, Dudekula, Anwar <[email protected]> wrote:
> Hi,
>
> 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 .
>
> Sincerely
> Anwar
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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