If { h0 } or { H0 } are not specified, they assume the default values of h0(x) = 1 and H0(x) = x, respectively.
The survival distribution function is given by,
S(x) = exp(-H0(x)),
where H0(x) is the cumulative hazard function. Only one of h0 or H0 can be specified, if h0 is given, then H0(x) = integrate(h0, 0, x, subdivisions = 500L)
To calculate the restricted mean survival time for Weibull distribution with
H = function(x) x^2
h = function(x) 2*x
use
rmst(tua, h0 = h)
or
rmst(tua, H0 = H)
when both h0 and H0 are provided, only h0 will be used and H0 will be ignored.
To generate Cox PH survival time, use
u = exp(-H(t)*exp(lp))
then, -log(u)*exp(-lp) = H(t). Find t such that H(t) = -log(u)exp(-lp).