qd_todagitty: Identify variables for adjustment

View source: R/qd_todagitty.R

qd_todagittyR Documentation

Identify variables for adjustment

Description

Format an edgelist and send it to dagitty to identify variable adjustment sets.

Usage

qd_todagitty(
  edgelist,
  diagram_type = "dag",
  showplot = FALSE,
  send.global = FALSE,
  dagitty.obj.name = NULL,
  exposure,
  outcome,
  ...
)

Arguments

edgelist

A vector of edge relationships. Must be strictly organized (see example for format).

diagram_type

Character identifying the diagram type. Defaults to "dag", but user can specify another graph type (see dagitty documentation).

showplot

Logical indicating whether to produce a dagitty plot. Defaults to FALSE.

send.global

Logical indicating whether to make the dagitty object available in the global environment. Defaults to FALSE.

dagitty.obj.name

Character specifying the name of the dagitty object. Only used and required if send.global = TRUE.

exposure

Character. Specify exposure of interest. (Required)

outcome

Character. Specifiy outcome of interest. (Required)

...

Pass arguments to adjustmentSets(). See dagitty documentation for options.

Note

The exposure and outcome options map to dagitty functions of the same name.

Examples

edges <- c("A -> { B C D }",
           "B -> C",
           "E -> { B C }")

# must pass exposure and outcome arguments to dagitty::adjustmentSets()
qd_todagitty(edges, exposure = "A", outcome = "C")
qd_todagitty(edges, exposure = "A", outcome = "C", type = "minimal")


jrgant/quickDAG documentation built on Feb. 15, 2023, 3:20 a.m.