Description Usage Arguments Details Examples

Get or set variables with a given status in a graph. Variables in dagitty graphs can
have one of several statuses. Variables with status *exposure* and
*outcome* are important when determining causal effects via the functions
`adjustmentSets`

and `instrumentalVariables`

. Variables
with status *latent* are assumed
to be unobserved variables or latent constructs, which is respected when deriving
testable implications of a graph via the functions
`impliedConditionalIndependencies`

or `vanishingTetrads`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
exposures(x)
exposures(x) <- value
outcomes(x)
outcomes(x) <- value
latents(x)
latents(x) <- value
adjustedNodes(x)
adjustedNodes(x) <- value
setVariableStatus(x, status, value)
``` |

`x` |
the input graph, of any type. |

`value` |
character vector; names of variables to receive the given status. |

`status` |
character, one of "exposure", "outcome" or "latent". |

`setVariableStatus`

first removes the given status from all variables in the graph
that had it, and then sets it on the given variables.
For instance, if `status="exposure"`

and `value="X"`

are given, then
`X`

will be the only exposure in the resulting graph.

1 2 3 4 | ```
g <- dagitty("dag{ x<->m<->y<-x }") # m-bias graph
exposures(g) <- "x"
outcomes(g) <- "y"
adjustmentSets(g)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.