solvear.pchsurv: Penalized maximum likelihood estimation from the piecewise...

Description Usage Arguments Examples

View source: R/solvear.pchsurv.R

Description

Given time to event data, a set of cuts and a penalty value, returns the penalized maximum likelihood estimator of the log-hazard using the adaptive-ridge penalty. The penalty is iteratively updated until convergence of the algorithm.

Usage

1
2
3
solvear.pchsurv(time, status, cuts, w = rep(1, length(cuts)), pen = 2,
  a = NULL, J = NULL, tol = 1e-07, itermax = 50, weights = rep(1,
  length(time)))

Arguments

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.

pen

the penalty value

a

the log-hazard value at the initialization step. Default to the unpenalized log-hazard estimator.

tol

the tolerance parameter for convergence of the algorithm. Default to 1e-7.

itermax

the maximum number of iterations. If the algorithm has not converged before itermax iterations then the algorithm exits the program.

weights

the weight values at the initialization step. Default to 1.

weights

an optional weight sequence. Default to 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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
result1=solvear.pchsurv(time,delta,cuts,pen=2)
result2=solvear.pchsurv(time,delta,cuts,pen=0)
result3=mlepchsurv(time,delta,cuts) #compare exp(result2) with exp(result3$a)!

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