View source: R/Genetic.optim.IWKMEIV.R
Genetic.optim.IWKMEIV | R Documentation |
Given a predetermined t0, estimate the optimal treatment regime by maximizing t0-year survival probability based on the (S)IWKMEIV estimator.
Genetic.optim.IWKMEIV(datalist, ps, t0, smooth = TRUE)
datalist |
A list used to calculate the (S)IWKMEIV estimator including instrument named z, treatment named |
ps |
A list including the probability of receiving instrument given baseline covariates named |
t0 |
A predetermined time. |
smooth |
A logic variable indicating wether a smoothed version should be used. |
More details can be found in references.
A numeric vector in which the last number is the estimated optimal t0-year survival probability and others are the estimated parameter of the optimal treatment regime.
Xia, J., Zhan, Z., Zhang, J. (2022) Estimating optimal treatment regime in survival contexts using an instrumental variable. Under Review.
# load data
data(simulation)
simulation=simulation[order(simulation$Survival),]
# convert the data into a datalist
datalist=list(z=simulation$Instrument,a=simulation$Treatment,
obs.t=simulation$Survival,delta=simulation$Status,
l=cbind(simulation$Covariate1,simulation$Covariate2))
# predetermined t0
t0=1
# calculate ps and prep
ps=Fps.IWKMEIV(datalist, t0)
Genetic.optim.IWKMEIV(datalist, ps, t0, smooth=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.