View source: R/rctglm_prog_methods.R
prog | R Documentation |
Extracts the prognostic_info
list element from an rctglm_prog
object. See
'Value' at rctglm_with_prognosticscore for more details.
prog(x)
## S3 method for class 'rctglm_prog'
prog(x)
x |
an object of class |
a list with the structure described of prognostic_info
in the
Value
section of rctglm_with_prognosticscore.
The generic rctglm_with_prognosticscore()
for which this method
works.
# Generate some data
n <- 100
b0 <- 1
b1 <- 1.5
b2 <- 2
W1 <- runif(n, min = -2, max = 2)
exposure_prob <- .5
dat_treat <- glm_data(
Y ~ b0+b1*abs(sin(W1))+b2*A,
W1 = W1,
A = rbinom(n, 1, exposure_prob)
)
dat_notreat <- glm_data(
Y ~ b0+b1*abs(sin(W1)),
W1 = W1
)
learners <- list(
mars = list(
model = parsnip::set_engine(
parsnip::mars(
mode = "regression", prod_degree = 3
),
"earth"
)
)
)
ate <- rctglm_with_prognosticscore(
formula = Y ~ .,
exposure_indicator = A,
exposure_prob = exposure_prob,
data = dat_treat,
family = gaussian(),
estimand_fun = "ate",
data_hist = dat_notreat,
learners = learners)
prog(ate)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.