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

patients %>%
    precedence_matrix(type = "absolute") 
## # A tibble: 13 x 3
##    antecedent            consequent                n
##    <fct>                 <fct>                 <int>
##  1 Triage and Assessment End                       2
##  2 Blood test            End                       1
##  3 Start                 Registration            500
##  4 Registration          Triage and Assessment   500
##  5 MRI SCAN              Discuss Results         236
##  6 Triage and Assessment Blood test              237
##  7 Blood test            MRI SCAN                236
##  8 Discuss Results       Check-out               492
##  9 X-Ray                 End                       2
## 10 Check-out             End                     491
## 11 X-Ray                 Discuss Results         259
## 12 Triage and Assessment X-Ray                   261
## 13 Discuss Results       End                       3
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