Learn R Programming

rld (version 1.0)

rld.fit: Discrete-Time Survival Model Fitting Function

Description

This is the function called by rld that do the actual computation.

Usage

rld.fit(X, C, delta, initial, lower, upper, frailty)

Arguments

X
a design matrix created based on the input formula.
C
a vector containing censoring times.
delta
a vector contatining censoring status in which"1" denotes failure, "0" denotes right-censoring.
initial
a vector containing initial values for the paramters to be optimized over.
lower
a vector containing lower bound values for the paramters to be optimized over.
upper
a vector containing upper bound values for the paramters to be optimized over.
frailty
logical value: If TRUE, a discrete-time survival model with random effects will be used.

Value

Details

optim is used to maximize the log-likelihood function. Method "L-BFGS-B" is that of Byrd et. al (1995) which allows box constraints, that is each variable can be given a lower and/or upper bound.

References

Kang, C., Huang, Y., and Miller, C. (2015). A discrete-time survival model with random effects for designing and analyzing repeated low-dose challenge experiments. Biostatistics, 16(2): 295-310.

Byrd, R.H., Lu, P. Nocedal, J. and Zhu, C. (1995). A limited memory algorithm for bound constrained optimization. SIAMJ. Scientific Computing, 16, 1190-1208.

See Also

rld, optim

Examples

Run this code
data(SampleData)
newdata <- transdata(data = SampleData, ndlevel = 3, nexposure = c(10, 10, 2))
formulaexp <- survival::Surv(time, delta)~factor(dose)+trt+I(I(dose==3)*trt)
designmat <- model.matrix(formulaexp, data = newdata)
time <- SampleData$time
status <- SampleData$delta
inival <- rep(0.5, 6)
lwrval <- c(rep(-Inf, 5), 0.01)
uprval <- rep(Inf, 6)
frailty <- TRUE

rld.fit(X = designmat, C = time, delta = status, initial = inival,
        lower = lwrval, upper = uprval, frailty = frailty)

Run the code above in your browser using DataLab