Skip to contents

Method for determining split points for continuous modifiers

Usage

splitpoints(object, var, round = NULL)

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

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.64 0.05680794
#> 2     -1.26 0.04418395
#> 3     -1.06 0.05094680
#> 4     -0.81 0.04914337
#> 5     -0.65 0.03291253
#> 6     -0.51 0.03651939
#> 7     -0.38 0.03381425
#> 8     -0.25 0.03561767
#> 9     -0.16 0.08385933
#> 10    -0.03 0.12353472
#> 11     0.10 0.04328224
#> 12     0.21 0.10459874
#> 13     0.37 0.05861136
#> 14     0.50 0.03291253
#> 15     0.66 0.02434626
#> 16     0.82 0.08791704
#> 17     0.99 0.03516682
#> 18     1.20 0.02885482
#> 19     1.40 0.03561767
#> 20     1.77 0.00135257
splitpoints(fit, var = "mod_scale", round = 2)
#>    location  proportion
#> 1      0.06 0.070052539
#> 2      0.12 0.054290718
#> 3      0.16 0.074605954
#> 4      0.21 0.041681261
#> 5      0.26 0.032574431
#> 6      0.32 0.040980736
#> 7      0.36 0.035026270
#> 8      0.40 0.099124343
#> 9      0.44 0.042732049
#> 10     0.48 0.112084063
#> 11     0.52 0.032574431
#> 12     0.58 0.047635727
#> 13     0.61 0.032924694
#> 14     0.67 0.041681261
#> 15     0.71 0.052889667
#> 16     0.76 0.041330998
#> 17     0.81 0.049387040
#> 18     0.86 0.044133100
#> 19     0.91 0.049737303
#> 20     0.95 0.004553415
# }