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" <>
Subject   Re: st: using results of -sts list- (life tables)
Date   Wed, 26 Apr 2006 17:16:56 -0400

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:

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?

On 4/26/06, David Winter <> 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:

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