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: how to reshape data so that can perform calculations


From   Oliver Jones <[email protected]>
To   [email protected]
Subject   Re: st: how to reshape data so that can perform calculations
Date   Tue, 22 Mar 2011 17:05:30 +0100

Hi,
to keep all persons how where discharged more than once try:

sort Id
by Id: gen times_discharged = _N
drop if times_discharged > 1

Assuming you set your data as a panel (commands -xtset- or -tsset- will to it)
you could try to calculate the elapsed time by using the time-series operator
for the first difference:

by Id: gen elapsed_time = D.discharge_date

Best
Oliver
--
Universität Bielefeld
Fakultät für Wirtschaftswissenschaften
Lehrstuhl für Ökonometrie und Statistik
- - -
Bielefeld University
Faculty of Business Administration and Economics
Chair of Econometrics and Statistics
- - -
Raum / room:  V9-110
Tel / phone:  +49 (0)521 106 4871
--
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index