mlepchsurv: Maximum likelihood estimation from the piecewise constant...

Description Usage Arguments Details Value See Also Examples

View source: R/mlepchsurv.R

Description

Given time to event data and a set of cuts return the maximum likelihood estimator of the log-hazard from the piecewise constant hazard model.

Usage

1
2
mlepchsurv(time, status, cuts = NULL, weights = NULL, CI = TRUE,
  alphaCI = 0.05, logtransf = TRUE)

Arguments

time

observed time data.

status

status of the time data. TRUE for true time and FALSE for censored time.

cuts

the sequence of cuts. Default to NULL which corresponds to the exponential model.

weights

an optional weight sequence. Default to NULL.

CI

should the confidence intervals be computed? Default to TRUE.

alphaCI

the value of alpha for 1-alpha confidence intervals. Default to 0.05.

logtransf

should the confidence intervals be computed using the log-transformtation? Default to TRUE.

Details

The maximum likelihood estimator is computed from the two exhaustive statistics O_k=sum_i Delta_i 1(c_(k-1)<T_i<=c_k) and R_k=sum_i (min(c_k,T_i)-c_(k-1)) 1(T_i>=c_(k-1)). It is equal to O_k/R_k on each cut (c_(k-1),c_k]. They are called A and B in what follows.

Value

a the estimated log-hazard
hazard the estimated hazard
A the number of observed events between each cut
B the total time at risk between each cut
CIleft the left confidence intervals
CIright the right confidence intervals

See Also

Other pchsurv functions: arpchsurv, bootpchsurv, pchsurv, rsurv

Examples

1
2
3
4
5
6
7
8
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
mlepchsurv(time,delta,cuts)

obouaziz/pchsurv documentation built on Sept. 7, 2020, 11:03 a.m.