Description Usage Arguments Examples
View source: R/solvear.pchsurv.R
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.
1 2 3 |
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. |
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)!
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.