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 on April 23, and its replacement, statalist.org is already up and running.


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

st: Puzzling wrong result with stptime compared to strate under special circumstances


From   "Jesper Lindhardsen" <JESLIN01@geh.regionh.dk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Puzzling wrong result with stptime compared to strate under special circumstances
Date   Fri, 7 Oct 2011 16:10:04 +0200

Hi All,

This may be obvious, but I cannot get my head around this problem, which
I ran into in the cause of some datamanipulation that required -stset-
twice.
Specifically, using the Stata generated underscore variables for the
second -stset- with the -origin- option gave different eventrates
depending on whether -strate- or -stptime- was used.
I find that -strate- and -stptime- give identical estimates before the
new stset, while -stptime- gives a wrong estimate after.
Please see example code with use of catheter.dta
(http://www.stata-press.com/data/r9/catheter.dta)

I am using an fully updated 11.2 on a Windowx XP box



Code begin:

sysuse catheter,clear
stset time,f(infect) id(patient) enter(time 10)
strate
stptime
stset _t,f(_d) id(patient) origin(time 10)
strate
stptime
g risk=_t-_t0
tabstat risk,s(sum)

Code End:

Any thoughts ???
BW,

Jesper

Jesper Lindhardsen
MD, PhD candidate
Department of Cardiovascular Research
Copenhagen University Hospital, Gentofte
Denmark


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