Skip to contents

This is an accessor to the edges slot in a multimedia object. It is the internal representation of the variable conditional dependence graph encoded by the mediation model's DAG.

Usage

# S4 method for class 'multimedia'
edges(object)

Arguments

object

An object of class multimedia.

Value

A data.frame whose rows give edges in the mediation analysis DAG.

Examples

exper <- demo_joy() |>
    mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper) |>
    edges()
#> # A tbl_graph: 8 nodes and 17 edges
#> #
#> # A directed acyclic simple graph with 1 component
#> #
#> # Node Data: 8 × 3 (active)
#>   name      node_type    id
#>   <chr>     <fct>     <int>
#> 1 1         intercept     1
#> 2 treatment treatment     2
#> 3 ASV1      mediator      3
#> 4 ASV2      mediator      4
#> 5 ASV3      mediator      5
#> 6 ASV4      mediator      6
#> 7 ASV5      mediator      7
#> 8 PHQ       outcome       8
#> #
#> # Edge Data: 17 × 3
#>    from    to state 
#>   <int> <int> <chr> 
#> 1     1     3 active
#> 2     1     4 active
#> 3     1     5 active
#> # ℹ 14 more rows