Learn R Programming

nph (version 2.1)

rSurv_conditional_fun: Draw conditional random survival times from mixpch object.

Description

Draws independent random survival times from mixpch objects conditional on observed time.

Usage

rSurv_conditional_fun(x, y)

Arguments

x

An object of class mixpch

y

A vector of observed right censored times

Value

A vector of random survival times, conditional on the observed censored times.

Details

Note that the mixpch object stores the survival function up to some time T. For random times equal or larger T, the value T is returned.

References

Robin Ristl, Nicolas Ballarini, Heiko G<U+00F6>tte, Armin Sch<U+00FC>ler, Martin Posch, Franz K<U+00F6>nig. Delayed treatment effects, treatment switching and heterogeneous patient populations: How to design and analyze RCTs in oncology. Pharmaceutical statistics. 2021; 20(1):129-145.

See Also

rSurv_fun, sample_fun, sample_conditional_fun

Examples

Run this code
# NOT RUN {
A <- pop_pchaz(Tint = c(0, 90, 1500),
  lambdaMat1 = matrix(c(0.2, 0.1, 0.4, 0.1), 2, 2) / 365,
 lambdaMat2 = matrix(c(0.5, 0.2, 0.6, 0.2), 2, 2) / 365,
 lambdaProg = matrix(c(0.5, 0.5, 0.4, 0.4), 2, 2) / 365,
 p = c(0.8, 0.2), 
 timezero = FALSE, discrete_approximation = TRUE)
rSurv_conditional_fun(x = A, y = c(10,15,9,2,1))
# }

Run the code above in your browser using DataLab