Welcome to the psfmi package

Martijn W Heymans

2019-05-14

Introduction

On this page you will find information of the psfmi package. The package contains functions to apply pooling or backward selection (BS) for logistic or Cox regression prediction models.

The basic pooling method is Rubin’s Rules. New is that for categorical predictors, different methods to derive pooled p-values are available as: the total covariance matrix (D1 method), pooling Chi-square values (D2 method), pooling Likelihood ratio statistics (method of Meng and Rubin) or pooling the median p-values (MPR rule). Moreover, two-way interaction terms between continuous, dichotomous and categorical predictors are allowed during BS. Also, all type of predictors, interaction terms or a combination, can be forced in the model during BS. For very large datasets and a large number of imputed datasets the D1 and D3 methods may be less efficient than the D2 and MPR methods.

The package also contains functions to generate apparent model performance measures over imputed datasets as ROC/AUC, Nagelkerke R-squares, Hosmer & Lemeshow test values and calibration plots. A wrapper function over Frank Harrell’s validate function is available. Bootstrap internal validation is performed in each imputed dataset and results are pooled. BS as part of internal validation is optional and recommended. A function with the name mivalext_lr can be used to externally validate prediction models in multiple 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 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 multiple imputed datasets

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

miperform_lr: for performance and internal validation of logistic regression models in multiple imputed datasets

mivalext_lr: external validation in multiple imputed datasets

Examples

Logistic Regression

Pooling without BS and method D1

Back to Examples

Pooling with BS and method D3

Pooling Logistic regression models over 5 imputed datasets with backward selection using a p-value of 0.05 and as method D3 (Meng and Rubin likelihood ratio statistics) 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="D3")
#> Variable excluded at Step 1 is - JobControl
#> Variable excluded at Step 2 is - JobDemands
#> 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
#> (Intercept)    1.1637  2.2828 0.6102 -3.3104  5.6379 3.2018 0.0365
#> Gender        -0.4220  0.4073 0.3001 -1.2202  0.3762 0.6557 0.2952
#> Smoking        0.1164  0.3407 0.7327 -0.5515  0.7842 1.1234 0.5761
#> Function      -0.1457  0.0421 0.0005 -0.2282 -0.0632 0.8644 0.7959
#> JobControl     0.0021  0.0191 0.9145 -0.0355  0.0396 1.0021 0.9652
#> JobDemands    -0.0087  0.0357 0.8065 -0.0787  0.0612 0.9913 0.9243
#> SocialSupport  0.0249  0.0540 0.6449 -0.0810  0.1308 1.0252 0.9222
#>                   U.OR
#> (Intercept)   280.8649
#> Gender          1.4568
#> Smoking         2.1907
#> Function        0.9387
#> JobControl      1.0404
#> JobDemands      1.0632
#> SocialSupport   1.1397
#> 
#> $`Step 2`
#>                   est std.err signif   lower   upper     OR   L.OR
#> (Intercept)    1.3088  1.8407 0.4770 -2.2988  4.9164 3.7019 0.1004
#> Gender        -0.4296  0.4012 0.2843 -1.2158  0.3567 0.6508 0.2965
#> Smoking        0.1173  0.3406 0.7305 -0.5502  0.7849 1.1245 0.5768
#> Function      -0.1450  0.0415 0.0005 -0.2262 -0.0637 0.8651 0.7975
#> JobDemands    -0.0089  0.0357 0.8019 -0.0788  0.0610 0.9911 0.9242
#> SocialSupport  0.0239  0.0532 0.6532 -0.0804  0.1282 1.0242 0.9228
#>                   U.OR
#> (Intercept)   136.5169
#> Gender          1.4286
#> Smoking         2.1922
#> Function        0.9383
#> JobDemands      1.0628
#> SocialSupport   1.1367
#> 
#> $`Step 3`
#>                   est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)    0.9989  1.3631 0.4637 -1.6728  3.6705 2.7152 0.1877 39.2713
#> Gender        -0.4128  0.3955 0.2966 -1.1880  0.3624 0.6618 0.3048  1.4367
#> Smoking        0.1177  0.3406 0.7298 -0.5499  0.7852 1.1249 0.5770  2.1929
#> Function      -0.1448  0.0414 0.0005 -0.2260 -0.0636 0.8652 0.7977  0.9384
#> SocialSupport  0.0236  0.0532 0.6575 -0.0806  0.1278 1.0239 0.9225  1.1363
#> 
#> $`Step 4`
#>                 est std.err signif   lower   upper     OR   L.OR    U.OR
#> (Intercept)  1.5547  0.5442 0.0043  0.4882  2.6212 4.7337 1.6293 13.7527
#> Gender      -0.4212  0.3944 0.2855 -1.1943  0.3518 0.6562 0.3029  1.4216
#> Smoking      0.1133  0.3402 0.7392 -0.5535  0.7800 1.1199 0.5749  2.1815
#> Function    -0.1445  0.0414 0.0005 -0.2257 -0.0633 0.8654 0.7980  0.9386
#> 
#> $`Step 5`
#>                 est std.err signif   lower   upper     OR   L.OR   U.OR
#> (Intercept)  1.2804  0.4737 0.0069  0.3519  2.2089 3.5981 1.4218 9.1058
#> Smoking      0.1087  0.3389 0.7485 -0.5555  0.7728 1.1148 0.5738 2.1658
#> Function    -0.1486  0.0412 0.0003 -0.2293 -0.0679 0.8619 0.7951 0.9343
  pool_lr$multiparm_p
#> $`Step 1`
#>               D3 p-values
#> Gender             0.3001
#> Smoking            0.7327
#> Function           0.0005
#> JobControl         0.9145
#> JobDemands         0.8065
#> SocialSupport      0.6449
#> 
#> $`Step 2`
#>               D3 p-values
#> Gender             0.2843
#> Smoking            0.7305
#> Function           0.0005
#> JobDemands         0.8019
#> SocialSupport      0.6532
#> 
#> $`Step 3`
#>               D3 p-values
#> Gender             0.2966
#> Smoking            0.7298
#> Function           0.0005
#> SocialSupport      0.6575
#> 
#> $`Step 4`
#>          D3 p-values
#> Gender        0.2855
#> Smoking       0.7392
#> Function      0.0005
#> 
#> $`Step 5`
#>          D3 p-values
#> Smoking       0.7485
#> Function      0.0003

Back to Examples

Pooling with BS including several interaction terms and method D2

Pooling Logistic regression models over 5 imputed datasets with BS using a p-value of 0.05 and as method D1. Several interaction terms, including with 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", "JobDemands",
  "SocialSupport"), p.crit = 0.05, cat.predictors = c("Carrying", "Satisfaction"),
  int.predictors = c("Carrying:Smoking", "Gender:Smoking"), method="D2")
#> Registered S3 methods overwritten by 'lme4':
#>   method                          from
#>   cooks.distance.influence.merMod car 
#>   influence.merMod                car 
#>   dfbeta.influence.merMod         car 
#>   dfbetas.influence.merMod        car
#> 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 - Smoking:factor(Carrying)
#> Variable excluded at Step 5 is - Gender:Smoking
#> Variable excluded at Step 6 is - Smoking
#> Variable excluded at Step 7 is - Gender
#> Variable excluded at Step 8 is - factor(Satisfaction)
#> Variable excluded at Step 9 is - Function
  pool_lr$RR_Model
#> $`Step 1`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.2658  2.7332 0.9226 -5.0995 5.6311 1.3045
#> Gender                    -0.9613  0.6239 0.1238 -2.1862 0.2636 0.3824
#> Smoking                   -2.4473  1.5169 0.1115 -5.4769 0.5823 0.0865
#> Function                  -0.0792  0.0504 0.1173 -0.1783 0.0200 0.9239
#> JobControl                -0.0071  0.0213 0.7399 -0.0488 0.0347 0.9930
#> JobDemands                 0.0019  0.0400 0.9616 -0.0765 0.0803 1.0019
#> SocialSupport              0.0473  0.0593 0.4254 -0.0690 0.1635 1.0484
#> factor(Carrying)2          0.4834  0.6996 0.4898 -0.8908 1.8577 1.6216
#> factor(Carrying)3          1.6765  0.6702 0.0126  0.3603 2.9928 5.3471
#> factor(Satisfaction)2     -0.5596  0.5426 0.3069 -1.6473 0.5280 0.5714
#> factor(Satisfaction)3     -1.0948  0.5989 0.0682 -2.2718 0.0822 0.3346
#> Smoking:factor(Carrying)2  2.1009  1.3864 0.1330 -0.6509 4.8526 8.1731
#> Smoking:factor(Carrying)3  1.9226  1.4998 0.2064 -1.0981 4.9432 6.8384
#> Gender:Smoking             1.1125  0.8993 0.2161 -0.6504 2.8753 3.0418
#>                             L.OR     U.OR
#> (Intercept)               0.0061 278.9559
#> Gender                    0.1123   1.3016
#> Smoking                   0.0042   1.7902
#> Function                  0.8367   1.0202
#> JobControl                0.9523   1.0353
#> JobDemands                0.9264   1.0837
#> SocialSupport             0.9333   1.1777
#> factor(Carrying)2         0.4103   6.4091
#> factor(Carrying)3         1.4338  19.9412
#> factor(Satisfaction)2     0.1926   1.6955
#> factor(Satisfaction)3     0.1031   1.0857
#> Smoking:factor(Carrying)2 0.5216 128.0779
#> Smoking:factor(Carrying)3 0.3335 140.2179
#> Gender:Smoking            0.5218  17.7305
#> 
#> $`Step 2`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.3385  2.2237 0.8790 -4.0229 4.6998 1.4028
#> Gender                    -0.9650  0.6179 0.1187 -2.1778 0.2478 0.3810
#> Smoking                   -2.4450  1.5196 0.1126 -5.4813 0.5912 0.0867
#> Function                  -0.0793  0.0505 0.1173 -0.1786 0.0200 0.9238
#> JobControl                -0.0071  0.0212 0.7374 -0.0487 0.0345 0.9929
#> SocialSupport              0.0473  0.0593 0.4251 -0.0690 0.1636 1.0485
#> factor(Carrying)2          0.4799  0.6966 0.4911 -0.8881 1.8479 1.6159
#> factor(Carrying)3          1.6721  0.6657 0.0123  0.3648 2.9794 5.3232
#> factor(Satisfaction)2     -0.5588  0.5421 0.3072 -1.6455 0.5278 0.5719
#> factor(Satisfaction)3     -1.0935  0.5985 0.0683 -2.2696 0.0827 0.3350
#> Smoking:factor(Carrying)2  2.1003  1.3873 0.1334 -0.6539 4.8546 8.1690
#> Smoking:factor(Carrying)3  1.9227  1.4953 0.2051 -1.0887 4.9341 6.8396
#> Gender:Smoking             1.1100  0.8987 0.2168 -0.6517 2.8717 3.0344
#>                             L.OR     U.OR
#> (Intercept)               0.0179 109.9297
#> Gender                    0.1133   1.2812
#> Smoking                   0.0042   1.8062
#> Function                  0.8364   1.0202
#> JobControl                0.9524   1.0351
#> SocialSupport             0.9334   1.1777
#> factor(Carrying)2         0.4114   6.3462
#> factor(Carrying)3         1.4402  19.6753
#> factor(Satisfaction)2     0.1929   1.6952
#> factor(Satisfaction)3     0.1034   1.0862
#> Smoking:factor(Carrying)2 0.5200 128.3243
#> Smoking:factor(Carrying)3 0.3367 138.9520
#> Gender:Smoking            0.5212  17.6674
#> 
#> $`Step 3`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)               -0.1239  1.7169 0.9425 -3.4897 3.2419 0.8835
#> Gender                    -0.9389  0.6130 0.1260 -2.1420 0.2643 0.3911
#> Smoking                   -2.4290  1.5155 0.1138 -5.4547 0.5967 0.0881
#> Function                  -0.0824  0.0493 0.0952 -0.1793 0.0144 0.9209
#> SocialSupport              0.0501  0.0587 0.3932 -0.0649 0.1651 1.0514
#> factor(Carrying)2          0.4708  0.6969 0.4997 -0.8982 1.8397 1.6012
#> factor(Carrying)3          1.6785  0.6644 0.0118  0.3735 2.9834 5.3573
#> factor(Satisfaction)2     -0.5587  0.5417 0.3069 -1.6445 0.5270 0.5719
#> factor(Satisfaction)3     -1.0769  0.5945 0.0707 -2.2451 0.0913 0.3407
#> Smoking:factor(Carrying)2  2.1063  1.3887 0.1327 -0.6511 4.8637 8.2176
#> Smoking:factor(Carrying)3  1.8711  1.4732 0.2101 -1.0897 4.8319 6.4956
#> Gender:Smoking             1.1070  0.8996 0.2185 -0.6565 2.8705 3.0253
#>                             L.OR     U.OR
#> (Intercept)               0.0305  25.5826
#> Gender                    0.1174   1.3025
#> Smoking                   0.0043   1.8161
#> Function                  0.8359   1.0145
#> SocialSupport             0.9371   1.1796
#> factor(Carrying)2         0.4073   6.2949
#> factor(Carrying)3         1.4528  19.7549
#> factor(Satisfaction)2     0.1931   1.6939
#> factor(Satisfaction)3     0.1059   1.0956
#> Smoking:factor(Carrying)2 0.5215 129.5012
#> Smoking:factor(Carrying)3 0.3363 125.4551
#> Gender:Smoking            0.5187  17.6463
#> 
#> $`Step 4`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                1.0947  0.9510 0.2498 -0.7700 2.9593 2.9882
#> Gender                    -0.9403  0.6077 0.1221 -2.1327 0.2522 0.3905
#> Smoking                   -2.4432  1.5069 0.1097 -5.4515 0.5652 0.0869
#> Function                  -0.0825  0.0491 0.0939 -0.1790 0.0141 0.9208
#> factor(Carrying)2          0.4225  0.6862 0.5384 -0.9249 1.7698 1.5257
#> factor(Carrying)3          1.6197  0.6573 0.0140  0.3291 2.9103 5.0517
#> factor(Satisfaction)2     -0.5694  0.5452 0.3014 -1.6648 0.5259 0.5658
#> factor(Satisfaction)3     -1.0750  0.5964 0.0722 -2.2475 0.0976 0.3413
#> Smoking:factor(Carrying)2  2.1715  1.3808 0.1191 -0.5694 4.9123 8.7714
#> Smoking:factor(Carrying)3  1.9067  1.4703 0.2008 -1.0478 4.8611 6.7307
#> Gender:Smoking             1.0662  0.8899 0.2309 -0.6783 2.8107 2.9044
#>                             L.OR     U.OR
#> (Intercept)               0.4630  19.2841
#> Gender                    0.1185   1.2868
#> Smoking                   0.0043   1.7598
#> Function                  0.8361   1.0142
#> factor(Carrying)2         0.3966   5.8697
#> factor(Carrying)3         1.3897  18.3630
#> factor(Satisfaction)2     0.1892   1.6920
#> factor(Satisfaction)3     0.1057   1.1025
#> Smoking:factor(Carrying)2 0.5659 135.9577
#> Smoking:factor(Carrying)3 0.3507 129.1689
#> Gender:Smoking            0.5075  16.6218
#> 
#> $`Step 5`
#>                           est std.err signif   lower  upper     OR   L.OR
#> (Intercept)            0.5748  0.9102 0.5277 -1.2093 2.3589 1.7768 0.2984
#> Gender                -0.8525  0.6086 0.1618 -2.0477 0.3427 0.4264 0.1290
#> Smoking               -0.5830  0.7527 0.4386 -2.0589 0.8928 0.5582 0.1276
#> Function              -0.0844  0.0496 0.0891 -0.1818 0.0130 0.9190 0.8337
#> factor(Carrying)2      1.2044  0.5108 0.0185  0.2027 2.2061 3.3347 1.2247
#> factor(Carrying)3      2.1898  0.5826 0.0002  1.0421 3.3375 8.9336 2.8351
#> factor(Satisfaction)2 -0.5717  0.5181 0.2735 -1.6046 0.4613 0.5646 0.2010
#> factor(Satisfaction)3 -1.1332  0.5855 0.0535 -2.2836 0.0172 0.3220 0.1019
#> Gender:Smoking         0.8071  0.8661 0.3514 -0.8907 2.5050 2.2415 0.4104
#>                          U.OR
#> (Intercept)           10.5790
#> Gender                 1.4088
#> Smoking                2.4419
#> Function               1.0130
#> factor(Carrying)2      9.0800
#> factor(Carrying)3     28.1500
#> factor(Satisfaction)2  1.5861
#> factor(Satisfaction)3  1.0174
#> Gender:Smoking        12.2433
#> 
#> $`Step 6`
#>                           est std.err signif   lower  upper     OR   L.OR
#> (Intercept)            0.3384  0.8699 0.6973 -1.3666 2.0433 1.4026 0.2550
#> Gender                -0.4854  0.4477 0.2786 -1.3643 0.3935 0.6155 0.2556
#> Smoking                0.0198  0.3768 0.9582 -0.7189 0.7584 1.0199 0.4873
#> Function              -0.0853  0.0493 0.0841 -0.1820 0.0115 0.9183 0.8336
#> factor(Carrying)2      1.2046  0.5090 0.0180  0.2065 2.2027 3.3354 1.2294
#> factor(Carrying)3      2.1321  0.5681 0.0002  1.0147 3.2495 8.4327 2.7586
#> factor(Satisfaction)2 -0.5885  0.5144 0.2563 -1.6135 0.4364 0.5551 0.1992
#> factor(Satisfaction)3 -1.1106  0.5800 0.0561 -2.2500 0.0288 0.3294 0.1054
#>                          U.OR
#> (Intercept)            7.7163
#> Gender                 1.4821
#> Smoking                2.1349
#> Function               1.0116
#> factor(Carrying)2      9.0495
#> factor(Carrying)3     25.7780
#> factor(Satisfaction)2  1.5472
#> factor(Satisfaction)3  1.0292
#> 
#> $`Step 7`
#>                           est std.err signif   lower  upper     OR   L.OR
#> (Intercept)            0.3455  0.8629 0.6889 -1.3459 2.0369 1.4127 0.2603
#> Gender                -0.4844  0.4473 0.2792 -1.3626 0.3938 0.6161 0.2560
#> Function              -0.0851  0.0490 0.0832 -0.1813 0.0112 0.9185 0.8342
#> factor(Carrying)2      1.2067  0.5043 0.0168  0.2179 2.1954 3.3423 1.2435
#> factor(Carrying)3      2.1311  0.5681 0.0002  1.0136 3.2487 8.4243 2.7554
#> factor(Satisfaction)2 -0.5907  0.5112 0.2514 -1.6087 0.4272 0.5539 0.2001
#> factor(Satisfaction)3 -1.1123  0.5762 0.0541 -2.2442 0.0196 0.3288 0.1060
#>                          U.OR
#> (Intercept)            7.6664
#> Gender                 1.4826
#> Function               1.0113
#> factor(Carrying)2      8.9837
#> factor(Carrying)3     25.7561
#> factor(Satisfaction)2  1.5330
#> factor(Satisfaction)3  1.0198
#> 
#> $`Step 8`
#>                           est std.err signif   lower  upper     OR   L.OR
#> (Intercept)           -0.0227  0.8026 0.9774 -1.5966 1.5511 0.9775 0.2026
#> Function              -0.0905  0.0483 0.0610 -0.1853 0.0042 0.9134 0.8309
#> factor(Carrying)2      1.2844  0.4951 0.0095  0.3136 2.2551 3.6124 1.3684
#> factor(Carrying)3      2.1134  0.5610 0.0002  1.0105 3.2163 8.2766 2.7471
#> factor(Satisfaction)2 -0.5466  0.5106 0.2880 -1.5649 0.4717 0.5789 0.2091
#> factor(Satisfaction)3 -1.0463  0.5745 0.0693 -2.1757 0.0830 0.3512 0.1135
#>                          U.OR
#> (Intercept)            4.7166
#> Function               1.0042
#> factor(Carrying)2      9.5361
#> factor(Carrying)3     24.9363
#> factor(Satisfaction)2  1.6028
#> factor(Satisfaction)3  1.0866
#> 
#> $`Step 9`
#>                       est std.err signif   lower  upper     OR   L.OR
#> (Intercept)       -0.6220  0.7120 0.3825 -2.0184 0.7745 0.5369 0.1329
#> Function          -0.0764  0.0466 0.1013 -0.1677 0.0150 0.9265 0.8456
#> factor(Carrying)2  1.2674  0.4852 0.0090  0.3163 2.2184 3.5515 1.3720
#> factor(Carrying)3  1.9358  0.5387 0.0004  0.8773 2.9943 6.9297 2.4044
#>                      U.OR
#> (Intercept)        2.1694
#> Function           1.0151
#> factor(Carrying)2  9.1928
#> factor(Carrying)3 19.9721
#> 
#> $`Step 10`
#>                       est std.err signif   lower   upper     OR   L.OR
#> (Intercept)       -1.6153  0.3860 0.0000 -2.3718 -0.8588 0.1988 0.0933
#> factor(Carrying)2  1.3988  0.4780 0.0034  0.4618  2.3358 4.0503 1.5869
#> factor(Carrying)3  2.2781  0.4959 0.0000  1.3044  3.2518 9.7582 3.6854
#>                      U.OR
#> (Intercept)        0.4237
#> factor(Carrying)2 10.3376
#> factor(Carrying)3 25.8378
  pool_lr$multiparm_p
#> $`Step 1`
#>                                D2 D2 & RR p-values
#> Gender                    0.96757          0.12380
#> Smoking                  -0.00466          0.11150
#> Function                  2.36408          0.11730
#> JobControl                0.07576          0.73990
#> JobDemands                0.01154          0.96160
#> SocialSupport             0.63015          0.42540
#> factor(Carrying)          8.80222          0.00019
#> factor(Satisfaction)      1.73519          0.17817
#> Smoking:factor(Carrying)  1.23220          0.29991
#> Gender:Smoking            1.52850          0.21610
#> 
#> $`Step 2`
#>                                D2 D2 & RR p-values
#> Gender                    1.00674          0.11870
#> Smoking                  -0.00475          0.11260
#> Function                  2.35820          0.11730
#> JobControl                0.08102          0.73740
#> SocialSupport             0.63067          0.42510
#> factor(Carrying)          8.80250          0.00019
#> factor(Satisfaction)      1.73504          0.17818
#> Smoking:factor(Carrying)  1.22667          0.30166
#> Gender:Smoking            1.52142          0.21680
#> 
#> $`Step 3`
#>                                D2 D2 & RR p-values
#> Gender                    0.92737          0.12600
#> Smoking                  -0.00429          0.11380
#> Function                  2.72027          0.09520
#> SocialSupport             0.72702          0.39320
#> factor(Carrying)          8.77607          0.00019
#> factor(Satisfaction)      1.70729          0.18307
#> Smoking:factor(Carrying)  1.22698          0.30110
#> Gender:Smoking            1.51076          0.21850
#> 
#> $`Step 4`
#>                                D2 D2 & RR p-values
#> Gender                    1.02704          0.12210
#> Smoking                  -0.00301          0.10970
#> Function                  2.74984          0.09390
#> factor(Carrying)          8.43910          0.00027
#> factor(Satisfaction)      1.67024          0.19043
#> Smoking:factor(Carrying)  1.35436          0.26601
#> Gender:Smoking            1.42920          0.23090
#> 
#> $`Step 5`
#>                            D2 D2 & RR p-values
#> Gender                1.12819          0.16180
#> Smoking              -0.00301          0.43860
#> Function              2.83200          0.08910
#> factor(Carrying)      8.43910          0.00027
#> factor(Satisfaction)  1.93016          0.14695
#> Gender:Smoking        0.86119          0.35140
#> 
#> $`Step 6`
#>                            D2 D2 & RR p-values
#> Gender                1.12819          0.27860
#> Smoking              -0.00301          0.95820
#> Function              2.93787          0.08410
#> factor(Carrying)      8.28623          0.00029
#> factor(Satisfaction)  1.87953          0.15447
#> 
#> $`Step 7`
#>                           D2 D2 & RR p-values
#> Gender               1.12511          0.27920
#> Function             2.95688          0.08320
#> factor(Carrying)     8.28522          0.00029
#> factor(Satisfaction) 1.91007          0.14982
#> 
#> $`Step 8`
#>                           D2 D2 & RR p-values
#> Function             3.49747          0.06184
#> factor(Carrying)     8.50477          0.00022
#> factor(Satisfaction) 1.68816          0.18690
#> 
#> $`Step 9`
#>                       D2 D2 & RR p-values
#> Function         2.66474          0.10284
#> factor(Carrying) 7.57188          0.00056
#> 
#> $`Step 10`
#>                        D2 D2 & RR p-values
#> factor(Carrying) 12.95233                0

Back to Examples

Pooling with BS and forcing interaction terms and method D1

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


  library(psfmi)
  pool_lr <- psfmi_lr(data=lbpmilr, nimp=5, impvar="Impnr", Outcome="Chronic",
  predictors=c("Gender", "Smoking", "Function", "JobControl", "JobDemands",
  "SocialSupport"), 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 - JobDemands
#> Variable excluded at Step 2 is - SocialSupport
#> Variable excluded at Step 3 is - factor(Satisfaction)
#> Variable excluded at Step 4 is - Gender:Smoking
#> Variable excluded at Step 5 is - Gender
#> Variable excluded at Step 6 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
#> (Intercept)                0.2658  2.7332 0.9226 -5.0995 5.6311 1.3045
#> Gender                    -0.9613  0.6239 0.1238 -2.1862 0.2636 0.3824
#> Smoking                   -2.4473  1.5169 0.1115 -5.4769 0.5823 0.0865
#> Function                  -0.0792  0.0504 0.1173 -0.1783 0.0200 0.9239
#> JobControl                -0.0071  0.0213 0.7399 -0.0488 0.0347 0.9930
#> JobDemands                 0.0019  0.0400 0.9616 -0.0765 0.0803 1.0019
#> SocialSupport              0.0473  0.0593 0.4254 -0.0690 0.1635 1.0484
#> factor(Carrying)2          0.4834  0.6996 0.4898 -0.8908 1.8577 1.6216
#> factor(Carrying)3          1.6765  0.6702 0.0126  0.3603 2.9928 5.3471
#> factor(Satisfaction)2     -0.5596  0.5426 0.3069 -1.6473 0.5280 0.5714
#> factor(Satisfaction)3     -1.0948  0.5989 0.0682 -2.2718 0.0822 0.3346
#> Smoking:factor(Carrying)2  2.1009  1.3864 0.1330 -0.6509 4.8526 8.1731
#> Smoking:factor(Carrying)3  1.9226  1.4998 0.2064 -1.0981 4.9432 6.8384
#> Gender:Smoking             1.1125  0.8993 0.2161 -0.6504 2.8753 3.0418
#>                             L.OR     U.OR
#> (Intercept)               0.0061 278.9559
#> Gender                    0.1123   1.3016
#> Smoking                   0.0042   1.7902
#> Function                  0.8367   1.0202
#> JobControl                0.9523   1.0353
#> JobDemands                0.9264   1.0837
#> SocialSupport             0.9333   1.1777
#> factor(Carrying)2         0.4103   6.4091
#> factor(Carrying)3         1.4338  19.9412
#> factor(Satisfaction)2     0.1926   1.6955
#> factor(Satisfaction)3     0.1031   1.0857
#> Smoking:factor(Carrying)2 0.5216 128.0779
#> Smoking:factor(Carrying)3 0.3335 140.2179
#> Gender:Smoking            0.5218  17.7305
#> 
#> $`Step 2`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.3385  2.2237 0.8790 -4.0229 4.6998 1.4028
#> Gender                    -0.9650  0.6179 0.1187 -2.1778 0.2478 0.3810
#> Smoking                   -2.4450  1.5196 0.1126 -5.4813 0.5912 0.0867
#> Function                  -0.0793  0.0505 0.1173 -0.1786 0.0200 0.9238
#> JobControl                -0.0071  0.0212 0.7374 -0.0487 0.0345 0.9929
#> SocialSupport              0.0473  0.0593 0.4251 -0.0690 0.1636 1.0485
#> factor(Carrying)2          0.4799  0.6966 0.4911 -0.8881 1.8479 1.6159
#> factor(Carrying)3          1.6721  0.6657 0.0123  0.3648 2.9794 5.3232
#> factor(Satisfaction)2     -0.5588  0.5421 0.3072 -1.6455 0.5278 0.5719
#> factor(Satisfaction)3     -1.0935  0.5985 0.0683 -2.2696 0.0827 0.3350
#> Smoking:factor(Carrying)2  2.1003  1.3873 0.1334 -0.6539 4.8546 8.1690
#> Smoking:factor(Carrying)3  1.9227  1.4953 0.2051 -1.0887 4.9341 6.8396
#> Gender:Smoking             1.1100  0.8987 0.2168 -0.6517 2.8717 3.0344
#>                             L.OR     U.OR
#> (Intercept)               0.0179 109.9297
#> Gender                    0.1133   1.2812
#> Smoking                   0.0042   1.8062
#> Function                  0.8364   1.0202
#> JobControl                0.9524   1.0351
#> SocialSupport             0.9334   1.1777
#> factor(Carrying)2         0.4114   6.3462
#> factor(Carrying)3         1.4402  19.6753
#> factor(Satisfaction)2     0.1929   1.6952
#> factor(Satisfaction)3     0.1034   1.0862
#> Smoking:factor(Carrying)2 0.5200 128.3243
#> Smoking:factor(Carrying)3 0.3367 138.9520
#> Gender:Smoking            0.5212  17.6674
#> 
#> $`Step 3`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                1.6174  1.5170 0.2865 -1.3582 4.5930 5.0400
#> Gender                    -0.9738  0.6132 0.1126 -2.1771 0.2295 0.3777
#> Smoking                   -2.4624  1.5121 0.1084 -5.4839 0.5591 0.0852
#> Function                  -0.0784  0.0503 0.1200 -0.1773 0.0205 0.9246
#> JobControl                -0.0094  0.0209 0.6520 -0.0505 0.0316 0.9906
#> factor(Carrying)2          0.4377  0.6870 0.5242 -0.9108 1.7862 1.5492
#> factor(Carrying)3          1.6140  0.6583 0.0145  0.3215 2.9065 5.0228
#> factor(Satisfaction)2     -0.5667  0.5455 0.3039 -1.6624 0.5291 0.5674
#> factor(Satisfaction)3     -1.0950  0.5997 0.0686 -2.2740 0.0840 0.3345
#> Smoking:factor(Carrying)2  2.1590  1.3803 0.1210 -0.5806 4.8985 8.6623
#> Smoking:factor(Carrying)3  1.9709  1.4922 0.1932 -1.0337 4.9756 7.1773
#> Gender:Smoking             1.0719  0.8894 0.2282 -0.6716 2.8154 2.9208
#>                             L.OR     U.OR
#> (Intercept)               0.2571  98.7907
#> Gender                    0.1134   1.2580
#> Smoking                   0.0042   1.7492
#> Function                  0.8375   1.0207
#> JobControl                0.9508   1.0321
#> factor(Carrying)2         0.4022   5.9669
#> factor(Carrying)3         1.3791  18.2930
#> factor(Satisfaction)2     0.1897   1.6974
#> factor(Satisfaction)3     0.1029   1.0876
#> Smoking:factor(Carrying)2 0.5596 134.0921
#> Smoking:factor(Carrying)3 0.3557 144.8308
#> Gender:Smoking            0.5109  16.6994
#> 
#> $`Step 4`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.7701  1.4239 0.5886 -2.0214 3.5617 2.1600
#> Gender                    -0.8584  0.5976 0.1512 -2.0309 0.3141 0.4238
#> Smoking                   -2.4178  1.4923 0.1101 -5.3983 0.5628 0.0891
#> Function                  -0.0675  0.0484 0.1635 -0.1625 0.0275 0.9347
#> JobControl                -0.0064  0.0208 0.7602 -0.0472 0.0345 0.9937
#> factor(Carrying)2          0.3705  0.6797 0.5860 -0.9651 1.7060 1.4484
#> factor(Carrying)3          1.3956  0.6461 0.0315  0.1244 2.6668 4.0374
#> Smoking:factor(Carrying)2  2.2636  1.3769 0.1038 -0.4737 5.0008 9.6172
#> Smoking:factor(Carrying)3  2.0195  1.4656 0.1744 -0.9250 4.9640 7.5347
#> Gender:Smoking             1.0219  0.8753 0.2431 -0.6943 2.7381 2.7784
#>                             L.OR     U.OR
#> (Intercept)               0.1325  35.2214
#> Gender                    0.1312   1.3690
#> Smoking                   0.0045   1.7555
#> Function                  0.8500   1.0279
#> JobControl                0.9539   1.0351
#> factor(Carrying)2         0.3810   5.5071
#> factor(Carrying)3         1.1324  14.3944
#> Smoking:factor(Carrying)2 0.6227 148.5392
#> Smoking:factor(Carrying)3 0.3966 143.1655
#> Gender:Smoking            0.4994  15.4571
#> 
#> $`Step 5`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.3976  1.3715 0.7719 -2.2907 3.0859 1.4882
#> Gender                    -0.4103  0.4514 0.3637 -1.2971 0.4764 0.6634
#> Smoking                   -1.5458  1.2144 0.2072 -3.9674 0.8758 0.2131
#> Function                  -0.0692  0.0481 0.1512 -0.1636 0.0253 0.9332
#> JobControl                -0.0058  0.0207 0.7805 -0.0463 0.0348 0.9943
#> factor(Carrying)2          0.4824  0.6612 0.4659 -0.8164 1.7812 1.6200
#> factor(Carrying)3          1.3679  0.6286 0.0300  0.1331 2.6027 3.9271
#> Smoking:factor(Carrying)2  2.0573  1.3459 0.1296 -0.6136 4.7282 7.8251
#> Smoking:factor(Carrying)3  1.9385  1.4235 0.1782 -0.9069 4.7839 6.9482
#>                             L.OR     U.OR
#> (Intercept)               0.1012  21.8871
#> Gender                    0.2733   1.6103
#> Smoking                   0.0189   2.4008
#> Function                  0.8490   1.0257
#> JobControl                0.9548   1.0354
#> factor(Carrying)2         0.4420   5.9368
#> factor(Carrying)3         1.1423  13.5003
#> Smoking:factor(Carrying)2 0.5414 113.0939
#> Smoking:factor(Carrying)3 0.4038 119.5660
#> 
#> $`Step 6`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)               -0.0240  1.3046 0.9853 -2.5818 2.5339 0.9763
#> Smoking                   -1.5587  1.2167 0.2045 -3.9866 0.8692 0.2104
#> Function                  -0.0750  0.0475 0.1150 -0.1683 0.0183 0.9278
#> JobControl                -0.0030  0.0205 0.8830 -0.0433 0.0373 0.9970
#> factor(Carrying)2          0.5740  0.6463 0.3748 -0.6950 1.8431 1.7754
#> factor(Carrying)3          1.3464  0.6195 0.0300  0.1305 2.5624 3.8438
#> Smoking:factor(Carrying)2  2.0163  1.3476 0.1381 -0.6604 4.6930 7.5102
#> Smoking:factor(Carrying)3  1.9751  1.4262 0.1713 -0.8786 4.8287 7.2072
#>                             L.OR     U.OR
#> (Intercept)               0.0756  12.6021
#> Smoking                   0.0186   2.3849
#> Function                  0.8451   1.0185
#> JobControl                0.9576   1.0380
#> factor(Carrying)2         0.4991   6.3162
#> factor(Carrying)3         1.1394  12.9671
#> Smoking:factor(Carrying)2 0.5166 109.1767
#> Smoking:factor(Carrying)3 0.4154 125.0521
#> 
#> $`Step 7`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)               -0.6687  1.2641 0.5969 -3.1498 1.8124 0.5124
#> Smoking                   -1.6170  1.2262 0.1923 -4.0701 0.8362 0.1985
#> JobControl                -0.0084  0.0201 0.6752 -0.0478 0.0309 0.9916
#> factor(Carrying)2          0.7445  0.6339 0.2407 -0.5006 1.9896 2.1054
#> factor(Carrying)3          1.6545  0.5920 0.0054  0.4919 2.8170 5.2304
#> Smoking:factor(Carrying)2  1.9635  1.3523 0.1504 -0.7272 4.6542 7.1244
#> Smoking:factor(Carrying)3  2.0487  1.4555 0.1660 -0.8808 4.9782 7.7579
#>                             L.OR     U.OR
#> (Intercept)               0.0429   6.1251
#> Smoking                   0.0171   2.3075
#> JobControl                0.9534   1.0314
#> factor(Carrying)2         0.6062   7.3123
#> factor(Carrying)3         1.6355  16.7272
#> Smoking:factor(Carrying)2 0.4833 105.0290
#> Smoking:factor(Carrying)3 0.4144 145.2174
  pool_lr$multiparm_p
#> $`Step 1`
#>                          Chi_sq D1 & RR p-values
#> Gender                    2.374           0.1238
#> Smoking                   2.603           0.1115
#> Function                  2.464           0.1173
#> JobControl                0.110           0.7399
#> JobDemands                0.002           0.9616
#> SocialSupport             0.635           0.4254
#> factor(Carrying)          3.435           0.0334
#> factor(Satisfaction)      1.493           0.2315
#> Smoking:factor(Carrying)  1.135           0.3304
#> Gender:Smoking            1.530           0.2161
#> 
#> $`Step 2`
#>                          Chi_sq D1 & RR p-values
#> Gender                    2.439           0.1187
#> Smoking                   2.589           0.1126
#> Function                  2.465           0.1173
#> JobControl                0.112           0.7374
#> SocialSupport             0.636           0.4251
#> factor(Carrying)          3.467           0.0323
#> factor(Satisfaction)      1.492           0.2317
#> Smoking:factor(Carrying)  1.136           0.3301
#> Gender:Smoking            1.526           0.2168
#> 
#> $`Step 3`
#>                          Chi_sq D1 & RR p-values
#> Gender                    2.522           0.1126
#> Smoking                   2.652           0.1084
#> Function                  2.427           0.1200
#> JobControl                0.203           0.6520
#> factor(Carrying)          3.342           0.0363
#> factor(Satisfaction)      1.484           0.2342
#> Smoking:factor(Carrying)  1.208           0.3082
#> Gender:Smoking            1.452           0.2282
#> 
#> $`Step 4`
#>                          Chi_sq D1 & RR p-values
#> Gender                    2.063           0.1512
#> Smoking                   2.625           0.1101
#> Function                  1.946           0.1635
#> JobControl                0.093           0.7602
#> factor(Carrying)          2.634           0.0739
#> Smoking:factor(Carrying)  1.338           0.2725
#> Gender:Smoking            1.363           0.2431
#> 
#> $`Step 5`
#>                          Chi_sq D1 & RR p-values
#> Gender                    0.826           0.3637
#> Smoking                   1.620           0.2072
#> Function                  2.064           0.1512
#> JobControl                0.078           0.7805
#> factor(Carrying)          2.539           0.0805
#> Smoking:factor(Carrying)  1.202           0.3085
#> 
#> $`Step 6`
#>                          Chi_sq D1 & RR p-values
#> Smoking                   1.641           0.2045
#> Function                  2.489           0.1150
#> JobControl                0.022           0.8830
#> factor(Carrying)          2.444           0.0880
#> Smoking:factor(Carrying)  1.183           0.3146
#> 
#> $`Step 7`
#>                          Chi_sq D1 & RR p-values
#> Smoking                   1.739           0.1923
#> JobControl                0.176           0.6752
#> factor(Carrying)          4.004           0.0190
#> Smoking:factor(Carrying)  1.159           0.3234

Back to Examples

Pooling with BS including spline coefficient and method D1

Pooling Logistic regression models over 5 imputed datasets with BS 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", "JobDemands",
  "SocialSupport"), 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 - JobDemands
#> Variable excluded at Step 2 is - JobControl
#> Variable excluded at Step 3 is - SocialSupport
#> Variable excluded at Step 4 is - Smoking:factor(Carrying)
#> Variable excluded at Step 5 is - Smoking
#> Variable excluded at Step 6 is - Gender
#> Variable excluded at Step 7 is - factor(Satisfaction)
#> Variable excluded at Step 8 is - rcs(Function,3)
  pool_lr$RR_Model
#> $`Step 1`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.2274  2.7430 0.9339 -5.1568 5.6117 1.2554
#> Gender                    -0.4878  0.4777 0.3077 -1.4267 0.4510 0.6140
#> Smoking                   -1.4641  1.2432 0.2434 -3.9488 1.0206 0.2313
#> JobControl                -0.0047  0.0216 0.8276 -0.0471 0.0377 0.9953
#> JobDemands                -0.0006  0.0398 0.9881 -0.0786 0.0774 0.9994
#> SocialSupport              0.0461  0.0587 0.4316 -0.0688 0.1611 1.0472
#> factor(Carrying)2          0.6094  0.6835 0.3730 -0.7331 1.9518 1.8392
#> factor(Carrying)3          1.6225  0.6547 0.0133  0.3380 2.9071 5.0659
#> factor(Satisfaction)2     -0.5859  0.5366 0.2796 -1.6609 0.4891 0.5566
#> factor(Satisfaction)3     -1.0620  0.5922 0.0735 -2.2253 0.1013 0.3458
#> rcs(Function, 3)Function  -0.1294  0.1126 0.2509 -0.3503 0.0916 0.8787
#> rcs(Function, 3)Function'  0.0643  0.1288 0.6175 -0.1882 0.3168 1.0664
#> Smoking:factor(Carrying)2  1.8495  1.3569 0.1756 -0.8385 4.5376 6.3567
#> Smoking:factor(Carrying)3  1.8415  1.4604 0.2127 -1.0853 4.7683 6.3060
#>                             L.OR     U.OR
#> (Intercept)               0.0058 273.6051
#> Gender                    0.2401   1.5699
#> Smoking                   0.0193   2.7748
#> JobControl                0.9539   1.0384
#> JobDemands                0.9244   1.0805
#> SocialSupport             0.9335   1.1748
#> factor(Carrying)2         0.4804   7.0413
#> factor(Carrying)3         1.4021  18.3035
#> factor(Satisfaction)2     0.1900   1.6309
#> factor(Satisfaction)3     0.1080   1.1066
#> rcs(Function, 3)Function  0.7045   1.0959
#> rcs(Function, 3)Function' 0.8285   1.3728
#> Smoking:factor(Carrying)2 0.4323  93.4631
#> Smoking:factor(Carrying)3 0.3378 117.7217
#> 
#> $`Step 2`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.2034  2.2241 0.9271 -4.1582 4.5650 1.2256
#> Gender                    -0.4867  0.4680 0.2989 -1.4062 0.4329 0.6147
#> Smoking                   -1.4605  1.2390 0.2429 -3.9358 1.0147 0.2321
#> JobControl                -0.0047  0.0215 0.8283 -0.0469 0.0376 0.9953
#> SocialSupport              0.0462  0.0587 0.4311 -0.0688 0.1611 1.0473
#> factor(Carrying)2          0.6083  0.6793 0.3708 -0.7254 1.9421 1.8374
#> factor(Carrying)3          1.6224  0.6494 0.0126  0.3482 2.8965 5.0650
#> factor(Satisfaction)2     -0.5860  0.5362 0.2792 -1.6601 0.4882 0.5566
#> factor(Satisfaction)3     -1.0602  0.5917 0.0737 -2.2226 0.1022 0.3464
#> rcs(Function, 3)Function  -0.1294  0.1126 0.2505 -0.3502 0.0914 0.8786
#> rcs(Function, 3)Function'  0.0643  0.1287 0.6175 -0.1881 0.3167 1.0664
#> Smoking:factor(Carrying)2  1.8471  1.3551 0.1755 -0.8369 4.5312 6.3416
#> Smoking:factor(Carrying)3  1.8350  1.4514 0.2114 -1.0723 4.7422 6.2648
#>                             L.OR     U.OR
#> (Intercept)               0.0156  96.0630
#> Gender                    0.2451   1.5417
#> Smoking                   0.0195   2.7586
#> JobControl                0.9542   1.0383
#> SocialSupport             0.9335   1.1749
#> factor(Carrying)2         0.4841   6.9730
#> factor(Carrying)3         1.4165  18.1111
#> factor(Satisfaction)2     0.1901   1.6294
#> factor(Satisfaction)3     0.1083   1.1076
#> rcs(Function, 3)Function  0.7045   1.0957
#> rcs(Function, 3)Function' 0.8286   1.3725
#> Smoking:factor(Carrying)2 0.4331  92.8668
#> Smoking:factor(Carrying)3 0.3422 114.6889
#> 
#> $`Step 3`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)               -0.0756  1.7959 0.9664 -3.5964 3.4452 0.9272
#> Gender                    -0.4717  0.4630 0.3089 -1.3815 0.4381 0.6240
#> Smoking                   -1.4445  1.2324 0.2453 -3.9044 1.0154 0.2359
#> SocialSupport              0.0482  0.0578 0.4051 -0.0652 0.1615 1.0493
#> factor(Carrying)2          0.6042  0.6793 0.3741 -0.7297 1.9381 1.8298
#> factor(Carrying)3          1.6255  0.6487 0.0123  0.3528 2.8982 5.0811
#> factor(Satisfaction)2     -0.5858  0.5362 0.2793 -1.6601 0.4885 0.5567
#> factor(Satisfaction)3     -1.0481  0.5874 0.0749 -2.2019 0.1056 0.3506
#> rcs(Function, 3)Function  -0.1355  0.1085 0.2120 -0.3484 0.0774 0.8733
#> rcs(Function, 3)Function'  0.0697  0.1262 0.5806 -0.1777 0.3171 1.0722
#> Smoking:factor(Carrying)2  1.8439  1.3546 0.1761 -0.8392 4.5270 6.3211
#> Smoking:factor(Carrying)3  1.7993  1.4319 0.2137 -1.0645 4.6630 6.0453
#>                             L.OR     U.OR
#> (Intercept)               0.0274  31.3511
#> Gender                    0.2512   1.5498
#> Smoking                   0.0202   2.7605
#> SocialSupport             0.9369   1.1753
#> factor(Carrying)2         0.4821   6.9457
#> factor(Carrying)3         1.4231  18.1420
#> factor(Satisfaction)2     0.1901   1.6299
#> factor(Satisfaction)3     0.1106   1.1114
#> rcs(Function, 3)Function  0.7058   1.0804
#> rcs(Function, 3)Function' 0.8372   1.3732
#> Smoking:factor(Carrying)2 0.4321  92.4786
#> Smoking:factor(Carrying)3 0.3449 105.9569
#> 
#> $`Step 4`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                1.0821  1.1254 0.3364 -1.1245 3.2886 2.9508
#> Gender                    -0.4863  0.4577 0.2885 -1.3855 0.4129 0.6149
#> Smoking                   -1.5000  1.2279 0.2261 -3.9506 0.9506 0.2231
#> factor(Carrying)2          0.5504  0.6692 0.4110 -0.7630 1.8638 1.7340
#> factor(Carrying)3          1.5689  0.6409 0.0145  0.3117 2.8261 4.8012
#> factor(Satisfaction)2     -0.5925  0.5395 0.2773 -1.6758 0.4908 0.5530
#> factor(Satisfaction)3     -1.0480  0.5894 0.0760 -2.2063 0.1102 0.3506
#> rcs(Function, 3)Function  -0.1318  0.1087 0.2256 -0.3450 0.0814 0.8765
#> rcs(Function, 3)Function'  0.0642  0.1261 0.6111 -0.1831 0.3114 1.0663
#> Smoking:factor(Carrying)2  1.9216  1.3469 0.1563 -0.7455 4.5888 6.8319
#> Smoking:factor(Carrying)3  1.8381  1.4288 0.2032 -1.0193 4.6956 6.2848
#>                             L.OR     U.OR
#> (Intercept)               0.3248  26.8047
#> Gender                    0.2502   1.5112
#> Smoking                   0.0192   2.5873
#> factor(Carrying)2         0.4663   6.4482
#> factor(Carrying)3         1.3657  16.8787
#> factor(Satisfaction)2     0.1872   1.6336
#> factor(Satisfaction)3     0.1101   1.1165
#> rcs(Function, 3)Function  0.7082   1.0848
#> rcs(Function, 3)Function' 0.8327   1.3654
#> Smoking:factor(Carrying)2 0.4745  98.3715
#> Smoking:factor(Carrying)3 0.3609 109.4590
#> 
#> $`Step 5`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.7297  1.1158 0.5131 -1.4575 2.9170 2.0745
#> Gender                    -0.4998  0.4488 0.2658 -1.3808 0.3812 0.6067
#> Smoking                    0.0421  0.3792 0.9116 -0.7013 0.7855 1.0430
#> factor(Carrying)2          1.2022  0.5089 0.0182  0.2044 2.1999 3.3274
#> factor(Carrying)3          2.1161  0.5690 0.0002  0.9971 3.2351 8.2988
#> factor(Satisfaction)2     -0.5877  0.5169 0.2595 -1.6189 0.4436 0.5556
#> factor(Satisfaction)3     -1.0991  0.5823 0.0596 -2.2431 0.0448 0.3332
#> rcs(Function, 3)Function  -0.1404  0.1086 0.1962 -0.3534 0.0726 0.8690
#> rcs(Function, 3)Function'  0.0732  0.1262 0.5620 -0.1742 0.3205 1.0759
#>                             L.OR    U.OR
#> (Intercept)               0.2328 18.4850
#> Gender                    0.2514  1.4641
#> Smoking                   0.4959  2.1935
#> factor(Carrying)2         1.2268  9.0245
#> factor(Carrying)3         2.7104 25.4097
#> factor(Satisfaction)2     0.1981  1.5582
#> factor(Satisfaction)3     0.1061  1.0458
#> rcs(Function, 3)Function  0.7023  1.0753
#> rcs(Function, 3)Function' 0.8402  1.3778
#> 
#> $`Step 6`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.7357  1.1143 0.5091 -1.4486 2.9201 2.0870
#> Gender                    -0.4978  0.4483 0.2672 -1.3778 0.3823 0.6079
#> factor(Carrying)2          1.2083  0.5039 0.0165  0.2203 2.1962 3.3477
#> factor(Carrying)3          2.1166  0.5691 0.0002  0.9975 3.2358 8.3032
#> factor(Satisfaction)2     -0.5921  0.5133 0.2525 -1.6155 0.4313 0.5532
#> factor(Satisfaction)3     -1.1044  0.5786 0.0568 -2.2410 0.0322 0.3314
#> rcs(Function, 3)Function  -0.1389  0.1076 0.1969 -0.3499 0.0721 0.8703
#> rcs(Function, 3)Function'  0.0717  0.1255 0.5677 -0.1743 0.3178 1.0744
#>                             L.OR    U.OR
#> (Intercept)               0.2349 18.5426
#> Gender                    0.2521  1.4656
#> factor(Carrying)2         1.2465  8.9909
#> factor(Carrying)3         2.7114 25.4267
#> factor(Satisfaction)2     0.1988  1.5392
#> factor(Satisfaction)3     0.1064  1.0327
#> rcs(Function, 3)Function  0.7048  1.0748
#> rcs(Function, 3)Function' 0.8400  1.3740
#> 
#> $`Step 7`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)                0.3161  1.0559 0.7647 -1.7548 2.3871 1.3718
#> factor(Carrying)2          1.2877  0.4952 0.0093  0.3169 2.2585 3.6244
#> factor(Carrying)3          2.1007  0.5620 0.0002  0.9960 3.2054 8.1719
#> factor(Satisfaction)2     -0.5453  0.5124 0.2911 -1.5685 0.4779 0.5797
#> factor(Satisfaction)3     -1.0365  0.5763 0.0728 -2.1693 0.0963 0.3547
#> rcs(Function, 3)Function  -0.1388  0.1071 0.1951 -0.3488 0.0712 0.8704
#> rcs(Function, 3)Function'  0.0643  0.1253 0.6075 -0.1812 0.3099 1.0665
#>                             L.OR    U.OR
#> (Intercept)               0.1729 10.8815
#> factor(Carrying)2         1.3728  9.5684
#> factor(Carrying)3         2.7074 24.6654
#> factor(Satisfaction)2     0.2084  1.6127
#> factor(Satisfaction)3     0.1143  1.1011
#> rcs(Function, 3)Function  0.7055  1.0738
#> rcs(Function, 3)Function' 0.8343  1.3633
#> 
#> $`Step 8`
#>                               est std.err signif   lower  upper     OR
#> (Intercept)               -0.2344  0.9852 0.8120 -2.1664 1.6977 0.7911
#> factor(Carrying)2          1.2727  0.4851 0.0087  0.3218 2.2236 3.5706
#> factor(Carrying)3          1.9252  0.5400 0.0004  0.8643 2.9861 6.8566
#> rcs(Function, 3)Function  -0.1312  0.1055 0.2136 -0.3380 0.0756 0.8770
#> rcs(Function, 3)Function'  0.0729  0.1237 0.5558 -0.1696 0.3154 1.0756
#>                             L.OR    U.OR
#> (Intercept)               0.1146  5.4613
#> factor(Carrying)2         1.3796  9.2407
#> factor(Carrying)3         2.3734 19.8082
#> rcs(Function, 3)Function  0.7132  1.0785
#> rcs(Function, 3)Function' 0.8440  1.3708
#> 
#> $`Step 9`
#>                       est std.err signif   lower   upper     OR   L.OR
#> (Intercept)       -1.6153  0.3860 0.0000 -2.3718 -0.8588 0.1988 0.0933
#> factor(Carrying)2  1.3988  0.4780 0.0034  0.4618  2.3358 4.0503 1.5869
#> factor(Carrying)3  2.2781  0.4959 0.0000  1.3044  3.2518 9.7582 3.6854
#>                      U.OR
#> (Intercept)        0.4237
#> factor(Carrying)2 10.3376
#> factor(Carrying)3 25.8378
  pool_lr$multiparm_p
#> $`Step 1`
#>                          Chi_sq D1 & RR p-values
#> Gender                    1.043           0.3077
#> Smoking                   1.387           0.2434
#> JobControl                0.047           0.8276
#> JobDemands                0.000           0.9881
#> SocialSupport             0.618           0.4316
#> factor(Carrying)          3.211           0.0412
#> factor(Satisfaction)      1.450           0.2409
#> rcs(Function,3)           1.471           0.2300
#> Smoking:factor(Carrying)  0.982           0.3813
#> 
#> $`Step 2`
#>                          Chi_sq D1 & RR p-values
#> Gender                    1.081           0.2989
#> Smoking                   1.390           0.2429
#> JobControl                0.047           0.8283
#> SocialSupport             0.620           0.4311
#> factor(Carrying)          3.262           0.0391
#> factor(Satisfaction)      1.447           0.2416
#> rcs(Function,3)           1.475           0.2291
#> Smoking:factor(Carrying)  0.985           0.3801
#> 
#> $`Step 3`
#>                          Chi_sq D1 & RR p-values
#> Gender                    1.038           0.3089
#> Smoking                   1.374           0.2453
#> SocialSupport             0.693           0.4051
#> factor(Carrying)          3.287           0.0382
#> factor(Satisfaction)      1.432           0.2451
#> rcs(Function,3)           1.652           0.1919
#> Smoking:factor(Carrying)  0.976           0.3831
#> 
#> $`Step 4`
#>                          Chi_sq D1 & RR p-values
#> Gender                    1.129           0.2885
#> Smoking                   1.492           0.2261
#> factor(Carrying)          3.176           0.0424
#> factor(Satisfaction)      1.420           0.2486
#> rcs(Function,3)           1.639           0.1945
#> Smoking:factor(Carrying)  1.052           0.3560
#> 
#> $`Step 5`
#>                      Chi_sq D1 & RR p-values
#> Gender                1.240           0.2658
#> Smoking               0.012           0.9116
#> factor(Carrying)      7.168           0.0009
#> factor(Satisfaction)  1.629           0.2019
#> rcs(Function,3)       1.716           0.1801
#> 
#> $`Step 6`
#>                      Chi_sq D1 & RR p-values
#> Gender                1.233           0.2672
#> factor(Carrying)      7.183           0.0008
#> factor(Satisfaction)  1.672           0.1935
#> rcs(Function,3)       1.716           0.1801
#> 
#> $`Step 7`
#>                      Chi_sq D1 & RR p-values
#> factor(Carrying)      7.255           0.0008
#> factor(Satisfaction)  1.480           0.2336
#> rcs(Function,3)       1.915           0.1476
#> 
#> $`Step 8`
#>                  Chi_sq D1 & RR p-values
#> factor(Carrying)  6.626           0.0014
#> rcs(Function,3)   1.523           0.2182
#> 
#> $`Step 9`
#>                  Chi_sq D1 & RR p-values
#> factor(Carrying) 10.851                0

Back to Examples

Cox Regression

Pooling without BS 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
#> Duration            -0.0077  0.0040 0.0524 -0.0156  0.0001 0.9923 0.9845
#> Radiation           -0.0749  0.1533 0.6251 -0.3755  0.2256 0.9278 0.6869
#> Onset               -0.0937  0.1759 0.5941 -0.4385  0.2510 0.9106 0.6450
#> Function             0.0440  0.0169 0.0094  0.0108  0.0771 1.0450 1.0109
#> Age                 -0.0089  0.0077 0.2510 -0.0240  0.0063 0.9911 0.9763
#> Previous            -0.0983  0.1992 0.6215 -0.4888  0.2921 0.9064 0.6134
#> Tampascale          -0.0233  0.0141 0.0991 -0.0509  0.0044 0.9770 0.9504
#> JobControl          -0.0084  0.0083 0.3144 -0.0247  0.0079 0.9916 0.9756
#> JobDemand           -0.0218  0.0155 0.1591 -0.0522  0.0086 0.9784 0.9491
#> Social              -0.0513  0.0249 0.0393 -0.1002 -0.0025 0.9500 0.9047
#> factor(Expect_cat)2  0.2433  0.2312 0.2926 -0.2098  0.6964 1.2755 0.8107
#> factor(Expect_cat)3  0.2271  0.2003 0.2569 -0.1654  0.6196 1.2550 0.8476
#>                       U.HR
#> Duration            1.0001
#> Radiation           1.2531
#> Onset               1.2853
#> Function            1.0802
#> Age                 1.0063
#> Previous            1.3392
#> Tampascale          1.0044
#> JobControl          1.0079
#> JobDemand           1.0086
#> Social              0.9975
#> factor(Expect_cat)2 2.0065
#> factor(Expect_cat)3 1.8582
  pool_coxr$multiparm_p
#> $`Step 1`
#>                    Chi_sq D1 & RR p-values
#> 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 BS 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", "JobControl", "JobDemand", "Social"), p.crit=0.05,
  cat.predictors=c("Expect_cat"), method="MPR")
#> Variable excluded at Step 1 is - Radiation
#> Variable excluded at Step 2 is - Previous
#> Variable excluded at Step 3 is - Onset
#> Variable excluded at Step 4 is - factor(Expect_cat)
#> Variable excluded at Step 5 is - JobControl
#> Variable excluded at Step 6 is - Age
#> Variable excluded at Step 7 is - JobDemand
#> Variable excluded at Step 8 is - Tampascale
  pool_coxr$RR_Model
#> $`Step 1`
#>                         est std.err signif   lower   upper     HR   L.HR
#> Duration            -0.0077  0.0040 0.0524 -0.0156  0.0001 0.9923 0.9845
#> Radiation           -0.0749  0.1533 0.6251 -0.3755  0.2256 0.9278 0.6869
#> Onset               -0.0937  0.1759 0.5941 -0.4385  0.2510 0.9106 0.6450
#> Function             0.0440  0.0169 0.0094  0.0108  0.0771 1.0450 1.0109
#> Age                 -0.0089  0.0077 0.2510 -0.0240  0.0063 0.9911 0.9763
#> Previous            -0.0983  0.1992 0.6215 -0.4888  0.2921 0.9064 0.6134
#> Tampascale          -0.0233  0.0141 0.0991 -0.0509  0.0044 0.9770 0.9504
#> JobControl          -0.0084  0.0083 0.3144 -0.0247  0.0079 0.9916 0.9756
#> JobDemand           -0.0218  0.0155 0.1591 -0.0522  0.0086 0.9784 0.9491
#> Social              -0.0513  0.0249 0.0393 -0.1002 -0.0025 0.9500 0.9047
#> factor(Expect_cat)2  0.2433  0.2312 0.2926 -0.2098  0.6964 1.2755 0.8107
#> factor(Expect_cat)3  0.2271  0.2003 0.2569 -0.1654  0.6196 1.2550 0.8476
#>                       U.HR
#> Duration            1.0001
#> Radiation           1.2531
#> Onset               1.2853
#> Function            1.0802
#> Age                 1.0063
#> Previous            1.3392
#> Tampascale          1.0044
#> JobControl          1.0079
#> JobDemand           1.0086
#> Social              0.9975
#> factor(Expect_cat)2 2.0065
#> factor(Expect_cat)3 1.8582
#> 
#> $`Step 2`
#>                         est std.err signif   lower   upper     HR   L.HR
#> Duration            -0.0079  0.0040 0.0484 -0.0157 -0.0001 0.9921 0.9844
#> Onset               -0.0907  0.1756 0.6054 -0.4349  0.2535 0.9133 0.6473
#> Function             0.0456  0.0165 0.0057  0.0133  0.0780 1.0467 1.0134
#> Age                 -0.0088  0.0077 0.2520 -0.0240  0.0063 0.9912 0.9763
#> Previous            -0.0882  0.1981 0.6561 -0.4766  0.3001 0.9156 0.6209
#> Tampascale          -0.0233  0.0140 0.0979 -0.0508  0.0043 0.9770 0.9505
#> JobControl          -0.0087  0.0083 0.2923 -0.0249  0.0075 0.9913 0.9754
#> JobDemand           -0.0216  0.0155 0.1621 -0.0520  0.0087 0.9786 0.9493
#> Social              -0.0508  0.0249 0.0412 -0.0995 -0.0020 0.9505 0.9053
#> factor(Expect_cat)2  0.2665  0.2266 0.2397 -0.1777  0.7106 1.3054 0.8372
#> factor(Expect_cat)3  0.2432  0.1977 0.2187 -0.1443  0.6306 1.2753 0.8656
#>                       U.HR
#> Duration            0.9999
#> Onset               1.2885
#> Function            1.0811
#> Age                 1.0063
#> Previous            1.3500
#> Tampascale          1.0043
#> JobControl          1.0075
#> JobDemand           1.0087
#> Social              0.9980
#> factor(Expect_cat)2 2.0352
#> factor(Expect_cat)3 1.8787
#> 
#> $`Step 3`
#>                         est std.err signif   lower   upper     HR   L.HR
#> Duration            -0.0076  0.0039 0.0534 -0.0154  0.0001 0.9924 0.9847
#> Onset               -0.0860  0.1752 0.6234 -0.4295  0.2574 0.9176 0.6508
#> Function             0.0455  0.0165 0.0058  0.0132  0.0778 1.0466 1.0133
#> Age                 -0.0092  0.0077 0.2301 -0.0243  0.0058 0.9908 0.9760
#> Tampascale          -0.0229  0.0140 0.1021 -0.0503  0.0046 0.9774 0.9509
#> JobControl          -0.0091  0.0082 0.2663 -0.0252  0.0070 0.9909 0.9751
#> JobDemand           -0.0221  0.0154 0.1525 -0.0524  0.0082 0.9781 0.9489
#> Social              -0.0515  0.0248 0.0380 -0.1001 -0.0029 0.9498 0.9047
#> factor(Expect_cat)2  0.2639  0.2262 0.2434 -0.1795  0.7073 1.3020 0.8357
#> factor(Expect_cat)3  0.2520  0.1965 0.1998 -0.1332  0.6372 1.2866 0.8753
#>                       U.HR
#> Duration            1.0001
#> Onset               1.2936
#> Function            1.0809
#> Age                 1.0058
#> Tampascale          1.0046
#> JobControl          1.0070
#> JobDemand           1.0082
#> Social              0.9971
#> factor(Expect_cat)2 2.0285
#> factor(Expect_cat)3 1.8912
#> 
#> $`Step 4`
#>                         est std.err signif   lower   upper     HR   L.HR
#> Duration            -0.0077  0.0039 0.0496 -0.0155  0.0000 0.9923 0.9846
#> Function             0.0454  0.0165 0.0059  0.0131  0.0777 1.0464 1.0132
#> Age                 -0.0090  0.0077 0.2430 -0.0240  0.0061 0.9910 0.9763
#> Tampascale          -0.0231  0.0140 0.0980 -0.0505  0.0043 0.9772 0.9508
#> JobControl          -0.0088  0.0082 0.2802 -0.0248  0.0072 0.9912 0.9755
#> JobDemand           -0.0220  0.0154 0.1539 -0.0522  0.0082 0.9782 0.9491
#> Social              -0.0523  0.0247 0.0340 -0.1007 -0.0039 0.9490 0.9042
#> factor(Expect_cat)2  0.2655  0.2262 0.2406 -0.1779  0.7089 1.3041 0.8370
#> factor(Expect_cat)3  0.2514  0.1964 0.2006 -0.1336  0.6363 1.2858 0.8749
#>                       U.HR
#> Duration            1.0000
#> Function            1.0808
#> Age                 1.0061
#> Tampascale          1.0043
#> JobControl          1.0072
#> JobDemand           1.0082
#> Social              0.9961
#> factor(Expect_cat)2 2.0318
#> factor(Expect_cat)3 1.8895
#> 
#> $`Step 5`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0074  0.0039 0.0564 -0.0151  0.0002 0.9926 0.9850 1.0002
#> Function    0.0476  0.0165 0.0040  0.0152  0.0800 1.0488 1.0153 1.0833
#> Age        -0.0081  0.0076 0.2831 -0.0229  0.0067 0.9919 0.9774 1.0067
#> Tampascale -0.0209  0.0137 0.1272 -0.0478  0.0060 0.9793 0.9533 1.0060
#> JobControl -0.0084  0.0082 0.3053 -0.0244  0.0076 0.9916 0.9759 1.0076
#> JobDemand  -0.0210  0.0154 0.1736 -0.0511  0.0092 0.9792 0.9502 1.0092
#> Social     -0.0524  0.0244 0.0316 -0.1002 -0.0046 0.9489 0.9047 0.9954
#> 
#> $`Step 6`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0070  0.0039 0.0702 -0.0146  0.0006 0.9930 0.9855 1.0006
#> Function    0.0476  0.0166 0.0041  0.0151  0.0801 1.0488 1.0152 1.0834
#> Age        -0.0079  0.0076 0.2955 -0.0228  0.0069 0.9921 0.9775 1.0069
#> Tampascale -0.0208  0.0138 0.1309 -0.0479  0.0062 0.9794 0.9532 1.0062
#> JobDemand  -0.0193  0.0154 0.2102 -0.0494  0.0109 0.9809 0.9518 1.0110
#> Social     -0.0608  0.0229 0.0079 -0.1057 -0.0160 0.9410 0.8997 0.9841
#> 
#> $`Step 7`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0078  0.0038 0.0393 -0.0153 -0.0004 0.9922 0.9848 0.9996
#> Function    0.0481  0.0166 0.0038  0.0155  0.0807 1.0493 1.0156 1.0840
#> Tampascale -0.0183  0.0134 0.1730 -0.0447  0.0080 0.9819 0.9563 1.0080
#> JobDemand  -0.0178  0.0153 0.2438 -0.0477  0.0121 0.9824 0.9534 1.0122
#> Social     -0.0602  0.0229 0.0086 -0.1051 -0.0153 0.9416 0.9002 0.9848
#> 
#> $`Step 8`
#>                est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration   -0.0080  0.0038 0.0333 -0.0154 -0.0006 0.9920 0.9847 0.9994
#> Function    0.0484  0.0164 0.0032  0.0162  0.0806 1.0496 1.0163 1.0839
#> Tampascale -0.0209  0.0133 0.1168 -0.0470  0.0052 0.9793 0.9541 1.0052
#> Social     -0.0564  0.0227 0.0130 -0.1010 -0.0119 0.9452 0.9039 0.9882
#> 
#> $`Step 9`
#>              est std.err signif   lower   upper     HR   L.HR   U.HR
#> Duration -0.0076  0.0037 0.0421 -0.0149 -0.0003 0.9924 0.9852 0.9997
#> Function  0.0565  0.0154 0.0002  0.0263  0.0867 1.0581 1.0266 1.0906
#> Social   -0.0520  0.0226 0.0215 -0.0963 -0.0077 0.9493 0.9082 0.9923
  pool_coxr$multiparm_p
#> $`Step 1`
#>                    MPR & RR P-values
#> Duration                      0.0524
#> Radiation                     0.6251
#> Onset                         0.5941
#> Function                      0.0094
#> Age                           0.2510
#> Previous                      0.6215
#> Tampascale                    0.0991
#> JobControl                    0.3144
#> JobDemand                     0.1591
#> Social                        0.0393
#> factor(Expect_cat)            0.4786
#> 
#> $`Step 2`
#>                    MPR & RR P-values
#> Duration                      0.0484
#> Onset                         0.6054
#> Function                      0.0057
#> Age                           0.2520
#> Previous                      0.6561
#> Tampascale                    0.0979
#> JobControl                    0.2923
#> JobDemand                     0.1621
#> Social                        0.0412
#> factor(Expect_cat)            0.4044
#> 
#> $`Step 3`
#>                    MPR & RR P-values
#> Duration                      0.0534
#> Onset                         0.6234
#> Function                      0.0058
#> Age                           0.2301
#> Tampascale                    0.1021
#> JobControl                    0.2663
#> JobDemand                     0.1525
#> Social                        0.0380
#> factor(Expect_cat)            0.3887
#> 
#> $`Step 4`
#>                    MPR & RR P-values
#> Duration                      0.0496
#> Function                      0.0059
#> Age                           0.2430
#> Tampascale                    0.0980
#> JobControl                    0.2802
#> JobDemand                     0.1539
#> Social                        0.0340
#> factor(Expect_cat)            0.3883
#> 
#> $`Step 5`
#>            MPR & RR P-values
#> Duration              0.0509
#> Function              0.0052
#> Age                   0.2781
#> Tampascale            0.1126
#> JobControl            0.3116
#> JobDemand             0.1742
#> Social                0.0305
#> 
#> $`Step 6`
#>            MPR & RR P-values
#> Duration              0.0638
#> Function              0.0053
#> Age                   0.2892
#> Tampascale            0.1219
#> JobDemand             0.2105
#> Social                0.0075
#> 
#> $`Step 7`
#>            MPR & RR P-values
#> Duration              0.0349
#> Function              0.0050
#> Tampascale            0.1710
#> JobDemand             0.2438
#> Social                0.0083
#> 
#> $`Step 8`
#>            MPR & RR P-values
#> Duration              0.0288
#> Function              0.0042
#> Tampascale            0.1155
#> Social                0.0124
#> 
#> $`Step 9`
#>          MPR & RR P-values
#> Duration            0.0374
#> Function            0.0005
#> Social              0.0206

Back to Examples

Pooling with BS 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
#> Duration                       -0.0084  0.0038 0.0273 -0.0159 -0.0009
#> Previous                       -0.1772  0.2005 0.3766 -0.5701  0.2157
#> Radiation                      -1.6902  1.0884 0.1206 -3.8250  0.4446
#> Onset                          -0.0975  0.1780 0.5838 -0.4464  0.2514
#> Function                        0.0425  0.0178 0.0168  0.0077  0.0773
#> Tampascale                     -0.0834  0.0376 0.0265 -0.1571 -0.0097
#> factor(Satisfaction)1          -0.1900  0.3181 0.5527 -0.8276  0.4475
#> factor(Satisfaction)2          -0.0607  0.3992 0.8796 -0.8586  0.7371
#> factor(Expect_cat)2            -2.1919  1.6183 0.1759 -5.3671  0.9833
#> factor(Expect_cat)3            -1.4635  1.4236 0.3039 -4.2536  1.3266
#> Radiation:Tampascale            0.0393  0.0266 0.1394 -0.0128  0.0915
#> Tampascale:factor(Expect_cat)2  0.0603  0.0403 0.1341 -0.0186  0.1393
#> Tampascale:factor(Expect_cat)3  0.0423  0.0365 0.2458 -0.0291  0.1138
#>                                    HR   L.HR   U.HR
#> Duration                       0.9916 0.9842 0.9991
#> Previous                       0.8376 0.5655 1.2407
#> Radiation                      0.1845 0.0218 1.5599
#> Onset                          0.9071 0.6399 1.2858
#> Function                       1.0434 1.0077 1.0804
#> Tampascale                     0.9200 0.8546 0.9903
#> factor(Satisfaction)1          0.8270 0.4371 1.5644
#> factor(Satisfaction)2          0.9411 0.4238 2.0899
#> factor(Expect_cat)2            0.1117 0.0047 2.6733
#> factor(Expect_cat)3            0.2314 0.0142 3.7682
#> Radiation:Tampascale           1.0401 0.9873 1.0958
#> Tampascale:factor(Expect_cat)2 1.0622 0.9816 1.1495
#> Tampascale:factor(Expect_cat)3 1.0432 0.9713 1.1205
#> 
#> $`Step 2`
#>                                    est std.err signif   lower   upper
#> Duration                       -0.0085  0.0038 0.0265 -0.0160 -0.0010
#> Previous                       -0.1895  0.1963 0.3344 -0.5742  0.1953
#> Radiation                      -1.5692  1.0634 0.1401 -3.6540  0.5157
#> Onset                          -0.1119  0.1771 0.5274 -0.4591  0.2352
#> Function                        0.0429  0.0173 0.0135  0.0089  0.0768
#> Tampascale                     -0.0811  0.0371 0.0289 -0.1539 -0.0083
#> factor(Expect_cat)2            -2.0401  1.5897 0.1995 -5.1578  1.0776
#> factor(Expect_cat)3            -1.4691  1.4155 0.2993 -4.2435  1.3053
#> Radiation:Tampascale            0.0367  0.0261 0.1594 -0.0144  0.0878
#> Tampascale:factor(Expect_cat)2  0.0571  0.0397 0.1500 -0.0207  0.1349
#> Tampascale:factor(Expect_cat)3  0.0422  0.0363 0.2443 -0.0289  0.1134
#>                                    HR   L.HR   U.HR
#> Duration                       0.9915 0.9841 0.9990
#> Previous                       0.8274 0.5632 1.2157
#> Radiation                      0.2082 0.0259 1.6748
#> Onset                          0.8941 0.6319 1.2652
#> Function                       1.0438 1.0089 1.0798
#> Tampascale                     0.9221 0.8574 0.9917
#> factor(Expect_cat)2            0.1300 0.0058 2.9376
#> factor(Expect_cat)3            0.2301 0.0144 3.6888
#> Radiation:Tampascale           1.0374 0.9857 1.0918
#> Tampascale:factor(Expect_cat)2 1.0588 0.9795 1.1444
#> Tampascale:factor(Expect_cat)3 1.0431 0.9715 1.1201
#> 
#> $`Step 3`
#>                                    est std.err signif   lower   upper
#> Duration                       -0.0087  0.0038 0.0232 -0.0161 -0.0012
#> Previous                       -0.1820  0.1959 0.3529 -0.5659  0.2020
#> Radiation                      -1.4856  1.0514 0.1577 -3.5468  0.5757
#> Function                        0.0431  0.0173 0.0130  0.0091  0.0771
#> Tampascale                     -0.0815  0.0371 0.0279 -0.1541 -0.0088
#> factor(Expect_cat)2            -2.0787  1.5854 0.1900 -5.1880  1.0307
#> factor(Expect_cat)3            -1.5132  1.4132 0.2843 -4.2830  1.2565
#> Radiation:Tampascale            0.0347  0.0258 0.1789 -0.0159  0.0852
#> Tampascale:factor(Expect_cat)2  0.0583  0.0395 0.1403 -0.0192  0.1358
#> Tampascale:factor(Expect_cat)3  0.0435  0.0362 0.2299 -0.0275  0.1145
#>                                    HR   L.HR   U.HR
#> Duration                       0.9913 0.9840 0.9988
#> Previous                       0.8336 0.5678 1.2238
#> Radiation                      0.2264 0.0288 1.7784
#> Function                       1.0440 1.0091 1.0802
#> Tampascale                     0.9217 0.8572 0.9912
#> factor(Expect_cat)2            0.1251 0.0056 2.8030
#> factor(Expect_cat)3            0.2202 0.0138 3.5131
#> Radiation:Tampascale           1.0353 0.9842 1.0889
#> Tampascale:factor(Expect_cat)2 1.0600 0.9810 1.1455
#> Tampascale:factor(Expect_cat)3 1.0445 0.9729 1.1213
#> 
#> $`Step 4`
#>                                    est std.err signif   lower   upper
#> Duration                       -0.0083  0.0038 0.0290 -0.0157 -0.0008
#> Radiation                      -1.5430  1.0557 0.1439 -3.6128  0.5268
#> Function                        0.0428  0.0173 0.0131  0.0090  0.0767
#> Tampascale                     -0.0818  0.0369 0.0269 -0.1542 -0.0094
#> factor(Expect_cat)2            -2.1396  1.5729 0.1738 -5.2237  0.9445
#> factor(Expect_cat)3            -1.5389  1.4141 0.2765 -4.3105  1.2326
#> Radiation:Tampascale            0.0364  0.0259 0.1602 -0.0144  0.0871
#> Tampascale:factor(Expect_cat)2  0.0596  0.0392 0.1287 -0.0173  0.1365
#> Tampascale:factor(Expect_cat)3  0.0445  0.0362 0.2192 -0.0265  0.1155
#>                                    HR   L.HR   U.HR
#> Duration                       0.9917 0.9844 0.9992
#> Radiation                      0.2137 0.0270 1.6935
#> Function                       1.0437 1.0090 1.0797
#> Tampascale                     0.9215 0.8571 0.9906
#> factor(Expect_cat)2            0.1177 0.0054 2.5715
#> factor(Expect_cat)3            0.2146 0.0134 3.4301
#> Radiation:Tampascale           1.0371 0.9857 1.0910
#> Tampascale:factor(Expect_cat)2 1.0614 0.9828 1.1463
#> Tampascale:factor(Expect_cat)3 1.0455 0.9738 1.1224
  pool_coxr$multiparm_p
#> $`Step 1`
#>                                   D2 D2 & RR p-values
#> 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 D2 & RR p-values
#> 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 D2 & RR p-values
#> 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 D2 & RR p-values
#> 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

Back to Examples

Pooling with BS including spline coefficient 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 spline predictor and forcing these 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
#> Duration                                -0.0087  0.0038 0.0227 -0.0161
#> Previous                                -0.1683  0.2013 0.4030 -0.5629
#> Radiation                               -1.5246  1.9303 0.4297 -5.3087
#> Onset                                   -0.1231  0.1783 0.4897 -0.4725
#> Function                                 0.0487  0.0183 0.0077  0.0129
#> factor(Satisfaction)1                   -0.1715  0.3109 0.5832 -0.7930
#> factor(Satisfaction)2                   -0.0078  0.3960 0.9844 -0.7987
#> rcs(Tampascale, 3)Tampascale            -0.0811  0.0355 0.0223 -0.1507
#> rcs(Tampascale, 3)Tampascale'            0.0634  0.0439 0.1487 -0.0226
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0367  0.0539 0.4954 -0.0689
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0182  0.0587 0.7563 -0.1332
#>                                           upper     HR   L.HR   U.HR
#> Duration                                -0.0012 0.9913 0.9840 0.9988
#> Previous                                 0.2262 0.8451 0.5696 1.2538
#> Radiation                                2.2594 0.2177 0.0049 9.5773
#> Onset                                    0.2263 0.8842 0.6234 1.2540
#> Function                                 0.0845 1.0499 1.0130 1.0882
#> factor(Satisfaction)1                    0.4500 0.8424 0.4525 1.5683
#> factor(Satisfaction)2                    0.7831 0.9922 0.4499 2.1882
#> rcs(Tampascale, 3)Tampascale            -0.0116 0.9221 0.8601 0.9885
#> rcs(Tampascale, 3)Tampascale'            0.1494 1.0655 0.9777 1.1611
#> Radiation:rcs(Tampascale, 3)Tampascale   0.1424 1.0374 0.9334 1.1530
#> Radiation:rcs(Tampascale, 3)Tampascale'  0.0968 0.9820 0.8753 1.1016
#> 
#> $`Step 2`
#>                                             est std.err signif   lower
#> Duration                                -0.0086  0.0038 0.0242 -0.0160
#> Previous                                -0.1753  0.1970 0.3735 -0.5614
#> Radiation                               -1.4583  1.9217 0.4480 -5.2255
#> Onset                                   -0.1412  0.1770 0.4251 -0.4881
#> Function                                 0.0489  0.0178 0.0061  0.0140
#> rcs(Tampascale, 3)Tampascale            -0.0786  0.0351 0.0252 -0.1474
#> rcs(Tampascale, 3)Tampascale'            0.0615  0.0437 0.1588 -0.0241
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0356  0.0538 0.5085 -0.0699
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0188  0.0588 0.7490 -0.1340
#>                                           upper     HR   L.HR    U.HR
#> Duration                                -0.0011 0.9914 0.9841  0.9989
#> Previous                                 0.2108 0.8392 0.5704  1.2347
#> Radiation                                2.3090 0.2326 0.0054 10.0644
#> Onset                                    0.2057 0.8683 0.6138  1.2284
#> Function                                 0.0838 1.0501 1.0141  1.0874
#> rcs(Tampascale, 3)Tampascale            -0.0098 0.9244 0.8629  0.9902
#> rcs(Tampascale, 3)Tampascale'            0.1471 1.0634 0.9762  1.1585
#> Radiation:rcs(Tampascale, 3)Tampascale   0.1410 1.0362 0.9325  1.1514
#> Radiation:rcs(Tampascale, 3)Tampascale'  0.0964 0.9814 0.8746  1.1012
#> 
#> $`Step 3`
#>                                             est std.err signif   lower
#> Duration                                -0.0088  0.0038 0.0201 -0.0162
#> Previous                                -0.1652  0.1968 0.4013 -0.5510
#> Radiation                               -1.3271  1.9232 0.4902 -5.0972
#> Function                                 0.0495  0.0179 0.0056  0.0145
#> rcs(Tampascale, 3)Tampascale            -0.0775  0.0353 0.0284 -0.1467
#> rcs(Tampascale, 3)Tampascale'            0.0612  0.0440 0.1644 -0.0251
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0323  0.0539 0.5494 -0.0734
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0179  0.0591 0.7626 -0.1337
#>                                           upper     HR   L.HR    U.HR
#> Duration                                -0.0014 0.9912 0.9839  0.9986
#> Previous                                 0.2206 0.8477 0.5764  1.2468
#> Radiation                                2.4431 0.2652 0.0061 11.5087
#> Function                                 0.0844 1.0507 1.0146  1.0881
#> rcs(Tampascale, 3)Tampascale            -0.0082 0.9254 0.8636  0.9918
#> rcs(Tampascale, 3)Tampascale'            0.1475 1.0631 0.9752  1.1589
#> Radiation:rcs(Tampascale, 3)Tampascale   0.1379 1.0328 0.9292  1.1479
#> Radiation:rcs(Tampascale, 3)Tampascale'  0.0980 0.9823 0.8749  1.1030
#> 
#> $`Step 4`
#>                                             est std.err signif   lower
#> Duration                                -0.0085  0.0038 0.0247 -0.0159
#> Radiation                               -1.1657  1.9282 0.5455 -4.9462
#> Function                                 0.0495  0.0178 0.0055  0.0146
#> rcs(Tampascale, 3)Tampascale            -0.0767  0.0356 0.0314 -0.1466
#> rcs(Tampascale, 3)Tampascale'            0.0608  0.0444 0.1703 -0.0261
#> Radiation:rcs(Tampascale, 3)Tampascale   0.0278  0.0540 0.6068 -0.0781
#> Radiation:rcs(Tampascale, 3)Tampascale' -0.0118  0.0589 0.8411 -0.1272
#>                                           upper     HR   L.HR    U.HR
#> Duration                                -0.0011 0.9915 0.9842  0.9989
#> Radiation                                2.6147 0.3117 0.0071 13.6631
#> Function                                 0.0844 1.0507 1.0147  1.0881
#> rcs(Tampascale, 3)Tampascale            -0.0068 0.9262 0.8636  0.9932
#> rcs(Tampascale, 3)Tampascale'            0.1478 1.0627 0.9742  1.1593
#> Radiation:rcs(Tampascale, 3)Tampascale   0.1338 1.0282 0.9249  1.1432
#> Radiation:rcs(Tampascale, 3)Tampascale'  0.1036 0.9883 0.8806  1.1092
  pool_coxr$multiparm_p
#> $`Step 1`
#>                             Chi_sq D1 & RR p-values
#> 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 D1 & RR p-values
#> 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 D1 & RR p-values
#> 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 D1 & RR p-values
#> 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

Back to Examples