get_point_estimate.Rd
This function only estimates the marginal logHR. For a complete estimation including the standard error, see get_marginal_effect.
get_point_estimate(
trt,
cox_event,
cox_censor,
data,
M = 1000,
seed = NULL,
cpp = TRUE,
control = clmqControl(),
verbose = TRUE
)
Character. Variable name of the treatment assignment. Only support two arm trial at the moment.
Object. A coxph model using the survival time and survival status.
Object. A coxph model using the survival time and 1-survival status.
A data frame used for cox_event and cox_censor.
Numeric. The number of simulated counterfactual patients. Suggest to set a large M to get robust estimation but this will be time comsuming.
Numeric. Random seed for simulation.
Bool. True for using C++ optimization. False for not using C++ optimization. This requires cpp package installed.
Named list. A list containing control parameters, including memory of remote workers, whether to use nested parallel computation or local multiprocess, number of remote workers/jobs, etc. See details of clmqControl.
Bool. Print status messages. Default: TRUE
The marginal beta (logHR)
Use the simulation approach from Daniel et al. (2020) to estimate the marginal HR when adjusting covariates. This function uses the parallel computation via remote LSF and local multiprocess. Additional feature also includes the C++ optimization that can speed up the calculation.
Daniel R, Zhang J, Farewell D. Making apples from oranges: Comparing noncollapsible effect estimators and their standard errors after adjustment for different covariate sets. Biom J. 2021;63(3):528-557. doi:10.1002/bimj.201900297
library(survival)
data("oak")
cox_event <- coxph(Surv(OS, os.status) ~ trt + btmb + pdl1, data = oak)
#
cox_censor <- coxph(Surv(OS, 1 - os.status) ~ trt + btmb + pdl1, data = oak)
#
get_point_estimate(
trt = "trt", cox_event = cox_event, cox_censor, M = 1000, data = oak,
seed = 1, cpp = FALSE, control = clmqControl(clmq_hr=FALSE)
)
#> [1] -0.4642906