Obtain a hazard ratio (HR) from a WCE Cox proportional hazards model
This function calculates the hazard ratio (HR) from an estimated model in a WCE object to compare two scenarios of time-dependent exposures.
A WCE object.
A vector of time-dependent exposures corresponding to a scenario of interest (numerator of the HR).
A vector of time-dependent exposures corresponding to a scenario for the reference category (denominator of the HR).
Logical. If FALSE, prints the results using the best model from the WCE object, i.e. among the models fitted with the different numbers of interior knots requested by nknots, based on AIC or BIC as specified in the
vecdenom need to be of the same length as the weight function
cutof argument used in the call to WCE. The hazard ratio computed by
HR.WCE corresponds to the ratio of the weighted cumulative exposures for the scenario of interest (vecnum) and the reference scenario (vecdenom). It corresponds to equation (8) of Sylvestre and Abrahamowicz (2009).
Returns one or several hazard ratios. Inference may be obtained by bootstrap and has to be coded separately (please see
WCE for an example).
Sylvestre MP, Abrahamowicz M. Flexible modeling of the cumulative effects of time-dependent exposures on the hazard. Stat Med. 2009 Nov 30;28(27):3437-53.
1 2 3 4 5 6 7 8
wce <- WCE(drugdata, "Cox", 1, 90, constrained = "R", id = "Id", event = "Event", start = "Start", stop = "Stop", expos = "dose", covariates = c("age", "sex")) # Exposed at a dose of 1 (constant) vs. unexposed over the time window of 90 days scenario1 <- rep(1, 90) scenario2 <- rep(0, 90) HR.WCE(wce, vecnum = scenario1, vecdenom = scenario2)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.