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

st: Re: creating number of days per month

From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: Re: creating number of days per month
Date   Thu, 5 Nov 2009 06:47:10 -0500

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   |
An Introduction to Stata Programming |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index