Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: graph piecewise constant baseline hazard


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: graph piecewise constant baseline hazard
Date   Mon, 17 Mar 2008 19:35:24 +0000 (GMT)

--- Chiara Mussida <[email protected]> wrote:
> but it is a little confusing: my model is a piecewise constant,
> estimated with the commsnad stpiece, but the example below shows a
> streg ans stsplit...

-stpiece- does the same thing as I did in my example, however in order
to predict you need to make sure that the restructuring of the data,
and the new variables -stpiece- makes while estimating the model remain
in memory when the command finishes. You can do that with the
-nopreserve- option.

*-------------- begin example ----------------
sysuse cancer, clear
sum age
replace age = age-r(mean)
gen id = _n
stset studytim, failure(died) id(id)
xi: stpiece i.drug age, tp(5 10 20) nopreserve
adjust _Idrug_2=0 _Idrug_3=0 age=0, gen(xb)
gen haz = exp(xb)

twoway line haz _t0, c(J) sort
*--------------- end example ------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________ 
Rise to the challenge for Sport Relief with Yahoo! For Good  

http://uk.promotions.yahoo.com/forgood/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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