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 15:00:33 +0100

Indeed; although I didn't say what you would do with the variable so
calculated; what you do with it, or whether it's the information you
need, would entail an assumption about what you want.


Nick
[email protected]


On 24 September 2013 14:49, Richard Goldstein <[email protected]> wrote:
> note that there is an ambiguity in the question and that Nick's answer
> makes an assumption about that ambiguity: what if the third observation
> is not within 30 days of the first discharge but is within 30 days of
> the second discharge (and the second admission is within 30 days of the
> first discharge?
>
> Rich
>
> On 9/24/13 9:35 AM, Nick Cox wrote:
>> 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