print.txshift_msm: Print Method for Marginal Structural Models

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Print Method for Marginal Structural Models

Usage

1
2
## S3 method for class 'txshift_msm'
print(x, ...)

Arguments

x

An object of class txshift_msm.

...

Other options (not currently used).

Details

The print method for objects of class txshift_msm.

Value

None. Called for the side effect of printing an informative summary of slots of objects of class txshift_msm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
if (require("sl3")) {
  set.seed(3287)
  n_obs <- 1000
  W <- as.numeric(replicate(1, rbinom(n_obs, 1, 0.5)))
  A <- as.numeric(rnorm(n_obs, mean = 2 * W, sd = 1))
  Y <- rbinom(n_obs, 1, plogis(2 * A - W))
  msm <- msm_vimshift(
    W = W, A = A, Y = Y, estimator = "tmle",
    g_exp_fit_args = list(
      fit_type = "sl",
      sl_learners_density = Lrnr_density_hse$new(Lrnr_glm$new())
    ),
    Q_fit_args = list(
      fit_type = "glm",
      glm_formula = "Y ~ ."
    ),
    delta_grid = seq(-1, 1, 0.25)
  )
  print(msm)
}

txshift documentation built on Feb. 11, 2022, 1:08 a.m.