# The proportional hazards model with random censoring
# for three binary explanatory variables x1,x2,x3 without intercept
# censoring time 30 and parameter values theta0=c(1,1,1)
Fx <- Fx_survival(~x1 + x2 + x3 - 1, c(1, 1, 1), 30, "phrand",
lower = c(0, 0, 0), upper = c(1, 1, 1), n.levels = c(2, 2, 2))
# The locally D-optimal approximate design
w <- od_REX(Fx, crit="D")$w.best
od_print(Fx, w, Fx)
if (FALSE) {
# The proportional hazards model with random censoring
# for explanatory variables x1,x2,x3 in the range [0,1] discretized into 11 points
# censoring time 30 and parameter values theta0=c(1,1,1)
Fx <- Fx_survival(~x1 + x2 + x3 - 1, c(1, 1, 1), 30, "phrand",
lower = c(0, 0, 0), upper = c(1, 1, 1), n.levels = c(11, 11, 11))
# The locally A-optimal exact design of size 50 without replications
w <- od_KL(Fx, 50, crit="A", bin=TRUE, t.max=5)$w.best
od_plot(Fx, w, Fx)
}
Run the code above in your browser using DataLab