Description Usage Arguments Details Value See Also Examples
Given time to event data and a set of cuts return the survival estimator from maximum likelihood estimation in the piecewise constant hazard model
1 2 |
time |
the observed time data. |
status |
status of the time data. TRUE for true time and FALSE for censored time. |
cuts |
a sequence of cuts. Default to NULL which corresponds to the exponential model. |
seqtime |
a time sequence. |
CI |
should the confidence intervals be computed? Default to TRUE. |
alphaCI |
the value of alpha for 1-alpha confidence intervals. Default to 0.05. |
The survival estimator is computed from the maximum likelihood estimator in the piecewise constant hazard model. It is computed for each value of seqtime
.
surv | the estimated survival function | |
CIleft | the left confidence intervals of the survival function | |
CIright | the right confidence intervals of the survival function | |
Other pchsurv functions: arpchsurv
,
bootpchsurv
, mlepchsurv
,
rsurv
1 2 3 4 5 6 7 8 9 10 11 | n=400
cuts=c(20,40,50,70)
alpha=c(0,0.05,0.1,0.2,0.4)/10
time=rsurv(n,cuts,alpha) #generate true data from the pch model
censoring=runif(n,min=70,max=90)
time=pmin(time,censoring) #observed times
delta=time<censoring #gives 62% of observed data on average
seqtime=seq(0,100,by=10)
result=pchsurv(time,delta,cuts,seqtime)
result
plot(result,CI=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.