tmle_extract: Extract TSM and ATE from a tmle object

Description Usage Arguments Value Examples

View source: R/extract.R

Description

Extract TSM and ATE from a tmle object

Usage

1
tmle_extract(fit, obs_a, obs_y)

Arguments

fit

a TMLE model from the tmle package

obs_a

A vector of the observed binary exposures

obs_y

A vector of the observed outcomes

Value

A list of class tmleExtract with elements tsm (the extract estimates) and IF a dataframe with the elements used to extract such estimates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(tmleExtract)
library(tmle)

set.seed(1)
n <- 250
W <- matrix(rnorm(n*3), ncol=3)
A <- rbinom(n,1, 1/(1+exp(-(.2*W[,1] - .1*W[,2] + .4*W[,3]))))
Y <- A + 2*W[,1] + W[,3] + W[,2]^2 + rnorm(n)
tmle_fit <- tmle(Y,A,W, Q.SL.library = "SL.glm", g.SL.library = "SL.glm")

tmle_extract(tmle_fit, A, Y)

nt-williams/tmleExtract documentation built on Feb. 28, 2020, 6:32 p.m.