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
Edgbaston
Birmingham
B15 2TT
UK
tel.: +44 (0)121 414 6766
fax.: +44 (0)121 414 7923
****************************************************
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Austin
Nichols
Sent: 26 April 2006 22:17
To: [email protected]
Subject: Re: st: using results of -sts list- (life tables)
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/
*
* 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/