Statalist The Stata Listserver


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

Re: st: using results of -sts list- (life tables)


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: using results of -sts list- (life tables)
Date   Wed, 26 Apr 2006 17:16:56 -0400

Dave--
I'm not sure why you want variables with Beg.Total and Fail in them,
since the note that -sts list- puts at the bottom of the table says
"Survivor function is calculated over full data and evaluated at
indicated times; it is not calculated from aggregates shown at left."

That said, try out a variation on this:

clear
set obs 100
set seed 1234
gen id=_n
expand 10
bys id: gen t=_n
bys id (t): gen failtime=uniform()*10 if _n==1
bys id (t): replace f=f[_n-1] if mi(f)
gen fail=failtime<t

stset t, fail(fail)
sts list, at(0(1)10)
sts gen s=s
sts gen se=se(s)
sts gen lb=lb(s)
sts gen ub=ub(s)
collapse fail s se lb ub, by(t)
li in 1/10, noo

Am I close?
--Austin

On 4/26/06, David Winter <[email protected]> wrote:
> I was asked if it was possible to store the resulting values from this
> revised life table as variables, i.e. Time, Beg. Total, Fail, Survivor
> function, Std. Error and 95% Confidence intervals.  I was not sure of
> the answer.  Can -sts generate- provide what I want?  A working example
> or a push in the right direction would be most useful.

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