Statalist


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

Re: st: Re: creating number of days per month


From   Rajaram Subramanian Potty <rajara999@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: creating number of days per month
Date   Fri, 6 Nov 2009 10:01:25 +0530

When I delete the observations with the same date of admission and
discharge the programme send by Kit Baum worked.

The syntax send by Nick is also working perfectly with the original data.

Thanks a lot for all for solving the problem.


RAJA
On Thu, Nov 5, 2009 at 5:17 PM, Kit Baum <baum@bc.edu> wrote:
> <.>
> Here is the relevant chunk of code:
>
> gen date1=date(var1, "DMY")
> gen date2=date(var2, "DMY")
> drop var1 var2
> g patientid = _n
> reshape long date, i(patientid)
> duplicates list patientid date
> duplicates drop patientid date, force
> tsset patientid date
>
> On Nov 5, 2009, at 2:33 AM, Raja wrote:
>
>> When I run with my original data, I get the following error after the
>> tsset command.
>>
>> tsset patientid date
>> repeated time values within panel
>>
>> This may be due to the fact that, some patients may be discharged on
>> the same day of admission.
>>
>> How to resolve this issue, if the patient is discharged on the same
>> day as admission.
>
>
> Kit Baum   |   Boston College Economics & DIW Berlin   |
> http://ideas.repec.org/e/pba1.html
>                              An Introduction to Stata Programming  |
> http://www.stata-press.com/books/isp.html
>   An Introduction to Modern Econometrics Using Stata  |
> http://www.stata-press.com/books/imeus.html
>
> *
> *   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/
>

*
*   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   |   What's new   |   Site index