Method for determining split points for continuous modifiers
Arguments
- object
An object of class '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
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.055344318
#> 2 -1.37 0.035487959
#> 3 -1.09 0.029573300
#> 4 -0.90 0.038867765
#> 5 -0.73 0.049007182
#> 6 -0.59 0.046049852
#> 7 -0.46 0.051119561
#> 8 -0.33 0.054921842
#> 9 -0.20 0.076890579
#> 10 -0.08 0.073933249
#> 11 0.03 0.130544994
#> 12 0.15 0.040135192
#> 13 0.26 0.052809463
#> 14 0.40 0.046472328
#> 15 0.55 0.040980144
#> 16 0.68 0.032953105
#> 17 0.88 0.038867765
#> 18 1.06 0.043092522
#> 19 1.31 0.057456696
#> 20 1.70 0.005492184
splitpoints(fit, var = "mod_scale", round = 2)
#> location proportion
#> 1 0.05 0.057546694
#> 2 0.10 0.044422009
#> 3 0.14 0.055022716
#> 4 0.18 0.040888440
#> 5 0.23 0.078243311
#> 6 0.29 0.037354871
#> 7 0.34 0.046441191
#> 8 0.38 0.054265522
#> 9 0.43 0.044422009
#> 10 0.48 0.058556285
#> 11 0.52 0.078243311
#> 12 0.57 0.038364462
#> 13 0.62 0.034830893
#> 14 0.67 0.032054518
#> 15 0.72 0.052246340
#> 16 0.76 0.043412418
#> 17 0.81 0.067137809
#> 18 0.85 0.060323069
#> 19 0.91 0.068904594
#> 20 0.96 0.007319536
# }