Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

RE: st: RE: Data management


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Data management
Date   Fri, 23 Jul 2010 17:37:49 +0100

Your information has changed, so the advice changes. 

If you just need the second encounter 

bysort ID (billid) : keep if _n == 2 

Nick 
n.j.cox@durham.ac.uk 

Dilip Pandey

Thanks for your suggestion. In this database a person can be
hospitalized 2 or more times. The first hospital encounter has final
bill information. The second hospital encounter has 2 interim bills
and 1 final bill. Please suggest stata code to collapse billing
information for second hospital encounter only . Procedure variables
are string for those bills.

On Fri, Jul 23, 2010 at 10:58 AM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> . help collapse

Dilip Pandey

> I am analyzing administrative database. There are multiple billing
> submitted for one event. I would like to create one record for each
> event. Please suggest how to collapse multiple billing records into
> one record per event for an individual.
>
> Example
>
> ID            billid       Amt($)                  bill from
>     bill thru                 proc1     proc2     proc3     proc4
> billtype
>
> 1              x1           345                         20050128
>       20050131             123         345
>             interim
>
> 1              x2           1000                       20050201
>      20050203             993         452         462
>        interim
>
> 1              x3           2000                       20050204
>      20050206             991
>                interim
>
> 1              x4           150                         20050207
>       20050210             414         416
>             Final
>
> Apparently the billing is for services rendered between 20050128 thru
> 20050210. Multiple bills/claims were submitted for one episode. I will
> highly appreciate suggestion for collapsing information from interim
> bills into the final one to create one record for an episode without
> loosing information from interim bill/claim.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index