Welcome to the psfmi package

Martijn W Heymans

2020-02-03

Introduction

On this page you will find information of the psfmi package. The package contains functions to apply pooling or backward selection (BWS) for logistic, Cox regression and Multilevel (Mixed models) prediction models in multiply imputed datasets.

The basic pooling method is Rubin’s Rules. For categorical predictors, different methods to derive pooled p-values are available as: the D1, D2, D3 and MPR (Median R Rule) method. Also restricted cubic spline coefficients can be used. Two-way interaction terms between continuous, dichotomous and categorical predictors are also possible in the model. All these type of predictors, interaction terms or a combination, can be forced in the model during BWS. Furthermore, the stability of models selected and the bootstrap inclusion frequency can be evaluated. For logistic and Cox regression models bootstrapping is than used and for Multilevel models cluster bootstrapping.

The package also contains a function to generate pooled model performance measures over imputed datasets as ROC/AUC, Nagelkerke R-squares, Brier score and calibration plots. A function to apply Bootstrap internal validation
is also available where two methods can be used to combine bootstrapping and multiple imputationfor internal validation. One method, boot_MI, first draws bootstrap samples and subsequently performs multiple imputation and with the other method, MI_boot, first bootstrap samples are drawn from each imputed dataset before results are combined. Backward selection as part of internal validation is also an option. A function with the name mivalext_lr can be used to externally validate prediction models in multiply imputed datasets. The following information of the externally validated model is provided: pooled ROC/AUC, (Nagelkerke) R-Square value, Hosmer and Lemeshow Test, pooled coefficients when the model is freely estimated in imputed datasets and the pooled linear predictor (LP), with information about miscalibration in intercept and slope.

Installing the psfmi package

The package can be installed from CRAN and the development version from Github by running the following code in the R console window:

install.packages(“devtools”)

library(devtools)

devtools::install_github(“mwheymans/psfmi”)

library(psfmi)

Main functions

The main functions that are available in the psfmi package are:

psfmi_lr: pooling and selection of Logistic regression models in multiply imputed datasets.

psfmi_coxr: pooling and selection of Cox regression models in multiply imputed datasets.

psfmi_mm: pooling and selection of linear and logistic Mixed models in multiply imputed datasets.

psfmi_stab: stability evaluation of models and predictors in multiply imputed datasets.

psfmi_perform: performance and internal validation of logistic regression models in multiply imputed datasets.

mivalext_lr: external validation in multiply imputed datasets.

Examples

Logistic Regression

Pooling without BWS and method D1

Back to Examples

Pooling with BWS and method D1

Pooling Logistic regression models over 5 imputed datasets with backward selection using a p-value of 0.05 and as method D1 and forcing the predictor “Smoking” in the models during backward selection.


  library(psfmi)
  pool_lr <- psfmi_lr(data=lbpmilr, nimp=5, impvar="Impnr", Outcome="Chronic",
  predictors=c("Gender", "Smoking", "Function", "JobControl",
  "JobDemands", "SocialSupport"), keep.predictors = "Smoking",
  p.crit = 0.05, method="D1")
#> Variable excluded at Step 1 is - JobDemands
#> Variable excluded at Step 2 is - JobControl
#> Variable excluded at Step 3 is - SocialSupport
#> Variable excluded at Step 4 is - Gender
#> 
#> Pooled model correctly estimated
#>           using a p-value of 0.05 and predictors to keep Smoking
  pool_lr$RR_Model
#> $`Step 1`
#>                   est std.err signif   lower   upper     OR   L.OR     U.OR
#> (Intercept)   -0.0215  2.4949 0.9931 -4.9246  4.8817 0.9788 0.0073 131.8530
#> Gender        -0.3545  0.4181 0.3966 -1.1741  0.4652 0.7016 0.3091   1.5923
#> Smoking        0.0757  0.3408 0.8244 -0.5924  0.7437 1.0786 0.5530   2.1037
#> Function      -0.1419  0.0434 0.0011 -0.2270 -0.0568 0.8677 0.7969   0.9448
#> JobControl     0.0069  0.0205 0.7370 -0.0335  0.0473 1.0069 0.9670   1.0485
#> JobDemands     0.0023  0.0387 0.9532 -0.0738  0.0784 1.0023 0.9288   1.0815
#> SocialSupport  0.0443  0.0575 0.4408 -0.0685  0.1572 1.0453 0.9338   1.1702
#> 
#> $`Step 2`
#>                   est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)    0.0664  1.9997 0.9735 -3.8606  3.9935 1.0687 0.0211 54.2427
#> Gender        -0.3568  0.4099 0.3841 -1.1602  0.4467 0.6999 0.3134  1.5631
#> Smoking        0.0746  0.3407 0.8266 -0.5931  0.7424 1.0775 0.5526  2.1009
#> Function      -0.1420  0.0434 0.0011 -0.2271 -0.0569 0.8676 0.7969  0.9447
#> JobControl     0.0068  0.0205 0.7397 -0.0336  0.0472 1.0068 0.9670  1.0483
#> SocialSupport  0.0442  0.0574 0.4410 -0.0684  0.1569 1.0452 0.9339  1.1699
#> 
#> $`Step 3`
#>                   est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)    0.5447  1.3933 0.6959 -2.1875  3.2769 1.7240 0.1122 26.4925
#> Gender        -0.3910  0.3993 0.3275 -1.1737  0.3917 0.6764 0.3092  1.4795
#> Smoking        0.0761  0.3404 0.8232 -0.5911  0.7432 1.0790 0.5537  2.1026
#> Function      -0.1387  0.0427 0.0012 -0.2224 -0.0549 0.8705 0.8006  0.9466
#> SocialSupport  0.0402  0.0561 0.4741 -0.0699  0.1503 1.0410 0.9325  1.1622
#> 
#> $`Step 4`
#>                 est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)  1.4717  0.5450 0.0069  0.4034  2.5400 4.3566 1.4968 12.6801
#> Gender      -0.4121  0.3967 0.2988 -1.1896  0.3654 0.6622 0.3043  1.4411
#> Smoking      0.0686  0.3392 0.8398 -0.5963  0.7334 1.0710 0.5508  2.0822
#> Function    -0.1362  0.0424 0.0014 -0.2194 -0.0529 0.8727 0.8030  0.9484
#> 
#> $`Step 5`
#>                 est std.err signif   lower   upper     OR   L.OR   U.OR
#> (Intercept)  1.2070  0.4823 0.0124  0.2612  2.1528 3.3433 1.2985 8.6086
#> Smoking      0.0643  0.3380 0.8492 -0.5983  0.7269 1.0664 0.5497 2.0686
#> Function    -0.1406  0.0423 0.0009 -0.2235 -0.0577 0.8688 0.7997 0.9440
  pool_lr$multiparm
#> $`Step 1`
#>               Chi_sq p-value D1 & RR
#> Gender         0.719          0.3966
#> Smoking        0.049          0.8244
#> Function      10.698          0.0011
#> JobControl     0.113          0.7370
#> JobDemands     0.003          0.9532
#> SocialSupport  0.594          0.4408
#> 
#> $`Step 2`
#>               Chi_sq p-value D1 & RR
#> Gender         0.758          0.3841
#> Smoking        0.048          0.8266
#> Function      10.706          0.0011
#> JobControl     0.111          0.7397
#> SocialSupport  0.594          0.4410
#> 
#> $`Step 3`
#>               Chi_sq p-value D1 & RR
#> Gender         0.959          0.3275
#> Smoking        0.050          0.8232
#> Function      10.555          0.0012
#> SocialSupport  0.513          0.4741
#> 
#> $`Step 4`
#>          Chi_sq p-value D1 & RR
#> Gender    1.079          0.2988
#> Smoking   0.041          0.8398
#> Function 10.308          0.0014
#> 
#> $`Step 5`
#>          Chi_sq p-value D1 & RR
#> Smoking   0.036          0.8492
#> Function 11.072          0.0009
  pool_lr$predictors_in
#>        Gender Smoking Function JobControl JobDemands SocialSupport
#> Step 1      1       1        1          1          1             1
#> Step 2      1       1        1          1          0             1
#> Step 3      1       1        1          0          0             1
#> Step 4      1       1        1          0          0             0
#> Step 5      0       1        1          0          0             0

Back to Examples

Pooling with BWS including several interaction terms and method D2

Pooling Logistic regression models over 5 imputed datasets with BWS using a p-value of 0.05 and as method D2. Several interaction terms, including a categorical predictor, are part of the selection procedure.


  library(psfmi)
  pool_lr <- psfmi_lr(data=lbpmilr, nimp=5, impvar="Impnr", Outcome="Chronic",
  predictors=c("Gender", "Smoking", "Function", "JobControl"), 
  p.crit = 0.05, cat.predictors = c("Carrying", "Satisfaction"),
  int.predictors = c("Carrying:Smoking", "Gender:Smoking"), method="D2")
#> Variable excluded at Step 1 is - JobControl
#> Variable excluded at Step 2 is - factor(Satisfaction)
#> Variable excluded at Step 3 is - Gender:Smoking
#> Variable excluded at Step 4 is - Gender
#> Variable excluded at Step 5 is - Smoking:factor(Carrying)
#> Variable excluded at Step 6 is - Smoking
#> Variable excluded at Step 7 is - Function
  pool_lr$RR_Model
#> $`Step 1`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)                1.3460  1.6498 0.4156 -1.9081 4.6000  3.8420 0.1484
#> Gender                    -0.8389  0.5922 0.1566 -1.9996 0.3219  0.4322 0.1354
#> Smoking                   -2.6662  1.4839 0.0754 -5.6098 0.2773  0.0695 0.0037
#> Function                  -0.0695  0.0494 0.1606 -0.1665 0.0276  0.9329 0.8466
#> JobControl                -0.0074  0.0225 0.7439 -0.0518 0.0370  0.9927 0.9496
#> factor(Carrying)2          0.4346  0.6820 0.5243 -0.9062 1.7755  1.5444 0.4041
#> factor(Carrying)3          1.4509  0.6638 0.0295  0.1454 2.7564  4.2669 1.1565
#> factor(Satisfaction)2     -0.5007  0.4692 0.2860 -1.4210 0.4196  0.6061 0.2415
#> factor(Satisfaction)3     -1.0022  0.6158 0.1059 -2.2197 0.2152  0.3671 0.1086
#> Smoking:factor(Carrying)2  2.3186  1.3651 0.0918 -0.3825 5.0198 10.1619 0.6822
#> Smoking:factor(Carrying)3  2.3873  1.4296 0.0985 -0.4536 5.2281 10.8838 0.6354
#> Gender:Smoking             0.9909  0.9033 0.2730 -0.7821 2.7640  2.6938 0.4575
#>                               U.OR
#> (Intercept)                99.4883
#> Gender                      1.3797
#> Smoking                     1.3196
#> Function                    1.0280
#> JobControl                  1.0377
#> factor(Carrying)2           5.9031
#> factor(Carrying)3          15.7424
#> factor(Satisfaction)2       1.5214
#> factor(Satisfaction)3       1.2401
#> Smoking:factor(Carrying)2 151.3798
#> Smoking:factor(Carrying)3 186.4389
#> Gender:Smoking             15.8628
#> 
#> $`Step 2`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)                0.9271  0.9525 0.3304 -0.9402 2.7945  2.5273 0.3905
#> Gender                    -0.7995  0.5804 0.1684 -1.9374 0.3383  0.4495 0.1441
#> Smoking                   -2.6365  1.4771 0.0772 -5.5655 0.2926  0.0716 0.0038
#> Function                  -0.0723  0.0491 0.1410 -0.1687 0.0240  0.9302 0.8447
#> factor(Carrying)2          0.4297  0.6809 0.5284 -0.9091 1.7684  1.5367 0.4029
#> factor(Carrying)3          1.4562  0.6611 0.0283  0.1561 2.7563  4.2897 1.1690
#> factor(Satisfaction)2     -0.5107  0.4675 0.2748 -1.4276 0.4062  0.6001 0.2399
#> factor(Satisfaction)3     -0.9931  0.6131 0.1075 -2.2050 0.2188  0.3704 0.1102
#> Smoking:factor(Carrying)2  2.3166  1.3651 0.0921 -0.3847 5.0179 10.1413 0.6807
#> Smoking:factor(Carrying)3  2.3348  1.4095 0.1009 -0.4633 5.1329 10.3274 0.6292
#> Gender:Smoking             0.9736  0.9010 0.2802 -0.7948 2.7420  2.6474 0.4517
#>                               U.OR
#> (Intercept)                16.3542
#> Gender                      1.4026
#> Smoking                     1.3399
#> Function                    1.0243
#> factor(Carrying)2           5.8617
#> factor(Carrying)3          15.7415
#> factor(Satisfaction)2       1.5012
#> factor(Satisfaction)3       1.2446
#> Smoking:factor(Carrying)2 151.0925
#> Smoking:factor(Carrying)3 169.5079
#> Gender:Smoking             15.5180
#> 
#> $`Step 3`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)                0.3434  0.8581 0.6891 -1.3392 2.0259  1.4097 0.2621
#> Gender                    -0.7286  0.5706 0.2017 -1.8472 0.3899  0.4826 0.1577
#> Smoking                   -2.5925  1.4589 0.0784 -5.4841 0.2990  0.0748 0.0042
#> Function                  -0.0624  0.0474 0.1889 -0.1554 0.0307  0.9396 0.8560
#> factor(Carrying)2          0.3670  0.6652 0.5814 -0.9402 1.6742  1.4434 0.3905
#> factor(Carrying)3          1.2414  0.6206 0.0458  0.0232 2.4597  3.4605 1.0235
#> Smoking:factor(Carrying)2  2.3857  1.3575 0.0814 -0.3024 5.0737 10.8662 0.7391
#> Smoking:factor(Carrying)3  2.3808  1.3808 0.0875 -0.3559 5.1176 10.8137 0.7005
#> Gender:Smoking             0.9605  0.8869 0.2791 -0.7802 2.7012  2.6131 0.4583
#>                               U.OR
#> (Intercept)                 7.5830
#> Gender                      1.4768
#> Smoking                     1.3485
#> Function                    1.0312
#> factor(Carrying)2           5.3344
#> factor(Carrying)3          11.7010
#> Smoking:factor(Carrying)2 159.7618
#> Smoking:factor(Carrying)3 166.9276
#> Gender:Smoking             14.8983
#> 
#> $`Step 4`
#>                               est std.err signif   lower  upper     OR   L.OR
#> (Intercept)               -0.0057  0.7933 0.9942 -1.5613 1.5498 0.9943 0.2099
#> Gender                    -0.3208  0.4293 0.4550 -1.1624 0.5209 0.7256 0.3127
#> Smoking                   -1.7443  1.1587 0.1340 -4.0310 0.5424 0.1748 0.0178
#> Function                  -0.0620  0.0475 0.1922 -0.1552 0.0312 0.9399 0.8562
#> factor(Carrying)2          0.4900  0.6442 0.4473 -0.7754 1.7553 1.6322 0.4605
#> factor(Carrying)3          1.2492  0.6145 0.0424  0.0431 2.4553 3.4875 1.0440
#> Smoking:factor(Carrying)2  2.1498  1.3162 0.1044 -0.4503 4.7499 8.5834 0.6374
#> Smoking:factor(Carrying)3  2.2758  1.3581 0.0962 -0.4114 4.9629 9.7353 0.6627
#>                               U.OR
#> (Intercept)                 4.7107
#> Gender                      1.6835
#> Smoking                     1.7201
#> Function                    1.0317
#> factor(Carrying)2           5.7850
#> factor(Carrying)3          11.6498
#> Smoking:factor(Carrying)2 115.5783
#> Smoking:factor(Carrying)3 143.0062
#> 
#> $`Step 5`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)               -0.2377  0.7359 0.7468 -1.6815 1.2062  0.7885 0.1861
#> Smoking                   -1.7527  1.1623 0.1335 -4.0480 0.5426  0.1733 0.0175
#> Function                  -0.0655  0.0471 0.1649 -0.1581 0.0270  0.9366 0.8538
#> factor(Carrying)2          0.5799  0.6353 0.3619 -0.6689 1.8286  1.7858 0.5123
#> factor(Carrying)3          1.2513  0.6134 0.0417  0.0474 2.4552  3.4949 1.0485
#> Smoking:factor(Carrying)2  2.1133  1.3206 0.1118 -0.4980 4.7245  8.2751 0.6077
#> Smoking:factor(Carrying)3  2.3039  1.3615 0.0932 -0.3918 4.9996 10.0131 0.6758
#>                               U.OR
#> (Intercept)                 3.3406
#> Smoking                     1.7205
#> Function                    1.0274
#> factor(Carrying)2           6.2249
#> factor(Carrying)3          11.6488
#> Smoking:factor(Carrying)2 112.6743
#> Smoking:factor(Carrying)3 148.3599
#> 
#> $`Step 6`
#>                       est std.err signif   lower  upper     OR   L.OR    U.OR
#> (Intercept)       -0.7211  0.7238 0.3193 -2.1412 0.6990 0.4862 0.1175  2.0116
#> Smoking            0.0412  0.3608 0.9091 -0.6660 0.7484 1.0421 0.5138  2.1136
#> Function          -0.0677  0.0480 0.1588 -0.1621 0.0266 0.9345 0.8504  1.0269
#> factor(Carrying)2  1.2634  0.4817 0.0088  0.3189 2.2078 3.5374 1.3757  9.0959
#> factor(Carrying)3  1.9400  0.5203 0.0002  0.9199 2.9600 6.9585 2.5091 19.2983
#> 
#> $`Step 7`
#>                       est std.err signif   lower  upper     OR   L.OR    U.OR
#> (Intercept)       -0.7057  0.7126 0.3223 -2.1038 0.6925 0.4938 0.1220  1.9987
#> Function          -0.0675  0.0479 0.1591 -0.1616 0.0265 0.9347 0.8508  1.0269
#> factor(Carrying)2  1.2680  0.4797 0.0082  0.3275 2.2085 3.5537 1.3875  9.1017
#> factor(Carrying)3  1.9380  0.5198 0.0002  0.9190 2.9570 6.9446 2.5067 19.2392
#> 
#> $`Step 8`
#>                       est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)       -1.5824  0.3773 0.0000 -2.3219 -0.8428 0.2055 0.0981  0.4305
#> factor(Carrying)2  1.3916  0.4710 0.0031  0.4682  2.3149 4.0211 1.5971 10.1240
#> factor(Carrying)3  2.2489  0.4750 0.0000  1.3178  3.1800 9.4773 3.7352 24.0463
  pool_lr$multiparm
#> $`Step 1`
#>                               D2 p-value D2 & RR
#> Gender                   0.84738         0.15660
#> Smoking                  0.02015         0.07540
#> Function                 1.92170         0.16060
#> JobControl               0.01125         0.74390
#> factor(Carrying)         9.02343         0.00012
#> factor(Satisfaction)     1.18686         0.30982
#> Smoking:factor(Carrying) 1.74500         0.18534
#> Gender:Smoking           1.14729         0.27300
#> 
#> $`Step 2`
#>                               D2 p-value D2 & RR
#> Gender                   0.77115         0.16840
#> Smoking                  0.02068         0.07720
#> Function                 2.11414         0.14100
#> factor(Carrying)         8.94430         0.00013
#> factor(Satisfaction)     1.17606         0.31299
#> Smoking:factor(Carrying) 1.73365         0.18677
#> Gender:Smoking           1.11201         0.28020
#> 
#> $`Step 3`
#>                               D2 p-value D2 & RR
#> Gender                   0.54203         0.20170
#> Smoking                  0.00989         0.07840
#> Function                 1.67522         0.18890
#> factor(Carrying)         7.75198         0.00044
#> Smoking:factor(Carrying) 1.90767         0.15864
#> Gender:Smoking           1.11888         0.27910
#> 
#> $`Step 4`
#>                               D2 p-value D2 & RR
#> Gender                   0.54203         0.45500
#> Smoking                  0.00989         0.13400
#> Function                 1.64787         0.19220
#> factor(Carrying)         7.69428         0.00046
#> Smoking:factor(Carrying) 1.71734         0.18790
#> 
#> $`Step 5`
#>                               D2 p-value D2 & RR
#> Smoking                  0.00114         0.13350
#> Function                 1.88207         0.16490
#> factor(Carrying)         7.96118         0.00035
#> Smoking:factor(Carrying) 1.68575         0.19444
#> 
#> $`Step 6`
#>                       D2 p-value D2 & RR
#> Smoking          0.00114         0.90910
#> Function         1.93144         0.15880
#> factor(Carrying) 7.96118         0.00035
#> 
#> $`Step 7`
#>                       D2 p-value D2 & RR
#> Function         1.92698         0.16582
#> factor(Carrying) 7.98323         0.00034
#> 
#> $`Step 8`
#>                        D2 p-value D2 & RR
#> factor(Carrying) 13.58172               0
  pool_lr$predictors_in
#>        Gender Smoking Function JobControl factor(Carrying) factor(Satisfaction)
#> Step 1      1       1        1          1                1                    1
#> Step 2      1       1        1          0                1                    1
#> Step 3      1       1        1          0                1                    0
#> Step 4      1       1        1          0                1                    0
#> Step 5      0       1        1          0                1                    0
#> Step 6      0       1        1          0                1                    0
#> Step 7      0       0        1          0                1                    0
#> Step 8      0       0        0          0                1                    0
#>        Smoking:factor(Carrying) Gender:Smoking
#> Step 1                        1              1
#> Step 2                        1              1
#> Step 3                        1              1
#> Step 4                        1              0
#> Step 5                        1              0
#> Step 6                        0              0
#> Step 7                        0              0
#> Step 8                        0              0

Back to Examples

Pooling with BWS and forcing interaction terms and method D1

Same as above but now forcing several predictors, including interaction terms, in the model during BWS.


  library(psfmi)
  pool_lr <- psfmi_lr(data=lbpmilr, nimp=5, impvar="Impnr", Outcome="Chronic",
  predictors=c("Gender", "Smoking", "Function", "JobControl"), 
  p.crit = 0.05, cat.predictors = c("Carrying", "Satisfaction"),
  int.predictors = c("Carrying:Smoking", "Gender:Smoking"),
  keep.predictors = c("Smoking:Carrying", "JobControl"), method="D1")
#> Variable excluded at Step 1 is - Gender:Smoking
#> Variable excluded at Step 2 is - Gender
#> Variable excluded at Step 3 is - factor(Satisfaction)
#> Variable excluded at Step 4 is - Function
#> 
#> Selection correctly terminated.
#>           Variable(s) to keep - Smoking:factor(Carrying) JobControl - last variable(s) in model
  pool_lr$RR_Model
#> $`Step 1`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)                1.3460  1.6498 0.4156 -1.9081 4.6000  3.8420 0.1484
#> Gender                    -0.8389  0.5922 0.1566 -1.9996 0.3219  0.4322 0.1354
#> Smoking                   -2.6662  1.4839 0.0754 -5.6098 0.2773  0.0695 0.0037
#> Function                  -0.0695  0.0494 0.1606 -0.1665 0.0276  0.9329 0.8466
#> JobControl                -0.0074  0.0225 0.7439 -0.0518 0.0370  0.9927 0.9496
#> factor(Carrying)2          0.4346  0.6820 0.5243 -0.9062 1.7755  1.5444 0.4041
#> factor(Carrying)3          1.4509  0.6638 0.0295  0.1454 2.7564  4.2669 1.1565
#> factor(Satisfaction)2     -0.5007  0.4692 0.2860 -1.4210 0.4196  0.6061 0.2415
#> factor(Satisfaction)3     -1.0022  0.6158 0.1059 -2.2197 0.2152  0.3671 0.1086
#> Smoking:factor(Carrying)2  2.3186  1.3651 0.0918 -0.3825 5.0198 10.1619 0.6822
#> Smoking:factor(Carrying)3  2.3873  1.4296 0.0985 -0.4536 5.2281 10.8838 0.6354
#> Gender:Smoking             0.9909  0.9033 0.2730 -0.7821 2.7640  2.6938 0.4575
#>                               U.OR
#> (Intercept)                99.4883
#> Gender                      1.3797
#> Smoking                     1.3196
#> Function                    1.0280
#> JobControl                  1.0377
#> factor(Carrying)2           5.9031
#> factor(Carrying)3          15.7424
#> factor(Satisfaction)2       1.5214
#> factor(Satisfaction)3       1.2401
#> Smoking:factor(Carrying)2 151.3798
#> Smoking:factor(Carrying)3 186.4389
#> Gender:Smoking             15.8628
#> 
#> $`Step 2`
#>                               est std.err signif   lower  upper     OR   L.OR
#> (Intercept)                0.8930  1.6005 0.5778 -2.2709 4.0569 2.4424 0.1032
#> Gender                    -0.4113  0.4448 0.3551 -1.2831 0.4605 0.6628 0.2772
#> Smoking                   -1.7909  1.1779 0.1305 -4.1184 0.5366 0.1668 0.0163
#> Function                  -0.0693  0.0493 0.1600 -0.1661 0.0274 0.9330 0.8470
#> JobControl                -0.0056  0.0225 0.8036 -0.0500 0.0388 0.9944 0.9513
#> factor(Carrying)2          0.5543  0.6625 0.4032 -0.7478 1.8563 1.7407 0.4734
#> factor(Carrying)3          1.4550  0.6576 0.0275  0.1620 2.7480 4.2846 1.1759
#> factor(Satisfaction)2     -0.5209  0.4644 0.2621 -1.4317 0.3898 0.5940 0.2389
#> factor(Satisfaction)3     -0.9901  0.6106 0.1072 -2.1974 0.2173 0.3716 0.1111
#> Smoking:factor(Carrying)2  2.0818  1.3255 0.1182 -0.5357 4.6993 8.0188 0.5852
#> Smoking:factor(Carrying)3  2.2719  1.4048 0.1090 -0.5152 5.0590 9.6981 0.5974
#>                               U.OR
#> (Intercept)                57.7937
#> Gender                      1.5849
#> Smoking                     1.7102
#> Function                    1.0278
#> JobControl                  1.0395
#> factor(Carrying)2           6.4003
#> factor(Carrying)3          15.6114
#> factor(Satisfaction)2       1.4766
#> factor(Satisfaction)3       1.2427
#> Smoking:factor(Carrying)2 109.8720
#> Smoking:factor(Carrying)3 157.4369
#> 
#> $`Step 3`
#>                               est std.err signif   lower  upper     OR   L.OR
#> (Intercept)                0.3594  1.5063 0.8119 -2.6323 3.3512 1.4325 0.0719
#> Smoking                   -1.7917  1.1809 0.1315 -4.1267 0.5433 0.1667 0.0161
#> Function                  -0.0748  0.0488 0.1256 -0.1707 0.0210 0.9279 0.8431
#> JobControl                -0.0016  0.0222 0.9410 -0.0456 0.0423 0.9984 0.9554
#> factor(Carrying)2          0.6580  0.6543 0.3154 -0.6291 1.9450 1.9308 0.5331
#> factor(Carrying)3          1.4542  0.6558 0.0272  0.1644 2.7441 4.2813 1.1787
#> factor(Satisfaction)2     -0.4971  0.4614 0.2814 -1.4018 0.4076 0.6083 0.2462
#> factor(Satisfaction)3     -0.9407  0.6096 0.1254 -2.1474 0.2659 0.3903 0.1168
#> Smoking:factor(Carrying)2  2.0419  1.3300 0.1269 -0.5871 4.6709 7.7055 0.5559
#> Smoking:factor(Carrying)3  2.2810  1.4092 0.1089 -0.5172 5.0793 9.7869 0.5962
#>                               U.OR
#> (Intercept)                28.5363
#> Smoking                     1.7216
#> Function                    1.0212
#> JobControl                  1.0432
#> factor(Carrying)2           6.9936
#> factor(Carrying)3          15.5502
#> factor(Satisfaction)2       1.5032
#> factor(Satisfaction)3       1.3047
#> Smoking:factor(Carrying)2 106.7989
#> Smoking:factor(Carrying)3 160.6546
#> 
#> $`Step 4`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)               -0.2159  1.4461 0.8816 -3.0854 2.6536  0.8058 0.0457
#> Smoking                   -1.7521  1.1669 0.1353 -4.0571 0.5530  0.1734 0.0173
#> Function                  -0.0655  0.0475 0.1675 -0.1587 0.0276  0.9366 0.8533
#> JobControl                -0.0004  0.0220 0.9838 -0.0440 0.0431  0.9996 0.9569
#> factor(Carrying)2          0.5839  0.6345 0.3579 -0.6629 1.8307  1.7931 0.5154
#> factor(Carrying)3          1.2580  0.6188 0.0424  0.0430 2.4730  3.5185 1.0440
#> Smoking:factor(Carrying)2  2.1128  1.3193 0.1115 -0.4954 4.7209  8.2712 0.6093
#> Smoking:factor(Carrying)3  2.3033  1.3866 0.0997 -0.4461 5.0527 10.0072 0.6401
#>                               U.OR
#> (Intercept)                14.2051
#> Smoking                     1.7385
#> Function                    1.0280
#> JobControl                  1.0441
#> factor(Carrying)2           6.2385
#> factor(Carrying)3          11.8584
#> Smoking:factor(Carrying)2 112.2717
#> Smoking:factor(Carrying)3 156.4416
#> 
#> $`Step 5`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)               -0.8105  1.3650 0.5540 -3.5179 1.8969  0.4446 0.0297
#> Smoking                   -1.7965  1.1699 0.1269 -4.1098 0.5167  0.1659 0.0164
#> JobControl                -0.0046  0.0217 0.8313 -0.0475 0.0383  0.9954 0.9536
#> factor(Carrying)2          0.7235  0.6215 0.2449 -0.4976 1.9445  2.0615 0.6080
#> factor(Carrying)3          1.5348  0.5909 0.0097  0.3739 2.6958  4.6405 1.4534
#> Smoking:factor(Carrying)2  2.0937  1.3150 0.1136 -0.5060 4.6935  8.1152 0.6029
#> Smoking:factor(Carrying)3  2.3700  1.3934 0.0923 -0.3974 5.1375 10.6977 0.6721
#>                               U.OR
#> (Intercept)                 6.6649
#> Smoking                     1.6765
#> JobControl                  1.0390
#> factor(Carrying)2           6.9899
#> factor(Carrying)3          14.8167
#> Smoking:factor(Carrying)2 109.2326
#> Smoking:factor(Carrying)3 170.2831
  pool_lr$multiparm
#> $`Step 1`
#>                          Chi_sq p-value D1 & RR
#> Gender                    2.007          0.1566
#> Smoking                   3.228          0.0754
#> Function                  1.973          0.1606
#> JobControl                0.107          0.7439
#> factor(Carrying)          2.601          0.0764
#> factor(Satisfaction)      1.414          0.2457
#> Smoking:factor(Carrying)  1.617          0.2057
#> Gender:Smoking            1.203          0.2730
#> 
#> $`Step 2`
#>                          Chi_sq p-value D1 & RR
#> Gender                    0.855          0.3551
#> Smoking                   2.312          0.1305
#> Function                  1.978          0.1600
#> JobControl                0.062          0.8036
#> factor(Carrying)          2.568          0.0787
#> factor(Satisfaction)      1.415          0.2454
#> Smoking:factor(Carrying)  1.455          0.2393
#> 
#> $`Step 3`
#>                          Chi_sq p-value D1 & RR
#> Smoking                   2.302          0.1315
#> Function                  2.351          0.1256
#> JobControl                0.005          0.9410
#> factor(Carrying)          2.500          0.0845
#> factor(Satisfaction)      1.293          0.2769
#> Smoking:factor(Carrying)  1.431          0.2454
#> 
#> $`Step 4`
#>                          Chi_sq p-value D1 & RR
#> Smoking                   2.255          0.1353
#> Function                  1.908          0.1675
#> JobControl                0.000          0.9838
#> factor(Carrying)          2.080          0.1265
#> Smoking:factor(Carrying)  1.520          0.2249
#> 
#> $`Step 5`
#>                          Chi_sq p-value D1 & RR
#> Smoking                   2.358          0.1269
#> JobControl                0.046          0.8313
#> factor(Carrying)          3.421          0.0340
#> Smoking:factor(Carrying)  1.563          0.2162
  pool_lr$predictors_in
#>        Gender Smoking Function JobControl factor(Carrying) factor(Satisfaction)
#> Step 1      1       1        1          1                1                    1
#> Step 2      1       1        1          1                1                    1
#> Step 3      0       1        1          1                1                    1
#> Step 4      0       1        1          1                1                    0
#> Step 5      0       1        0          1                1                    0
#>        Smoking:factor(Carrying) Gender:Smoking
#> Step 1                        1              1
#> Step 2                        1              0
#> Step 3                        1              0
#> Step 4                        1              0
#> Step 5                        1              0

Back to Examples

Pooling with BWS including spline coefficient and method D1

Pooling Logistic regression models over 5 imputed datasets with BWS using a p-value of 0.05 and as method D1. A spline predictor and interaction term are part of the selection procedure.


  library(psfmi)
  pool_lr <- psfmi_lr(data=lbpmilr, nimp=5, impvar="Impnr", Outcome="Chronic",
  predictors=c("Gender", "Smoking", "JobControl"), 
  p.crit = 0.05, cat.predictors = c("Carrying", "Satisfaction"),
  spline.predictors=c("Function"), int.predictors = c("Carrying:Smoking"), 
  knots=3, method="D1")
#> Variable excluded at Step 1 is - JobControl
#> Variable excluded at Step 2 is - Gender
#> Variable excluded at Step 3 is - rcs(Function,3)
#> Variable excluded at Step 4 is - factor(Satisfaction)
#> Variable excluded at Step 5 is - Smoking:factor(Carrying)
#> Variable excluded at Step 6 is - Smoking
  pool_lr$RR_Model
#> $`Step 1`
#>                               est std.err signif   lower  upper     OR   L.OR
#> (Intercept)                1.0185  1.6959 0.5491 -2.3357 4.3727 2.7690 0.0967
#> Gender                    -0.4125  0.4451 0.3540 -1.2849 0.4599 0.6620 0.2767
#> Smoking                   -1.7733  1.1782 0.1343 -4.1009 0.5542 0.1698 0.0166
#> JobControl                -0.0047  0.0226 0.8340 -0.0493 0.0398 0.9953 0.9519
#> factor(Carrying)2          0.5570  0.6624 0.4008 -0.7446 1.8587 1.7455 0.4749
#> factor(Carrying)3          1.4472  0.6577 0.0284  0.1540 2.7403 4.2510 1.1665
#> factor(Satisfaction)2     -0.5218  0.4646 0.2615 -1.4331 0.3894 0.5934 0.2386
#> factor(Satisfaction)3     -0.9813  0.6115 0.1108 -2.1900 0.2275 0.3748 0.1119
#> rcs(Function, 3)Function  -0.0951  0.1135 0.4023 -0.3177 0.1275 0.9093 0.7278
#> rcs(Function, 3)Function'  0.0373  0.1427 0.7940 -0.2424 0.3169 1.0380 0.7847
#> Smoking:factor(Carrying)2  2.0732  1.3240 0.1193 -0.5407 4.6871 7.9504 0.5823
#> Smoking:factor(Carrying)3  2.2714  1.4019 0.1082 -0.5087 5.0515 9.6930 0.6013
#>                               U.OR
#> (Intercept)                79.2608
#> Gender                      1.5839
#> Smoking                     1.7405
#> JobControl                  1.0406
#> factor(Carrying)2           6.4152
#> factor(Carrying)3          15.4919
#> factor(Satisfaction)2       1.4762
#> factor(Satisfaction)3       1.2554
#> rcs(Function, 3)Function    1.1360
#> rcs(Function, 3)Function'   1.3729
#> Smoking:factor(Carrying)2 108.5422
#> Smoking:factor(Carrying)3 156.2511
#> 
#> $`Step 2`
#>                               est std.err signif   lower  upper     OR   L.OR
#> (Intercept)                0.7820  1.1410 0.4933 -1.4570 3.0209 2.1858 0.2329
#> Gender                    -0.3940  0.4381 0.3685 -1.2527 0.4648 0.6744 0.2857
#> Smoking                   -1.7611  1.1729 0.1352 -4.0774 0.5551 0.1718 0.0170
#> factor(Carrying)2          0.5509  0.6615 0.4054 -0.7491 1.8509 1.7348 0.4728
#> factor(Carrying)3          1.4463  0.6554 0.0279  0.1576 2.7350 4.2474 1.1707
#> factor(Satisfaction)2     -0.5275  0.4634 0.2551 -1.4363 0.3813 0.5901 0.2378
#> factor(Satisfaction)3     -0.9743  0.6084 0.1115 -2.1767 0.2282 0.3775 0.1134
#> rcs(Function, 3)Function  -0.1009  0.1126 0.3703 -0.3220 0.1202 0.9040 0.7247
#> rcs(Function, 3)Function'  0.0432  0.1422 0.7612 -0.2357 0.3222 1.0442 0.7900
#> Smoking:factor(Carrying)2  2.0733  1.3238 0.1192 -0.5403 4.6868 7.9509 0.5826
#> Smoking:factor(Carrying)3  2.2417  1.3840 0.1081 -0.5002 4.9835 9.4091 0.6064
#>                               U.OR
#> (Intercept)                20.5105
#> Gender                      1.5916
#> Smoking                     1.7421
#> factor(Carrying)2           6.3652
#> factor(Carrying)3          15.4093
#> factor(Satisfaction)2       1.4642
#> factor(Satisfaction)3       1.2564
#> rcs(Function, 3)Function    1.1277
#> rcs(Function, 3)Function'   1.3801
#> Smoking:factor(Carrying)2 108.5076
#> Smoking:factor(Carrying)3 145.9867
#> 
#> $`Step 3`
#>                               est std.err signif   lower  upper     OR   L.OR
#> (Intercept)                0.4467  1.0816 0.6798 -1.6778 2.5712 1.5631 0.1868
#> Smoking                   -1.7748  1.1773 0.1338 -4.1016 0.5519 0.1695 0.0165
#> factor(Carrying)2          0.6547  0.6538 0.3174 -0.6314 1.9408 1.9246 0.5318
#> factor(Carrying)3          1.4395  0.6535 0.0282  0.1544 2.7246 4.2186 1.1669
#> factor(Satisfaction)2     -0.4984  0.4606 0.2794 -1.4018 0.4050 0.6075 0.2462
#> factor(Satisfaction)3     -0.9314  0.6082 0.1281 -2.1346 0.2719 0.3940 0.1183
#> rcs(Function, 3)Function  -0.1010  0.1120 0.3672 -0.3209 0.1189 0.9039 0.7255
#> rcs(Function, 3)Function'  0.0379  0.1418 0.7892 -0.2402 0.3160 1.0386 0.7865
#> Smoking:factor(Carrying)2  2.0364  1.3301 0.1280 -0.5928 4.6656 7.6631 0.5528
#> Smoking:factor(Carrying)3  2.2802  1.3885 0.1035 -0.4730 5.0334 9.7788 0.6231
#>                               U.OR
#> (Intercept)                13.0813
#> Smoking                     1.7366
#> factor(Carrying)2           6.9644
#> factor(Carrying)3          15.2504
#> factor(Satisfaction)2       1.4993
#> factor(Satisfaction)3       1.3124
#> rcs(Function, 3)Function    1.1262
#> rcs(Function, 3)Function'   1.3716
#> Smoking:factor(Carrying)2 106.2289
#> Smoking:factor(Carrying)3 153.4579
#> 
#> $`Step 4`
#>                               est std.err signif   lower  upper      OR   L.OR
#> (Intercept)               -0.7184  0.5484 0.1907 -1.7953 0.3585  0.4875 0.1661
#> Smoking                   -1.8274  1.1835 0.1252 -4.1703 0.5155  0.1608 0.0154
#> factor(Carrying)2          0.7911  0.6369 0.2150 -0.4614 2.0437  2.2059 0.6304
#> factor(Carrying)3          1.7595  0.6341 0.0060  0.5100 3.0090  5.8096 1.6653
#> factor(Satisfaction)2     -0.4627  0.4600 0.3147 -1.3652 0.4398  0.6296 0.2553
#> factor(Satisfaction)3     -0.8340  0.5926 0.1613 -2.0043 0.3363  0.4343 0.1348
#> Smoking:factor(Carrying)2  2.0343  1.3260 0.1273 -0.5882 4.6567  7.6466 0.5553
#> Smoking:factor(Carrying)3  2.3054  1.4037 0.1043 -0.4862 5.0971 10.0285 0.6149
#>                               U.OR
#> (Intercept)                 1.4311
#> Smoking                     1.6744
#> factor(Carrying)2           7.7189
#> factor(Carrying)3          20.2676
#> factor(Satisfaction)2       1.5524
#> factor(Satisfaction)3       1.3998
#> Smoking:factor(Carrying)2 105.2899
#> Smoking:factor(Carrying)3 163.5470
#> 
#> $`Step 5`
#>                               est std.err signif   lower   upper      OR   L.OR
#> (Intercept)               -1.0772  0.4474 0.0164 -1.9561 -0.1983  0.3405 0.1414
#> Smoking                   -1.7876  1.1664 0.1276 -4.0933  0.5181  0.1674 0.0167
#> factor(Carrying)2          0.7164  0.6207 0.2490 -0.5032  1.9361  2.0471 0.6046
#> factor(Carrying)3          1.5447  0.5808 0.0080  0.4042  2.6852  4.6867 1.4982
#> Smoking:factor(Carrying)2  2.0967  1.3162 0.1135 -0.5062  4.6996  8.1392 0.6028
#> Smoking:factor(Carrying)3  2.3343  1.3705 0.0916 -0.3842  5.0527 10.3219 0.6810
#>                               U.OR
#> (Intercept)                 0.8201
#> Smoking                     1.6789
#> factor(Carrying)2           6.9313
#> factor(Carrying)3          14.6615
#> Smoking:factor(Carrying)2 109.9043
#> Smoking:factor(Carrying)3 156.4461
#> 
#> $`Step 6`
#>                       est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)       -1.5882  0.4079 0.0001 -2.3877 -0.7887 0.2043 0.0918  0.4544
#> Smoking            0.0111  0.3594 0.9753 -0.6935  0.7158 1.0112 0.4998  2.0458
#> factor(Carrying)2  1.3912  0.4724 0.0032  0.4651  2.3172 4.0196 1.5922 10.1477
#> factor(Carrying)3  2.2513  0.4754 0.0000  1.3195  3.1832 9.5002 3.7414 24.1229
#> 
#> $`Step 7`
#>                       est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)       -1.5824  0.3773 0.0000 -2.3219 -0.8428 0.2055 0.0981  0.4305
#> factor(Carrying)2  1.3916  0.4710 0.0031  0.4682  2.3149 4.0211 1.5971 10.1240
#> factor(Carrying)3  2.2489  0.4750 0.0000  1.3178  3.1800 9.4773 3.7352 24.0463
  pool_lr$multiparm
#> $`Step 1`
#>                          Chi_sq p-value D1 & RR
#> Gender                    0.859          0.3540
#> Smoking                   2.266          0.1343
#> JobControl                0.044          0.8340
#> factor(Carrying)          2.532          0.0815
#> factor(Satisfaction)      1.387          0.2522
#> rcs(Function,3)           1.033          0.3562
#> Smoking:factor(Carrying)  1.455          0.2391
#> 
#> $`Step 2`
#>                          Chi_sq p-value D1 & RR
#> Gender                    0.809          0.3685
#> Smoking                   2.255          0.1352
#> factor(Carrying)          2.555          0.0797
#> factor(Satisfaction)      1.382          0.2534
#> rcs(Function,3)           1.107          0.3313
#> Smoking:factor(Carrying)  1.450          0.2401
#> 
#> $`Step 3`
#>                          Chi_sq p-value D1 & RR
#> Smoking                   2.273          0.1338
#> factor(Carrying)          2.461          0.0878
#> factor(Satisfaction)      1.270          0.2832
#> rcs(Function,3)           1.229          0.2934
#> Smoking:factor(Carrying)  1.449          0.2409
#> 
#> $`Step 4`
#>                          Chi_sq p-value D1 & RR
#> Smoking                   2.384          0.1252
#> factor(Carrying)          3.993          0.0202
#> factor(Satisfaction)      1.060          0.3483
#> Smoking:factor(Carrying)  1.454          0.2406
#> 
#> $`Step 5`
#>                          Chi_sq p-value D1 & RR
#> Smoking                   2.349          0.1276
#> factor(Carrying)          3.586          0.0288
#> Smoking:factor(Carrying)  1.556          0.2175
#> 
#> $`Step 6`
#>                  Chi_sq p-value D1 & RR
#> Smoking           0.001          0.9748
#> factor(Carrying) 11.116          0.0000
#> 
#> $`Step 7`
#>                  Chi_sq p-value D1 & RR
#> factor(Carrying) 11.099               0
  pool_lr$predictors_in
#>        Gender Smoking JobControl factor(Carrying) factor(Satisfaction)
#> Step 1      1       1          1                1                    1
#> Step 2      1       1          0                1                    1
#> Step 3      0       1          0                1                    1
#> Step 4      0       1          0                1                    1
#> Step 5      0       1          0                1                    0
#> Step 6      0       1          0                1                    0
#> Step 7      0       0          0                1                    0
#>        rcs(Function,3) Smoking:factor(Carrying)
#> Step 1               1                        1
#> Step 2               1                        1
#> Step 3               1                        1
#> Step 4               0                        1
#> Step 5               0                        1
#> Step 6               0                        0
#> Step 7               0                        0

Back to Examples

Cox Regression

Pooling without BWS and method D1


  library(psfmi)
  pool_coxr <- psfmi_coxr(data=lbpmicox, nimp=5, impvar="Impnr", time="Time", status="Status",
  predictors=c("Duration", "Radiation", "Onset", "Function", "Age",
  "Previous", "Tampascale", "JobControl", "JobDemand", "Social"), p.crit=1,
  cat.predictors=c("Expect_cat"), method="D1")
#> 
#> Pooled model correctly estimated
#>             using a p-value of 1
  pool_coxr$RR_Model
#> $`Step 1`
#>                         est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration            -0.0077  0.0040 0.0524 -0.0156  0.0001 0.9923 0.9845 1.0001
#> Radiation           -0.0749  0.1533 0.6251 -0.3755  0.2256 0.9278 0.6869 1.2531
#> Onset               -0.0937  0.1759 0.5941 -0.4385  0.2510 0.9106 0.6450 1.2853
#> Function             0.0440  0.0169 0.0094  0.0108  0.0771 1.0450 1.0109 1.0802
#> Age                 -0.0089  0.0077 0.2510 -0.0240  0.0063 0.9911 0.9763 1.0063
#> Previous            -0.0983  0.1992 0.6215 -0.4888  0.2921 0.9064 0.6134 1.3392
#> Tampascale          -0.0233  0.0141 0.0991 -0.0509  0.0044 0.9770 0.9504 1.0044
#> JobControl          -0.0084  0.0083 0.3144 -0.0247  0.0079 0.9916 0.9756 1.0079
#> JobDemand           -0.0218  0.0155 0.1591 -0.0522  0.0086 0.9784 0.9491 1.0086
#> Social              -0.0513  0.0249 0.0393 -0.1002 -0.0025 0.9500 0.9047 0.9975
#> factor(Expect_cat)2  0.2433  0.2312 0.2926 -0.2098  0.6964 1.2755 0.8107 2.0065
#> factor(Expect_cat)3  0.2271  0.2003 0.2569 -0.1654  0.6196 1.2550 0.8476 1.8582
  pool_coxr$multiparm
#> $`Step 1`
#>                    Chi_sq p-value D1 & RR
#> Duration            3.762          0.0524
#> Radiation           0.239          0.6251
#> Onset               0.284          0.5941
#> Function            6.752          0.0094
#> Age                 1.318          0.2510
#> Previous            0.244          0.6215
#> Tampascale          2.727          0.0991
#> JobControl          1.012          0.3144
#> JobDemand           1.982          0.1591
#> Social              4.248          0.0393
#> factor(Expect_cat)  0.722          0.4858

Back to Examples

Pooling with BWS and method MPR


  library(psfmi)
  pool_coxr <- psfmi_coxr(data=lbpmicox, nimp=5, impvar="Impnr", time="Time", status="Status",
  predictors=c("Duration", "Radiation", "Onset", "Function", "Age",
  "Previous", "Tampascale"), p.crit=0.05,
  cat.predictors=c("Expect_cat"), method="MPR")
#> Variable excluded at Step 1 is - Radiation
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - factor(Expect_cat)
#> Variable excluded at Step 4 is - Age
#> Variable excluded at Step 5 is - Previous
#> Variable excluded at Step 6 is - Tampascale
  pool_coxr$RR_Model
#> $`Step 1`
#>                         est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration            -0.0082  0.0039 0.0353 -0.0159 -0.0006 0.9918 0.9842 0.9994
#> Radiation           -0.0728  0.1532 0.6345 -0.3732  0.2275 0.9298 0.6885 1.2555
#> Onset               -0.1136  0.1756 0.5176 -0.4578  0.2305 0.8926 0.6327 1.2592
#> Function             0.0466  0.0168 0.0057  0.0136  0.0796 1.0477 1.0137 1.0829
#> Age                 -0.0071  0.0077 0.3520 -0.0222  0.0079 0.9929 0.9780 1.0079
#> Previous            -0.1908  0.1970 0.3328 -0.5768  0.1953 0.8263 0.5617 1.2157
#> Tampascale          -0.0221  0.0140 0.1138 -0.0495  0.0053 0.9781 0.9517 1.0053
#> factor(Expect_cat)2  0.2690  0.2291 0.2402 -0.1800  0.7180 1.3087 0.8353 2.0503
#> factor(Expect_cat)3  0.1863  0.1989 0.3490 -0.2035  0.5761 1.2048 0.8159 1.7791
#> 
#> $`Step 2`
#>                         est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration            -0.0083  0.0039 0.0334 -0.0160 -0.0007 0.9917 0.9841 0.9993
#> Onset               -0.1116  0.1754 0.5246 -0.4554  0.2322 0.8944 0.6342 1.2614
#> Function             0.0484  0.0164 0.0031  0.0163  0.0804 1.0496 1.0164 1.0837
#> Age                 -0.0072  0.0077 0.3508 -0.0223  0.0079 0.9928 0.9779 1.0079
#> Previous            -0.1816  0.1961 0.3545 -0.5659  0.2028 0.8339 0.5678 1.2248
#> Tampascale          -0.0221  0.0139 0.1127 -0.0494  0.0052 0.9781 0.9518 1.0052
#> factor(Expect_cat)2  0.2897  0.2252 0.1983 -0.1517  0.7312 1.3360 0.8592 2.0776
#> factor(Expect_cat)3  0.2001  0.1969 0.3095 -0.1858  0.5859 1.2215 0.8304 1.7966
#> 
#> $`Step 3`
#>                         est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration            -0.0085  0.0039 0.0294 -0.0161 -0.0008 0.9915 0.9840 0.9992
#> Function             0.0483  0.0164 0.0032  0.0162  0.0804 1.0495 1.0163 1.0837
#> Age                 -0.0068  0.0077 0.3775 -0.0219  0.0083 0.9932 0.9783 1.0083
#> Previous            -0.1735  0.1958 0.3755 -0.5572  0.2102 0.8407 0.5728 1.2339
#> Tampascale          -0.0223  0.0139 0.1080 -0.0496  0.0049 0.9779 0.9516 1.0049
#> factor(Expect_cat)2  0.2946  0.2250 0.1904 -0.1464  0.7356 1.3426 0.8638 2.0867
#> factor(Expect_cat)3  0.2019  0.1966 0.3044 -0.1834  0.5873 1.2237 0.8324 1.7991
#> 
#> $`Step 4`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0081  0.0039 0.0365 -0.0156 -0.0005 0.9919 0.9845 0.9995
#> Function    0.0504  0.0164 0.0021  0.0183  0.0826 1.0517 1.0185 1.0861
#> Age        -0.0057  0.0076 0.4527 -0.0206  0.0092 0.9943 0.9796 1.0092
#> Previous   -0.1724  0.1932 0.3722 -0.5512  0.2063 0.8416 0.5763 1.2291
#> Tampascale -0.0196  0.0136 0.1502 -0.0463  0.0071 0.9806 0.9548 1.0071
#> 
#> $`Step 5`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0087  0.0038 0.0212 -0.0161 -0.0013 0.9913 0.9840 0.9987
#> Function    0.0508  0.0165 0.0020  0.0186  0.0831 1.0521 1.0188 1.0867
#> Previous   -0.1919  0.1916 0.3167 -0.5675  0.1837 0.8254 0.5669 1.2017
#> Tampascale -0.0181  0.0134 0.1770 -0.0444  0.0082 0.9821 0.9566 1.0082
#> 
#> $`Step 6`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0083  0.0038 0.0268 -0.0157 -0.0010 0.9917 0.9844 0.9990
#> Function    0.0502  0.0164 0.0022  0.0180  0.0824 1.0515 1.0182 1.0859
#> Tampascale -0.0170  0.0134 0.2033 -0.0432  0.0092 0.9831 0.9577 1.0092
#> 
#> $`Step 7`
#>              est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration -0.0080  0.0037 0.0325 -0.0153 -0.0007 0.9920 0.9848 0.9993
#> Function  0.0568  0.0155 0.0002  0.0265  0.0871 1.0584 1.0269 1.0910
  pool_coxr$multiparm
#> $`Step 1`
#>                    P-value MPR & RR
#> Duration                     0.0353
#> Radiation                    0.6345
#> Onset                        0.5176
#> Function                     0.0057
#> Age                          0.3520
#> Previous                     0.3328
#> Tampascale                   0.1138
#> factor(Expect_cat)           0.4916
#> 
#> $`Step 2`
#>                    P-value MPR & RR
#> Duration                     0.0334
#> Onset                        0.5246
#> Function                     0.0031
#> Age                          0.3508
#> Previous                     0.3545
#> Tampascale                   0.1127
#> factor(Expect_cat)           0.4230
#> 
#> $`Step 3`
#>                    P-value MPR & RR
#> Duration                     0.0294
#> Function                     0.0032
#> Age                          0.3775
#> Previous                     0.3755
#> Tampascale                   0.1080
#> factor(Expect_cat)           0.4112
#> 
#> $`Step 4`
#>            P-value MPR & RR
#> Duration             0.0320
#> Function             0.0027
#> Age                  0.4464
#> Previous             0.3840
#> Tampascale           0.1401
#> 
#> $`Step 5`
#>            P-value MPR & RR
#> Duration             0.0181
#> Function             0.0026
#> Previous             0.3314
#> Tampascale           0.1712
#> 
#> $`Step 6`
#>            P-value MPR & RR
#> Duration             0.0231
#> Function             0.0030
#> Tampascale           0.2037
#> 
#> $`Step 7`
#>          P-value MPR & RR
#> Duration           0.0283
#> Function           0.0004
  pool_coxr$predictors_in
#>        Duration Radiation Onset Function Age Previous Tampascale
#> Step 1        1         1     1        1   1        1          1
#> Step 2        1         0     1        1   1        1          1
#> Step 3        1         0     0        1   1        1          1
#> Step 4        1         0     0        1   1        1          1
#> Step 5        1         0     0        1   0        1          1
#> Step 6        1         0     0        1   0        0          1
#> Step 7        1         0     0        1   0        0          0
#>        factor(Expect_cat)
#> Step 1                  1
#> Step 2                  1
#> Step 3                  1
#> Step 4                  0
#> Step 5                  0
#> Step 6                  0
#> Step 7                  0

Back to Examples

Pooling with BWS including interaction terms and method D2

Pooling Cox regression models over 5 imputed datasets with backward selection using a p-value of 0.05 and as method D2 including interaction terms with a categorical predictor and forcing the predictor Tampascale in the models during backward selection.


  library(psfmi)
  pool_coxr <- psfmi_coxr(data=lbpmicox, nimp=5, impvar="Impnr", time="Time", status="Status",
  predictors=c("Duration", "Previous",  "Radiation", "Onset",
  "Function", "Tampascale" ), p.crit=0.05, cat.predictors=c("Satisfaction",
  "Expect_cat"), int.predictors=c("Tampascale:Radiation",
  "Expect_cat:Tampascale"), keep.predictors = "Tampascale", method="D2" )
#> Variable excluded at Step 1 is - factor(Satisfaction)
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Previous
#> 
#> Pooled model correctly estimated
#>           using a p-value of 0.05 and predictors to keep Tampascale
  pool_coxr$RR_Model
#> $`Step 1`
#>                                    est std.err signif   lower   upper     HR
#> Duration                       -0.0084  0.0038 0.0273 -0.0159 -0.0009 0.9916
#> Previous                       -0.1772  0.2005 0.3766 -0.5701  0.2157 0.8376
#> Radiation                      -1.6902  1.0884 0.1206 -3.8250  0.4446 0.1845
#> Onset                          -0.0975  0.1780 0.5838 -0.4464  0.2514 0.9071
#> Function                        0.0425  0.0178 0.0168  0.0077  0.0773 1.0434
#> Tampascale                     -0.0834  0.0376 0.0265 -0.1571 -0.0097 0.9200
#> factor(Satisfaction)1          -0.1900  0.3181 0.5527 -0.8276  0.4475 0.8270
#> factor(Satisfaction)2          -0.0607  0.3992 0.8796 -0.8586  0.7371 0.9411
#> factor(Expect_cat)2            -2.1919  1.6183 0.1759 -5.3671  0.9833 0.1117
#> factor(Expect_cat)3            -1.4635  1.4236 0.3039 -4.2536  1.3266 0.2314
#> Radiation:Tampascale            0.0393  0.0266 0.1394 -0.0128  0.0915 1.0401
#> Tampascale:factor(Expect_cat)2  0.0603  0.0403 0.1341 -0.0186  0.1393 1.0622
#> Tampascale:factor(Expect_cat)3  0.0423  0.0365 0.2458 -0.0291  0.1138 1.0432
#>                                  L.HR   U.HR
#> Duration                       0.9842 0.9991
#> Previous                       0.5655 1.2407
#> Radiation                      0.0218 1.5599
#> Onset                          0.6399 1.2858
#> Function                       1.0077 1.0804
#> Tampascale                     0.8546 0.9903
#> factor(Satisfaction)1          0.4371 1.5644
#> factor(Satisfaction)2          0.4238 2.0899
#> factor(Expect_cat)2            0.0047 2.6733
#> factor(Expect_cat)3            0.0142 3.7682
#> Radiation:Tampascale           0.9873 1.0958
#> Tampascale:factor(Expect_cat)2 0.9816 1.1495
#> Tampascale:factor(Expect_cat)3 0.9713 1.1205
#> 
#> $`Step 2`
#>                                    est std.err signif   lower   upper     HR
#> Duration                       -0.0085  0.0038 0.0265 -0.0160 -0.0010 0.9915
#> Previous                       -0.1895  0.1963 0.3344 -0.5742  0.1953 0.8274
#> Radiation                      -1.5692  1.0634 0.1401 -3.6540  0.5157 0.2082
#> Onset                          -0.1119  0.1771 0.5274 -0.4591  0.2352 0.8941
#> Function                        0.0429  0.0173 0.0135  0.0089  0.0768 1.0438
#> Tampascale                     -0.0811  0.0371 0.0289 -0.1539 -0.0083 0.9221
#> factor(Expect_cat)2            -2.0401  1.5897 0.1995 -5.1578  1.0776 0.1300
#> factor(Expect_cat)3            -1.4691  1.4155 0.2993 -4.2435  1.3053 0.2301
#> Radiation:Tampascale            0.0367  0.0261 0.1594 -0.0144  0.0878 1.0374
#> Tampascale:factor(Expect_cat)2  0.0571  0.0397 0.1500 -0.0207  0.1349 1.0588
#> Tampascale:factor(Expect_cat)3  0.0422  0.0363 0.2443 -0.0289  0.1134 1.0431
#>                                  L.HR   U.HR
#> Duration                       0.9841 0.9990
#> Previous                       0.5632 1.2157
#> Radiation                      0.0259 1.6748
#> Onset                          0.6319 1.2652
#> Function                       1.0089 1.0798
#> Tampascale                     0.8574 0.9917
#> factor(Expect_cat)2            0.0058 2.9376
#> factor(Expect_cat)3            0.0144 3.6888
#> Radiation:Tampascale           0.9857 1.0918
#> Tampascale:factor(Expect_cat)2 0.9795 1.1444
#> Tampascale:factor(Expect_cat)3 0.9715 1.1201
#> 
#> $`Step 3`
#>                                    est std.err signif   lower   upper     HR
#> Duration                       -0.0087  0.0038 0.0232 -0.0161 -0.0012 0.9913
#> Previous                       -0.1820  0.1959 0.3529 -0.5659  0.2020 0.8336
#> Radiation                      -1.4856  1.0514 0.1577 -3.5468  0.5757 0.2264
#> Function                        0.0431  0.0173 0.0130  0.0091  0.0771 1.0440
#> Tampascale                     -0.0815  0.0371 0.0279 -0.1541 -0.0088 0.9217
#> factor(Expect_cat)2            -2.0787  1.5854 0.1900 -5.1880  1.0307 0.1251
#> factor(Expect_cat)3            -1.5132  1.4132 0.2843 -4.2830  1.2565 0.2202
#> Radiation:Tampascale            0.0347  0.0258 0.1789 -0.0159  0.0852 1.0353
#> Tampascale:factor(Expect_cat)2  0.0583  0.0395 0.1403 -0.0192  0.1358 1.0600
#> Tampascale:factor(Expect_cat)3  0.0435  0.0362 0.2299 -0.0275  0.1145 1.0445
#>                                  L.HR   U.HR
#> Duration                       0.9840 0.9988
#> Previous                       0.5678 1.2238
#> Radiation                      0.0288 1.7784
#> Function                       1.0091 1.0802
#> Tampascale                     0.8572 0.9912
#> factor(Expect_cat)2            0.0056 2.8030
#> factor(Expect_cat)3            0.0138 3.5131
#> Radiation:Tampascale           0.9842 1.0889
#> Tampascale:factor(Expect_cat)2 0.9810 1.1455
#> Tampascale:factor(Expect_cat)3 0.9729 1.1213
#> 
#> $`Step 4`
#>                                    est std.err signif   lower   upper     HR
#> Duration                       -0.0083  0.0038 0.0290 -0.0157 -0.0008 0.9917
#> Radiation                      -1.5430  1.0557 0.1439 -3.6128  0.5268 0.2137
#> Function                        0.0428  0.0173 0.0131  0.0090  0.0767 1.0437
#> Tampascale                     -0.0818  0.0369 0.0269 -0.1542 -0.0094 0.9215
#> factor(Expect_cat)2            -2.1396  1.5729 0.1738 -5.2237  0.9445 0.1177
#> factor(Expect_cat)3            -1.5389  1.4141 0.2765 -4.3105  1.2326 0.2146
#> Radiation:Tampascale            0.0364  0.0259 0.1602 -0.0144  0.0871 1.0371
#> Tampascale:factor(Expect_cat)2  0.0596  0.0392 0.1287 -0.0173  0.1365 1.0614
#> Tampascale:factor(Expect_cat)3  0.0445  0.0362 0.2192 -0.0265  0.1155 1.0455
#>                                  L.HR   U.HR
#> Duration                       0.9844 0.9992
#> Radiation                      0.0270 1.6935
#> Function                       1.0090 1.0797
#> Tampascale                     0.8571 0.9906
#> factor(Expect_cat)2            0.0054 2.5715
#> factor(Expect_cat)3            0.0134 3.4301
#> Radiation:Tampascale           0.9857 1.0910
#> Tampascale:factor(Expect_cat)2 0.9828 1.1463
#> Tampascale:factor(Expect_cat)3 0.9738 1.1224
  pool_coxr$multiparm
#> $`Step 1`
#>                                   D2 p-value D2 & RR
#> Duration                      5.1434          0.0273
#> Previous                      0.7474          0.3766
#> Radiation                     0.3867          0.1206
#> Onset                         0.2946          0.5838
#> Function                      5.3610          0.0168
#> Tampascale                    2.0895          0.0265
#> factor(Satisfaction)          0.3359          0.7149
#> factor(Expect_cat)            0.5157          0.5971
#> Radiation:Tampascale          2.1497          0.1394
#> Tampascale:factor(Expect_cat) 1.0764          0.3412
#> 
#> $`Step 2`
#>                                   D2 p-value D2 & RR
#> Duration                      5.1963          0.0265
#> Previous                      0.8984          0.3344
#> Radiation                     0.3298          0.1401
#> Onset                         0.3915          0.5274
#> Function                      5.7454          0.0135
#> Tampascale                    2.1280          0.0289
#> factor(Expect_cat)            0.5517          0.5759
#> Radiation:Tampascale          1.9506          0.1594
#> Tampascale:factor(Expect_cat) 1.0241          0.3593
#> 
#> $`Step 3`
#>                                   D2 p-value D2 & RR
#> Duration                      5.4502          0.0232
#> Previous                      0.8330          0.3529
#> Radiation                     0.3214          0.1577
#> Function                      5.8119          0.0130
#> Tampascale                    2.2151          0.0279
#> factor(Expect_cat)            0.6014          0.5481
#> Radiation:Tampascale          1.7753          0.1789
#> Tampascale:factor(Expect_cat) 1.0767          0.3409
#> 
#> $`Step 4`
#>                                   D2 p-value D2 & RR
#> Duration                      5.0329          0.0290
#> Radiation                     0.2419          0.1439
#> Function                      5.7889          0.0131
#> Tampascale                    1.9562          0.0269
#> factor(Expect_cat)            0.6180          0.5390
#> Radiation:Tampascale          1.9369          0.1602
#> Tampascale:factor(Expect_cat) 1.1495          0.3169
  pool_coxr$predictors_in
#>        Duration Previous Radiation Onset Function Tampascale
#> Step 1        1        1         1     1        1          1
#> Step 2        1        1         1     1        1          1
#> Step 3        1        1         1     0        1          1
#> Step 4        1        0         1     0        1          1
#>        factor(Satisfaction) factor(Expect_cat) Radiation:Tampascale
#> Step 1                    1                  1                    1
#> Step 2                    0                  1                    1
#> Step 3                    0                  1                    1
#> Step 4                    0                  1                    1
#>        Tampascale:factor(Expect_cat)
#> Step 1                             1
#> Step 2                             1
#> Step 3                             1
#> Step 4                             1

Back to Examples

Pooling with BWS including spline coefficients and method D1

Pooling Cox regression models over 5 imputed datasets with backward selection using a p-value of 0.05 and as method D1 including a restricted cubic spline predictor and forcing Tampascale in the models during backward selection.


  library(psfmi)
  pool_coxr <- psfmi_coxr(data=lbpmicox, nimp=5, impvar="Impnr", time="Time", status="Status",
  predictors=c("Duration", "Previous",  "Radiation", "Onset", "Function"), 
  p.crit=0.05, cat.predictors=c("Satisfaction"), spline.predictors=c("Tampascale"),
  int.predictors=c("Tampascale:Radiation"), keep.predictors = "Tampascale", 
  knots=3, method="D1")
#> Variable excluded at Step 1 is - factor(Satisfaction)
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Previous
#> 
#> Pooled model correctly estimated
#>           using a p-value of 0.05 and predictors to keep rcs(Tampascale,3)
  pool_coxr$RR_Model
#> $`Step 1`
#>                                             est std.err signif   lower   upper
#> Duration                                -0.0087  0.0038 0.0227 -0.0161 -0.0012
#> Previous                                -0.1683  0.2013 0.4030 -0.5629  0.2262
#> Radiation                               -1.5246  1.9303 0.4297 -5.3087  2.2594
#> Onset                                   -0.1231  0.1783 0.4897 -0.4725  0.2263
#> Function                                 0.0487  0.0183 0.0077  0.0129  0.0845
#> factor(Satisfaction)1                   -0.1715  0.3109 0.5832 -0.7930  0.4500
#> factor(Satisfaction)2                   -0.0078  0.3960 0.9844 -0.7987  0.7831
#> rcs(Tampascale, 3)Tampascale            -0.0811  0.0355 0.0223 -0.1507 -0.0116
#> rcs(Tampascale, 3)Tampascale'            0.0634  0.0439 0.1487 -0.0226  0.1494
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0367  0.0539 0.4954 -0.0689  0.1424
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0182  0.0587 0.7563 -0.1332  0.0968
#>                                             HR   L.HR   U.HR
#> Duration                                0.9913 0.9840 0.9988
#> Previous                                0.8451 0.5696 1.2538
#> Radiation                               0.2177 0.0049 9.5773
#> Onset                                   0.8842 0.6234 1.2540
#> Function                                1.0499 1.0130 1.0882
#> factor(Satisfaction)1                   0.8424 0.4525 1.5683
#> factor(Satisfaction)2                   0.9922 0.4499 2.1882
#> rcs(Tampascale, 3)Tampascale            0.9221 0.8601 0.9885
#> rcs(Tampascale, 3)Tampascale'           1.0655 0.9777 1.1611
#> Radiation:rcs(Tampascale, 3)Tampascale  1.0374 0.9334 1.1530
#> Radiation:rcs(Tampascale, 3)Tampascale' 0.9820 0.8753 1.1016
#> 
#> $`Step 2`
#>                                             est std.err signif   lower   upper
#> Duration                                -0.0086  0.0038 0.0242 -0.0160 -0.0011
#> Previous                                -0.1753  0.1970 0.3735 -0.5614  0.2108
#> Radiation                               -1.4583  1.9217 0.4480 -5.2255  2.3090
#> Onset                                   -0.1412  0.1770 0.4251 -0.4881  0.2057
#> Function                                 0.0489  0.0178 0.0061  0.0140  0.0838
#> rcs(Tampascale, 3)Tampascale            -0.0786  0.0351 0.0252 -0.1474 -0.0098
#> rcs(Tampascale, 3)Tampascale'            0.0615  0.0437 0.1588 -0.0241  0.1471
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0356  0.0538 0.5085 -0.0699  0.1410
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0188  0.0588 0.7490 -0.1340  0.0964
#>                                             HR   L.HR    U.HR
#> Duration                                0.9914 0.9841  0.9989
#> Previous                                0.8392 0.5704  1.2347
#> Radiation                               0.2326 0.0054 10.0644
#> Onset                                   0.8683 0.6138  1.2284
#> Function                                1.0501 1.0141  1.0874
#> rcs(Tampascale, 3)Tampascale            0.9244 0.8629  0.9902
#> rcs(Tampascale, 3)Tampascale'           1.0634 0.9762  1.1585
#> Radiation:rcs(Tampascale, 3)Tampascale  1.0362 0.9325  1.1514
#> Radiation:rcs(Tampascale, 3)Tampascale' 0.9814 0.8746  1.1012
#> 
#> $`Step 3`
#>                                             est std.err signif   lower   upper
#> Duration                                -0.0088  0.0038 0.0201 -0.0162 -0.0014
#> Previous                                -0.1652  0.1968 0.4013 -0.5510  0.2206
#> Radiation                               -1.3271  1.9232 0.4902 -5.0972  2.4431
#> Function                                 0.0495  0.0179 0.0056  0.0145  0.0844
#> rcs(Tampascale, 3)Tampascale            -0.0775  0.0353 0.0284 -0.1467 -0.0082
#> rcs(Tampascale, 3)Tampascale'            0.0612  0.0440 0.1644 -0.0251  0.1475
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0323  0.0539 0.5494 -0.0734  0.1379
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0179  0.0591 0.7626 -0.1337  0.0980
#>                                             HR   L.HR    U.HR
#> Duration                                0.9912 0.9839  0.9986
#> Previous                                0.8477 0.5764  1.2468
#> Radiation                               0.2652 0.0061 11.5087
#> Function                                1.0507 1.0146  1.0881
#> rcs(Tampascale, 3)Tampascale            0.9254 0.8636  0.9918
#> rcs(Tampascale, 3)Tampascale'           1.0631 0.9752  1.1589
#> Radiation:rcs(Tampascale, 3)Tampascale  1.0328 0.9292  1.1479
#> Radiation:rcs(Tampascale, 3)Tampascale' 0.9823 0.8749  1.1030
#> 
#> $`Step 4`
#>                                             est std.err signif   lower   upper
#> Duration                                -0.0085  0.0038 0.0247 -0.0159 -0.0011
#> Radiation                               -1.1657  1.9282 0.5455 -4.9462  2.6147
#> Function                                 0.0495  0.0178 0.0055  0.0146  0.0844
#> rcs(Tampascale, 3)Tampascale            -0.0767  0.0356 0.0314 -0.1466 -0.0068
#> rcs(Tampascale, 3)Tampascale'            0.0608  0.0444 0.1703 -0.0261  0.1478
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0278  0.0540 0.6068 -0.0781  0.1338
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0118  0.0589 0.8411 -0.1272  0.1036
#>                                             HR   L.HR    U.HR
#> Duration                                0.9915 0.9842  0.9989
#> Radiation                               0.3117 0.0071 13.6631
#> Function                                1.0507 1.0147  1.0881
#> rcs(Tampascale, 3)Tampascale            0.9262 0.8636  0.9932
#> rcs(Tampascale, 3)Tampascale'           1.0627 0.9742  1.1593
#> Radiation:rcs(Tampascale, 3)Tampascale  1.0282 0.9249  1.1432
#> Radiation:rcs(Tampascale, 3)Tampascale' 0.9883 0.8806  1.1092
  pool_coxr$multiparm
#> $`Step 1`
#>                             Chi_sq p-value D1 & RR
#> Duration                     5.190          0.0227
#> Previous                     0.699          0.4030
#> Radiation                    0.624          0.4297
#> Onset                        0.477          0.4897
#> Function                     7.113          0.0077
#> factor(Satisfaction)         0.294          0.7467
#> rcs(Tampascale,3)            3.103          0.0451
#> Radiation:rcs(Tampascale,3)  0.422          0.6558
#> 
#> $`Step 2`
#>                             Chi_sq p-value D1 & RR
#> Duration                     5.082          0.0242
#> Previous                     0.792          0.3735
#> Radiation                    0.576          0.4480
#> Onset                        0.636          0.4251
#> Function                     7.530          0.0061
#> rcs(Tampascale,3)            2.959          0.0520
#> Radiation:rcs(Tampascale,3)  0.373          0.6887
#> 
#> $`Step 3`
#>                             Chi_sq p-value D1 & RR
#> Duration                     5.405          0.0201
#> Previous                     0.704          0.4013
#> Radiation                    0.476          0.4902
#> Function                     7.674          0.0056
#> rcs(Tampascale,3)            2.839          0.0586
#> Radiation:rcs(Tampascale,3)  0.298          0.7423
#> 
#> $`Step 4`
#>                             Chi_sq p-value D1 & RR
#> Duration                     5.048          0.0247
#> Radiation                    0.366          0.5455
#> Function                     7.716          0.0055
#> rcs(Tampascale,3)            2.745          0.0644
#> Radiation:rcs(Tampascale,3)  0.281          0.7550
  pool_coxr$predictors_in
#>        Duration Previous Radiation Onset Function factor(Satisfaction)
#> Step 1        1        1         1     1        1                    1
#> Step 2        1        1         1     1        1                    0
#> Step 3        1        1         1     0        1                    0
#> Step 4        1        0         1     0        1                    0
#>        rcs(Tampascale,3) Radiation:rcs(Tampascale,3)
#> Step 1                 1                           1
#> Step 2                 1                           1
#> Step 3                 1                           1
#> Step 4                 1                           1

Back to Examples

Stability analysis

Stability analysis of Logistic regression model


  library(psfmi)
  psfmi_res <- psfmi_lr(data=lbpmilr, nimp=5, impvar="Impnr", Outcome="Chronic",
                      predictors=c("Gender", "Smoking", "JobControl", "Age", "Duration",
                         "JobDemands", "SocialSupport"), p.crit =0.157, method="MPR",
                      cat.predictors = "Satisfaction", int.predictors = c("Gender:JobControl"))
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - JobDemands
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - factor(Satisfaction)
#> Variable excluded at Step 5 is - Gender:JobControl
#> Variable excluded at Step 6 is - JobControl
#> Variable excluded at Step 7 is - SocialSupport
#> Variable excluded at Step 8 is - Age

  stab_res <- psfmi_stab(psfmi_res, boot_method = "single", nboot=20)
#> 
#> Boot 1
#> Variable excluded at Step 1 is - Age
#> Variable excluded at Step 2 is - Gender:JobControl
#> Variable excluded at Step 3 is - JobDemands
#> Variable excluded at Step 4 is - Smoking
#> Variable excluded at Step 5 is - JobControl
#> Variable excluded at Step 6 is - SocialSupport
#> Variable excluded at Step 7 is - Duration
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> 
#> Boot 2
#> Variable excluded at Step 1 is - Gender:JobControl
#> Variable excluded at Step 2 is - JobDemands
#> Variable excluded at Step 3 is - JobControl
#> Variable excluded at Step 4 is - Smoking
#> Variable excluded at Step 5 is - Duration
#> Variable excluded at Step 6 is - Age
#> Variable excluded at Step 7 is - SocialSupport
#> Variable excluded at Step 8 is - Gender
#> Variable excluded at Step 9 is - factor(Satisfaction)
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 3
#> Variable excluded at Step 1 is - Gender:JobControl
#> Variable excluded at Step 2 is - JobControl
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - JobDemands
#> Variable excluded at Step 5 is - Smoking
#> Variable excluded at Step 6 is - factor(Satisfaction)
#> Variable excluded at Step 7 is - SocialSupport
#> Variable excluded at Step 8 is - Age
#> 
#> Boot 4
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - JobDemands
#> Variable excluded at Step 3 is - Gender:JobControl
#> Variable excluded at Step 4 is - JobControl
#> Variable excluded at Step 5 is - Duration
#> Variable excluded at Step 6 is - SocialSupport
#> Variable excluded at Step 7 is - Gender
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> 
#> Boot 5
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - SocialSupport
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - Gender:JobControl
#> Variable excluded at Step 5 is - JobDemands
#> Variable excluded at Step 6 is - JobControl
#> Variable excluded at Step 7 is - Gender
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> 
#> Boot 6
#> Variable excluded at Step 1 is - SocialSupport
#> Variable excluded at Step 2 is - Smoking
#> Variable excluded at Step 3 is - Gender:JobControl
#> Variable excluded at Step 4 is - JobControl
#> Variable excluded at Step 5 is - JobDemands
#> Variable excluded at Step 6 is - Duration
#> Variable excluded at Step 7 is - Age
#> Variable excluded at Step 8 is - Gender
#> Variable excluded at Step 9 is - factor(Satisfaction)
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 7
#> Variable excluded at Step 1 is - Duration
#> Variable excluded at Step 2 is - Smoking
#> Variable excluded at Step 3 is - Gender:JobControl
#> Variable excluded at Step 4 is - JobControl
#> Variable excluded at Step 5 is - JobDemands
#> Variable excluded at Step 6 is - SocialSupport
#> Variable excluded at Step 7 is - factor(Satisfaction)
#> Variable excluded at Step 8 is - Gender
#> Variable excluded at Step 9 is - Age
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 8
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - Age
#> Variable excluded at Step 3 is - SocialSupport
#> Variable excluded at Step 4 is - factor(Satisfaction)
#> Variable excluded at Step 5 is - JobDemands
#> Variable excluded at Step 6 is - Duration
#> Variable excluded at Step 7 is - Gender:JobControl
#> Variable excluded at Step 8 is - Gender
#> Variable excluded at Step 9 is - JobControl
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 9
#> Variable excluded at Step 1 is - Duration
#> Variable excluded at Step 2 is - Gender:JobControl
#> Variable excluded at Step 3 is - JobControl
#> Variable excluded at Step 4 is - Smoking
#> Variable excluded at Step 5 is - factor(Satisfaction)
#> Variable excluded at Step 6 is - Gender
#> Variable excluded at Step 7 is - SocialSupport
#> Variable excluded at Step 8 is - JobDemands
#> Variable excluded at Step 9 is - Age
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 10
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - Duration
#> Variable excluded at Step 3 is - SocialSupport
#> Variable excluded at Step 4 is - JobDemands
#> Variable excluded at Step 5 is - Gender:JobControl
#> Variable excluded at Step 6 is - Age
#> Variable excluded at Step 7 is - JobControl
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> 
#> Boot 11
#> Variable excluded at Step 1 is - Duration
#> Variable excluded at Step 2 is - Gender:JobControl
#> Variable excluded at Step 3 is - SocialSupport
#> Variable excluded at Step 4 is - JobDemands
#> Variable excluded at Step 5 is - JobControl
#> Variable excluded at Step 6 is - Smoking
#> Variable excluded at Step 7 is - Age
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> 
#> Boot 12
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - JobDemands
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - Gender:JobControl
#> Variable excluded at Step 5 is - SocialSupport
#> Variable excluded at Step 6 is - Age
#> Variable excluded at Step 7 is - factor(Satisfaction)
#> Variable excluded at Step 8 is - Gender
#> Variable excluded at Step 9 is - JobControl
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 13
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - SocialSupport
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - Gender:JobControl
#> Variable excluded at Step 5 is - JobControl
#> Variable excluded at Step 6 is - Gender
#> Variable excluded at Step 7 is - JobDemands
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> Variable excluded at Step 9 is - Age
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 14
#> Variable excluded at Step 1 is - Duration
#> Variable excluded at Step 2 is - Smoking
#> Variable excluded at Step 3 is - JobDemands
#> Variable excluded at Step 4 is - Gender:JobControl
#> Variable excluded at Step 5 is - JobControl
#> Variable excluded at Step 6 is - factor(Satisfaction)
#> Variable excluded at Step 7 is - SocialSupport
#> Variable excluded at Step 8 is - Age
#> 
#> Boot 15
#> Variable excluded at Step 1 is - SocialSupport
#> Variable excluded at Step 2 is - Gender:JobControl
#> Variable excluded at Step 3 is - Age
#> Variable excluded at Step 4 is - Smoking
#> Variable excluded at Step 5 is - JobControl
#> Variable excluded at Step 6 is - Duration
#> Variable excluded at Step 7 is - Gender
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> Variable excluded at Step 9 is - JobDemands
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 16
#> Variable excluded at Step 1 is - SocialSupport
#> Variable excluded at Step 2 is - Smoking
#> Variable excluded at Step 3 is - JobDemands
#> Variable excluded at Step 4 is - factor(Satisfaction)
#> Variable excluded at Step 5 is - Duration
#> Variable excluded at Step 6 is - Age
#> Variable excluded at Step 7 is - Gender:JobControl
#> Variable excluded at Step 8 is - JobControl
#> Variable excluded at Step 9 is - Gender
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 17
#> Variable excluded at Step 1 is - Gender:JobControl
#> Variable excluded at Step 2 is - Smoking
#> Variable excluded at Step 3 is - JobDemands
#> Variable excluded at Step 4 is - JobControl
#> Variable excluded at Step 5 is - Duration
#> Variable excluded at Step 6 is - Age
#> Variable excluded at Step 7 is - factor(Satisfaction)
#> Variable excluded at Step 8 is - SocialSupport
#> Variable excluded at Step 9 is - Gender
#> 
#> Selection correctly terminated, 
#> Model is empty after last step
#> 
#> Boot 18
#> Variable excluded at Step 1 is - Smoking
#> Variable excluded at Step 2 is - SocialSupport
#> Variable excluded at Step 3 is - JobDemands
#> Variable excluded at Step 4 is - Gender:JobControl
#> Variable excluded at Step 5 is - Duration
#> Variable excluded at Step 6 is - JobControl
#> Variable excluded at Step 7 is - Gender
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> 
#> Boot 19
#> Variable excluded at Step 1 is - SocialSupport
#> Variable excluded at Step 2 is - Smoking
#> Variable excluded at Step 3 is - Age
#> Variable excluded at Step 4 is - Duration
#> Variable excluded at Step 5 is - Gender:JobControl
#> Variable excluded at Step 6 is - JobControl
#> Variable excluded at Step 7 is - factor(Satisfaction)
#> Variable excluded at Step 8 is - JobDemands
#> 
#> Boot 20
#> Variable excluded at Step 1 is - Gender:JobControl
#> Variable excluded at Step 2 is - JobDemands
#> Variable excluded at Step 3 is - JobControl
#> Variable excluded at Step 4 is - Smoking
#> Variable excluded at Step 5 is - factor(Satisfaction)
#> Variable excluded at Step 6 is - Duration
#> Variable excluded at Step 7 is - SocialSupport
#> Variable excluded at Step 8 is - Age
  stab_res
#> $bif
#>         Gender Smoking JobControl Age Duration JobDemands SocialSupport
#> boot 1       1       0          0   0        0          0             0
#> boot 2       0       0          0   0        0          0             0
#> boot 3       1       0          0   0        0          0             0
#> boot 4       0       0          0   1        0          0             0
#> boot 5       0       0          0   1        0          0             0
#> boot 6       0       0          0   0        0          0             0
#> boot 7       0       0          0   0        0          0             0
#> boot 8       0       0          0   0        0          0             0
#> boot 9       0       0          0   0        0          0             0
#> boot 10      1       0          0   0        0          0             0
#> boot 11      1       0          0   0        0          0             0
#> boot 12      0       0          0   0        0          0             0
#> boot 13      0       0          0   0        0          0             0
#> boot 14      1       0          0   0        0          0             0
#> boot 15      0       0          0   0        0          0             0
#> boot 16      0       0          0   0        0          0             0
#> boot 17      0       0          0   0        0          0             0
#> boot 18      0       0          0   1        0          0             0
#> boot 19      1       0          0   0        0          0             0
#> boot 20      1       0          0   0        0          0             0
#>         factor(Satisfaction) Gender:JobControl
#> boot 1                     0                 0
#> boot 2                     0                 0
#> boot 3                     0                 0
#> boot 4                     0                 0
#> boot 5                     0                 0
#> boot 6                     0                 0
#> boot 7                     0                 0
#> boot 8                     0                 0
#> boot 9                     0                 0
#> boot 10                    0                 0
#> boot 11                    0                 0
#> boot 12                    0                 0
#> boot 13                    0                 0
#> boot 14                    0                 0
#> boot 15                    0                 0
#> boot 16                    0                 0
#> boot 17                    0                 0
#> boot 18                    0                 0
#> boot 19                    0                 0
#> boot 20                    0                 0
#> 
#> $bif_total
#>               Gender              Smoking           JobControl 
#>                    7                    0                    0 
#>                  Age             Duration           JobDemands 
#>                    3                    0                    0 
#>        SocialSupport factor(Satisfaction)    Gender:JobControl 
#>                    0                    0                    0 
#> 
#> $bif_perc
#>               Gender              Smoking           JobControl 
#>                   35                    0                    0 
#>                  Age             Duration           JobDemands 
#>                   15                    0                    0 
#>        SocialSupport factor(Satisfaction)    Gender:JobControl 
#>                    0                    0                    0 
#> 
#> $model_stab
#>   Gender Smoking JobControl Age Duration JobDemands SocialSupport
#> 1      0       0          0   0        0          0             0
#> 2      1       0          0   0        0          0             0
#> 3      0       0          0   1        0          0             0
#>   factor(Satisfaction) Gender:JobControl freq bif_pat_perc
#> 1                    0                 0   10           50
#> 2                    0                 0    7           35
#> 3                    0                 0    3           15
#> 
#> $call
#> psfmi_stab(pobj = psfmi_res, boot_method = "single", nboot = 20)

Back to Examples

Stability analysis of Cox regression model


  library(psfmi)
  psfmi_res <- psfmi_coxr(data=lbpmicox, impvar="Impnr", nimp=5,  p.crit=0.157, method="MPR",
           predictors=c("Duration", "Previous",  "Radiation", "Onset"),
           time="Time", status="Status", spline.predictors = "Tampascale", knots=3)
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous

  stab_res <- psfmi_stab(psfmi_res, boot_method = "single", nboot=20)
#> 
#> Boot 1
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 2
#> Variable excluded at Step 1 is - Previous
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 3
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 4
#> Variable excluded at Step 1 is - Previous
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 5
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 6
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 7
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> 
#> Boot 8
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Duration
#> Variable excluded at Step 3 is - Radiation
#> Variable excluded at Step 4 is - Previous
#> 
#> Boot 9
#> Variable excluded at Step 1 is - Previous
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 10
#> Variable excluded at Step 1 is - Radiation
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Onset
#> 
#> Boot 11
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 12
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 13
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - rcs(Tampascale,3)
#> 
#> Boot 14
#> Variable excluded at Step 1 is - Radiation
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Previous
#> 
#> Boot 15
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 16
#> Variable excluded at Step 1 is - Previous
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 17
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 18
#> Variable excluded at Step 1 is - Previous
#> Variable excluded at Step 2 is - Onset
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 19
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Radiation
#> 
#> Boot 20
#> Variable excluded at Step 1 is - Onset
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Duration
#> Variable excluded at Step 4 is - Radiation
  stab_res
#> $bif
#>         Duration Previous Radiation Onset rcs(Tampascale,3)
#> boot 1         1        0         0     0                 1
#> boot 2         1        0         0     0                 1
#> boot 3         1        0         0     0                 1
#> boot 4         1        0         0     0                 1
#> boot 5         1        0         0     0                 1
#> boot 6         1        0         0     0                 1
#> boot 7         1        0         1     0                 1
#> boot 8         0        0         0     0                 1
#> boot 9         1        0         0     0                 1
#> boot 10        1        0         0     0                 1
#> boot 11        1        0         0     0                 1
#> boot 12        1        0         0     0                 1
#> boot 13        0        0         1     0                 0
#> boot 14        1        0         0     0                 1
#> boot 15        1        0         0     0                 1
#> boot 16        1        0         0     0                 1
#> boot 17        1        0         0     0                 1
#> boot 18        1        0         0     0                 1
#> boot 19        1        0         0     0                 1
#> boot 20        0        0         0     0                 1
#> 
#> $bif_total
#>          Duration          Previous         Radiation             Onset 
#>                17                 0                 2                 0 
#> rcs(Tampascale,3) 
#>                19 
#> 
#> $bif_perc
#>          Duration          Previous         Radiation             Onset 
#>                85                 0                10                 0 
#> rcs(Tampascale,3) 
#>                95 
#> 
#> $model_stab
#>   Duration Previous Radiation Onset rcs(Tampascale,3) freq bif_pat_perc
#> 1        1        0         0     0                 1   16           80
#> 2        0        0         0     0                 1    2           10
#> 3        0        0         1     0                 0    1            5
#> 4        1        0         1     0                 1    1            5
#> 
#> $call
#> psfmi_stab(pobj = psfmi_res, boot_method = "single", nboot = 20)

Back to Examples