Produce CHAID results tables from a partykit CHAID model

chaid_table(chaidobject)

Arguments

chaidobject

An object of type `constparty` or `party` which was produced by `CHAID::chaid` see simple example below.

Value

A tibble containing the results.

Author

Chuck Powell

Examples

library(CGPfunctions) chaid_table(chaidUS)
#> # A tibble: 9 x 15 #> nodeID parent NodeN Gore Bush ruletext split.variable chisq df adjustedp #> <int> <int> <dbl> <int> <int> <chr> <chr> <dbl> <int> <dbl> #> 1 1 NA 961 495 466 NA marstat 32.3 1 9.03e-8 #> 2 2 1 560 245 315 marstat… educr 12.9 1 1.33e-3 #> 3 3 2 311 157 154 marstat… NA NA NA NA #> 4 4 2 249 88 161 marstat… NA NA NA NA #> 5 5 1 401 250 151 marstat… gender 11.5 1 6.79e-4 #> 6 6 5 159 83 76 marstat… NA NA NA NA #> 7 7 5 242 167 75 marstat… ager 10.0 1 7.84e-3 #> 8 8 7 127 99 28 marstat… NA NA NA NA #> 9 9 7 115 68 47 marstat… NA NA NA NA #> # … with 5 more variables: rawpvalue <dbl>, splitrule <chr>, split1 <chr>, #> # split2 <chr>, split3 <chr>