Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: RE: p-values for K-M point survival estimates using sts list

 From Allen Buxton To "'statalist@hsphsun2.harvard.edu'" Subject st: RE: p-values for K-M point survival estimates using sts list Date Wed, 25 Aug 2010 11:39:04 -0700

```I have used a z-test for two samples with known mean and std deviation to match the output of a program called Epilog. This is to state that the KM estimate is the mean and the associated standard error are known. The confidence intervals are better.

Here is the form:

capture program drop epiwald
program define epiwald
version 9.2
args m1 s1 m2 s2
local d = abs(`m2' - `m1')
local s = sqrt(`s1'^2 + `s2'^2)
local z = `d'/`s'
local p = 2*(1-norm(`z'))
local p1 = 1*(1-norm(`z'))
foreach Xval in m1 s1 m2 s2 d s z p p1 {
local txt = `"``Xval''"'
local `Xval'=string(`txt',"%6.4f")
}
di `"mu1=`m1', mu2=`m2', std1=`s1', std2=`s2'"'
di `"difference=`d', std=`s'"'
di `"z-value=`z'"'
di `"p-value=`p'"'
di `"p-1side=`p1'"'
di `""'
end

*example
. epiwald 0.5833   0.1423  0.1538   0.1001
mu1=0.5833, mu2=0.1538, std1=0.1423, std2=0.1001
difference=0.4295, std=0.1740
z-value=2.4687
p-value=0.0136
p-1side=0.0068

-Allen Buxton

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Bell, Cynthia
Sent: Wednesday, August 25, 2010 8:42 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: p-values for K-M point survival estimates using sts list

The "sts list" command provides point estimates, std errors, and confidence intervals at exact times during my observation period. I prefer confidence intervals to compare, say, 10-year survival estimates between groups but a journal requested p-values comparing group point estimates at specific time points. Is this possible in Stata? If not, it shouldn't be complicated to compute a p-value given a distribution for the K-M survival point estimate and the standard error, right?

Thanks very much,

Cynthia Bell
Division of Pediatric Nephrology and Hypertension
University of Texas-Houston, Medical School

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```