Skip to contents

Method for determining split points for continuous modifiers

Usage

splitpoints(object, var, round = NULL)

Arguments

object

An object of class dlmtree with DLM type hdlm & hdlmm

var

The name of a continuous variable for which the split points will be reported

round

The number of decimal places to round the variable (var) to. No rounding occurs if round=NULL (default) For positive integer values of round, the variable will be rounded and split points will be reported at the resulting level

Value

A data frame with split points and the probability that a split point was >= that split point value

Details

splitpoints

Examples

# \donttest{
# Split points with HDLM 
D <- sim.hdlmm(sim = "B", n = 1000)
fit <- dlmtree(y ~ ., 
               data = D$dat,
               exposure.data = D$exposures,
               dlm.type = "linear",
               family = "gaussian",
               het = TRUE)
#> Preparing data...
#> 
#> Running shared HDLM:
#> Burn-in % complete 
#> [0--------25--------50--------75--------100]
#>  ''''''''''''''''''''''''''''''''''''''''''
#> MCMC iterations (est time: 6 seconds)
#> [0--------25--------50--------75--------100]
#>  ''''''''''''''''''''''''''''''''''''''''''
#> Compiling results...
splitpoints(fit, var = "mod_num", round = 2)
#>    location  proportion
#> 1     -1.63 0.053915488
#> 2     -1.37 0.037873150
#> 3     -1.09 0.034151989
#> 4     -0.90 0.040602001
#> 5     -0.73 0.047961631
#> 6     -0.59 0.044157777
#> 7     -0.46 0.052840486
#> 8     -0.33 0.052592409
#> 9     -0.20 0.077069379
#> 10    -0.08 0.073430910
#> 11     0.03 0.127511784
#> 12     0.15 0.041759696
#> 13     0.26 0.050773175
#> 14     0.40 0.045894319
#> 15     0.55 0.042503928
#> 16     0.68 0.035475068
#> 17     0.88 0.036880840
#> 18     1.06 0.044323162
#> 19     1.31 0.055403953
#> 20     1.70 0.004878856
splitpoints(fit, var = "mod_scale", round = 2)
#>    location  proportion
#> 1      0.05 0.056461414
#> 2      0.10 0.041168726
#> 3      0.14 0.053676322
#> 4      0.18 0.037725339
#> 5      0.23 0.078438323
#> 6      0.29 0.035851732
#> 7      0.34 0.047245291
#> 8      0.38 0.056663966
#> 9      0.43 0.044207008
#> 10     0.48 0.059955439
#> 11     0.52 0.078438323
#> 12     0.57 0.037016407
#> 13     0.62 0.035142799
#> 14     0.67 0.034180677
#> 15     0.72 0.051701438
#> 16     0.76 0.045928702
#> 17     0.81 0.069120924
#> 18     0.85 0.061221390
#> 19     0.91 0.067905611
#> 20     0.96 0.007950172
# }