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]

st: reshape without index


From   Caleb Southworth <caleb.southworth@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: reshape without index
Date   Tue, 14 Jun 2011 12:47:09 -0700

I would like to set up these data for a an event history analysis and
use the -stset- command. Id is the organization id, begin is the begin
date, end is the end date. Here's a snippet:


    +-----------------------------+
    |    id      begin        end |
    |-----------------------------|
600. | 6119A   1947.716   1958.862 |
601. | 3158A   1948.269   1960.003 |
602. | 3216A   1948.504   1950.537 |
603. | 3192A   1948.558    1962.77 |
604. | 3119A   1949.483       1985 |
    |-----------------------------|
605. | 3189A   1950.333   1959.403 |
606. | 9841A   1952.088       1985 |
607. | 9973A   1953.908   1954.176 |
608. | 3181A   1957.574    1958.74 |
609. | 3011A   1958.772   1971.583 |
    |-----------------------------|
610. | 9951A   1958.789       1985 |

I want to end up with a dataset where year (decimal year) is the unit
of analysis and where a variable death=1 where year==end else death=0.
Do I need to reshape these data? Or is there a way to stset the data
for a stcox model in the current format?

Many thanks. --Caleb

*
*   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