Introduction

A precendence diagrams is a two-dimensional matrix showing the flows between activities. It can be contain different type values, by adjusting the type argument.

  • Absolute frequency of flows
  • Relative frequency of flows
  • Relative frequency of flows, for each antecendent
    • I.e. given antecendent A, it is followed x% of the time by Consequent B
  • Relative frequency of flows, for each consequent
    • I.e. given consequent B, it is preceded x% of the time by Antecedent A

The precedence diagrams can be visualized using the generic plot function. Below, an example of each of the different types is shown.

Examples

Absolute Frequencies

library(bupaR)
patients %>%
    precedence_matrix(type = "absolute") 
## # A tibble: 49 x 3
##    antecedent            consequent     n
##         <chr>                 <chr> <int>
##  1 Blood test            Blood test     9
##  2 Blood test             Check-out    12
##  3 Blood test       Discuss Results    51
##  4 Blood test              MRI SCAN    77
##  5 Blood test          Registration     6
##  6 Blood test Triage and Assessment    73
##  7 Blood test                 X-Ray     9
##  8  Check-out            Blood test     5
##  9  Check-out             Check-out   331
## 10  Check-out       Discuss Results    94
## # ... with 39 more rows
patients %>%
    precedence_matrix(type = "absolute") %>%
    plot

Relative Frequencies

patients %>%
    precedence_matrix(type = "relative") %>%
    plot

Antecedent-wise Frequencies

patients %>%
    precedence_matrix(type = "relative_antecedent") %>%
    plot

Consequent-wise Frequencies

patients %>%
    precedence_matrix(type = "relative_consequent") %>%
    plot