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   "David Winter" <>
To   <>
Subject   RE: st: using results of -sts list- (life tables)
Date   Fri, 28 Apr 2006 15:36:37 +0100

Thanks Austin - works a treat.  Just what I needed.

Mr David L. Winter, HNC
I.T. Manager (BCCSS Study)
Department of Public Health & Epidemiology
Room 105, Public Health Building
University of Birmingham
B15 2TT
tel.: +44 (0)121 414 6766
fax.: +44 (0)121 414 7923
-----Original Message-----
[] On Behalf Of Austin
Sent: 26 April 2006 22:17
Subject: Re: st: using results of -sts list- (life tables)

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
> or a push in the right direction would be most useful.

*   For searches and help try:

*   For searches and help try:

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