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: comparing between observations


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: comparing between observations
Date   Tue, 24 Sep 2013 14:35:46 +0100

Check out -panelthin- from SSC. Alternatively, the time since the
previous discharge is just

gen lapse = admdt - dischdt[_n-1]

making sure that you omit all the non-COPD admissions, or equivalently
-sort- them aside.

You describe your data as if you have just one patient, which seems
unlikely, but the previous statement can be generalised by something
like

bysort patientid (admdt) : gen lapse = ...


Nick
[email protected]


On 24 September 2013 14:17,  <[email protected]> wrote:
> I have a large dataset in which I have to identify and index admission to the hospital for copd.  I have created a variable that codes for hospital admission and admission for copd, copdadmit, where 1 equals yes.  The other part of index admission is that the encounter to the hospital cannot be within a 30day window of discharge any other admission for copd.  For example, if patient A has a COPD admission on feb 1to feb 5 and then again is admitted for COPD on feb 15, since feb 15 is within 30days of discharge date of feb 5, this second admission should not be considered an index admission.  I ranked all of the copd admits and I have admission and discharge dates.  How do I identify the copd admits that should not be considered index admits? Also it might be that the second and third ranked observations also fall within 30days of the discharge date from the first.
>
> My variables and example
> Copdadmit, admdt, dischdt, obsrank
> 1, 02feb2006, 04feb2006, 1
> 1, 22feb2006,  23feb2006, 2
> 1, 27feb2006, 28feb2006, 3
> 1, 04may2006, 08may2006, 4
>
> Thanks!
> Tina
>
>
> *
> *   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