Skip to contents

Method for calculating posterior inclusion probabilities (PIPs) for modifiers in HDLM & HDLMM

Usage

pip(object, type = 1)

Arguments

object

An object of class dlmtree.

type

Type=1 indicates single modifier PIPs. Type=2 indicates joint modifier PIPs for two modifiers.

Value

A vector (type=1) or data.frame (type=2) of PIPs.

Details

pip

Examples

# \donttest{
# Posterior inclusion probability 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: 4 seconds)
#> [0--------25--------50--------75--------100]
#>  ''''''''''''''''''''''''''''''''''''''''''
#> Compiling results...
pip(fit)
#>   mod_num   mod_bin mod_scale        c1        c2        c3        c4        c5 
#>     1.000     0.447     1.000     0.278     0.324     0.270     0.335     0.239 
#>        b1        b2        b3        b4        b5 
#>     0.218     0.188     0.238     0.327     0.292 
pip(fit, type = 2)
#>          var1      var2   pip
#> 3     mod_num mod_scale 1.000
#> 27  mod_scale   mod_num 1.000
#> 29  mod_scale mod_scale 0.971
#> 1     mod_num   mod_num 0.616
#> 16    mod_bin mod_scale 0.263
#> 28  mod_scale   mod_bin 0.263
#> 2     mod_num   mod_bin 0.199
#> 14    mod_bin   mod_num 0.199
#> 31  mod_scale        c2 0.153
#> 33  mod_scale        c4 0.153
#> 55         c2 mod_scale 0.153
#> 81         c4 mod_scale 0.153
#> 12    mod_num        b4 0.150
#> 144        b4   mod_num 0.150
#> 38  mod_scale        b4 0.141
#> 146        b4 mod_scale 0.141
#> 7     mod_num        c4 0.140
#> 79         c4   mod_num 0.140
#> 5     mod_num        c2 0.135
#> 53         c2   mod_num 0.135
#> 39  mod_scale        b5 0.133
#> 159        b5 mod_scale 0.133
#> 35  mod_scale        b1 0.128
#> 107        b1 mod_scale 0.128
#> 13    mod_num        b5 0.119
#> 157        b5   mod_num 0.119
#> 30  mod_scale        c1 0.118
#> 42         c1 mod_scale 0.118
#> 4     mod_num        c1 0.116
#> 32  mod_scale        c3 0.116
#> 40         c1   mod_num 0.116
#> 68         c3 mod_scale 0.116
#> 37  mod_scale        b3 0.115
#> 133        b3 mod_scale 0.115
#> 6     mod_num        c3 0.105
#> 66         c3   mod_num 0.105
#> 9     mod_num        b1 0.104
#> 105        b1   mod_num 0.104
#> 11    mod_num        b3 0.101
#> 131        b3   mod_num 0.101
#> 8     mod_num        c5 0.099
#> 92         c5   mod_num 0.099
#> 34  mod_scale        c5 0.094
#> 94         c5 mod_scale 0.094
#> 10    mod_num        b2 0.072
#> 118        b2   mod_num 0.072
#> 36  mod_scale        b2 0.065
#> 120        b2 mod_scale 0.065
#> 44         c1        c2 0.058
#> 56         c2        c1 0.058
#> 57         c2        c2 0.055
#> 26    mod_bin        b5 0.049
#> 158        b5   mod_bin 0.049
#> 21    mod_bin        c5 0.048
#> 93         c5   mod_bin 0.048
#> 116        b1        b4 0.045
#> 152        b4        b1 0.045
#> 18    mod_bin        c2 0.042
#> 54         c2   mod_bin 0.042
#> 65         c2        b5 0.042
#> 99         c5        c5 0.042
#> 161        b5        c2 0.042
#> 85         c4        c4 0.038
#> 156        b4        b5 0.038
#> 168        b5        b4 0.038
#> 25    mod_bin        b4 0.037
#> 145        b4   mod_bin 0.037
#> 103        c5        b4 0.036
#> 151        b4        c5 0.036
#> 58         c2        c3 0.035
#> 70         c3        c2 0.035
#> 50         c1        b3 0.033
#> 60         c2        c5 0.033
#> 96         c5        c2 0.033
#> 104        c5        b5 0.033
#> 134        b3        c1 0.033
#> 164        b5        c5 0.033
#> 59         c2        c4 0.032
#> 83         c4        c2 0.032
#> 115        b1        b3 0.032
#> 139        b3        b1 0.032
#> 142        b3        b4 0.032
#> 154        b4        b3 0.032
#> 20    mod_bin        c4 0.030
#> 64         c2        b4 0.030
#> 80         c4   mod_bin 0.030
#> 91         c4        b5 0.030
#> 148        b4        c2 0.030
#> 163        b5        c4 0.030
#> 48         c1        b1 0.026
#> 63         c2        b3 0.026
#> 108        b1        c1 0.026
#> 135        b3        c2 0.026
#> 43         c1        c1 0.025
#> 52         c1        b5 0.024
#> 77         c3        b4 0.024
#> 149        b4        c3 0.024
#> 160        b5        c1 0.024
#> 51         c1        b4 0.023
#> 147        b4        c1 0.023
#> 17    mod_bin        c1 0.022
#> 41         c1   mod_bin 0.022
#> 86         c4        c5 0.022
#> 98         c5        c4 0.022
#> 130        b2        b5 0.022
#> 166        b5        b2 0.022
#> 46         c1        c4 0.021
#> 82         c4        c1 0.021
#> 87         c4        b1 0.020
#> 111        b1        c4 0.020
#> 90         c4        b4 0.019
#> 150        b4        c4 0.019
#> 76         c3        b3 0.018
#> 136        b3        c3 0.018
#> 22    mod_bin        b1 0.017
#> 106        b1   mod_bin 0.017
#> 117        b1        b5 0.017
#> 165        b5        b1 0.017
#> 24    mod_bin        b3 0.016
#> 74         c3        b1 0.016
#> 110        b1        c3 0.016
#> 132        b3   mod_bin 0.016
#> 45         c1        c3 0.015
#> 69         c3        c1 0.015
#> 71         c3        c3 0.015
#> 73         c3        c5 0.015
#> 97         c5        c3 0.015
#> 19    mod_bin        c3 0.014
#> 67         c3   mod_bin 0.014
#> 72         c3        c4 0.014
#> 84         c4        c3 0.014
#> 102        c5        b3 0.014
#> 138        b3        c5 0.014
#> 62         c2        b2 0.013
#> 89         c4        b3 0.013
#> 122        b2        c2 0.013
#> 128        b2        b3 0.013
#> 137        b3        c4 0.013
#> 140        b3        b2 0.013
#> 143        b3        b5 0.013
#> 167        b5        b3 0.013
#> 23    mod_bin        b2 0.012
#> 101        c5        b2 0.012
#> 119        b2   mod_bin 0.012
#> 125        b2        c5 0.012
#> 88         c4        b2 0.011
#> 124        b2        c4 0.011
#> 129        b2        b4 0.011
#> 153        b4        b2 0.011
#> 47         c1        c5 0.009
#> 95         c5        c1 0.009
#> 100        c5        b1 0.009
#> 112        b1        c5 0.009
#> 49         c1        b2 0.008
#> 78         c3        b5 0.008
#> 121        b2        c1 0.008
#> 162        b5        c3 0.008
#> 61         c2        b1 0.007
#> 109        b1        c2 0.007
#> 114        b1        b2 0.007
#> 126        b2        b1 0.007
#> 75         c3        b2 0.001
#> 123        b2        c3 0.001
#> 15    mod_bin   mod_bin 0.000
#> 113        b1        b1 0.000
#> 127        b2        b2 0.000
#> 141        b3        b3 0.000
#> 155        b4        b4 0.000
#> 169        b5        b5 0.000
# }