Targeted Inference in R: targeted (original) (raw)
Various methods for targeted and semiparametric inference including augmented inverse probability weighted estimators for missing data and causal inference (Bang and Robins (2005) <10.1111/j.1541-0420.2005.00377.x>) and estimators for risk differences and relative risks (Richardson et al. (2017) <10.1080/01621459.2016.1192546>).
Installation
You can install the released version of targeted from CRAN with:
And the development version from GitHub with:
Examples
Targeted risk regression
Simulate some data:
m <- lvm() %>%
regression(a ~ x+z) %>%
regression(lp.target ~ 1) %>%
regression(lp.nuisance ~ x + z) %>%
distribution('a', binomial.lvm("logit")) %>%
binomial.rr('y', 'a', 'lp.target', 'lp.nuisance')
par <- c('a'=-2, 'lp.target'=1, 'lp.nuisance'=-1, 'lp.nuisance~x'=2)
d <- lava::sim(m, n=1e4, seed=1, p=par) %>%
subset(select=c('y', 'a','x','z'))
head(d)
#> y a x z
#> 1 0 0 -0.6264538 -0.8043316
#> 2 0 0 0.1836433 -1.0565257
#> 3 0 0 -0.8356286 -1.0353958
#> 4 0 0 1.5952808 -1.1855604
#> 5 1 0 0.3295078 -0.5004395
#> 6 0 0 -0.8204684 -0.5249887
Here the same design matrix is used for both the propensity model and the nuisance parameter (odds-product) model
Double-robustness illustrated by using a wrong propensity model but a correct nuisance paramter (odds-product) model:
Or vice-versa
Whereas the MLE yields a biased estimate of the relative risk:
To obtain an estimate of the risk-difference (here wrong model) we simply chance the type
argument
Interactions with the exposure can be examined with the target
argument