Skip to contents

The causal truth is a property of the data-generating machine, not of any one (confounded) data set. To read it off we turn confounding off – randomise treatment (rand = TRUE) – and run the trial at a large n so sampling noise vanishes. Fitting the joint Cox model on that randomised cohort gives the always-treat-vs-never-treat hazard ratio, exp(b_drug1 + b_drug2).

Usage

oracle_hr(n = 6e+05, seed = 9, ...)

Arguments

n

Oracle sample size. Large by default so the truth is a precise number.

seed

Random seed.

...

Further arguments passed to simulate_hr_agent() (e.g. b_drug).

Value

A single numeric hazard ratio.

Details

This is the dashed reference line every method on the forest plot is judged against. You could never read it off the confounded analysis set – that is the whole point of the lesson.

Examples

# \donttest{
oracle_hr(n = 5e4)
#> [1] 0.3362326
# }