library(metaRmat)

becker09 
#>    ID   N Team Cognitive_Performance Somatic_Performance
#> 1   1 142    I                 -0.55               -0.48
#> 2   3  37    I                  0.53               -0.12
#> 3   6  16    T                  0.44                0.46
#> 4  10  14    I                 -0.39               -0.17
#> 5  17  45    I                  0.10                0.31
#> 6  22 100    I                  0.23                0.08
#> 7  26  51    T                 -0.52               -0.43
#> 8  28 128    T                  0.14                0.02
#> 9  36  70    T                 -0.01               -0.16
#> 10 38  30    I                 -0.27               -0.13
#>    Selfconfidence_Performance Somatic_Cognitive Selfconfidence_Cognitive
#> 1                        0.66              0.47                    -0.38
#> 2                        0.03              0.52                    -0.48
#> 3                          NA              0.67                       NA
#> 4                        0.19              0.21                    -0.54
#> 5                       -0.17                NA                       NA
#> 6                        0.51              0.45                    -0.29
#> 7                        0.16              0.57                    -0.18
#> 8                        0.13              0.56                    -0.53
#> 9                        0.42              0.62                    -0.46
#> 10                       0.15              0.63                    -0.68
#>    Selfconfidence_Somatic
#> 1                   -0.46
#> 2                   -0.40
#> 3                      NA
#> 4                   -0.43
#> 5                      NA
#> 6                   -0.44
#> 7                   -0.26
#> 8                   -0.27
#> 9                   -0.54
#> 10                  -0.71
becker09_list <- df_to_corr(becker09, 
                            variables = c('Cognitive_Performance',
                                          'Somatic_Performance',
                                          'Selfconfidence_Performance', 
                                          'Somatic_Cognitive',
                                          'Selfconfidence_Cognitive',
                                          'Selfconfidence_Somatic'),
                            ID = 'ID')

Calculate OS

olkin_siotani(becker09_list, becker09$N, type = 'simple')
#> $`1`
#>               [,1]          [,2]          [,3]          [,4]         [,5]
#> [1,]  0.0034261004  0.0013171732 -0.0005506743 -0.0013869482  0.002484276
#> [2,]  0.0013171732  0.0041710152 -0.0009454355 -0.0019296735  0.001255949
#> [3,] -0.0005506743 -0.0009454355  0.0022432913  0.0005750309 -0.001522996
#> [4,] -0.0013869482 -0.0019296735  0.0005750309  0.0042746254 -0.001789994
#> [5,]  0.0024842764  0.0012559487 -0.0015229965 -0.0017899942  0.005155291
#> [6,]  0.0009256722  0.0024983594 -0.0010617161 -0.0011965696  0.001871134
#>               [,6]
#> [1,]  0.0009256722
#> [2,]  0.0024983594
#> [3,] -0.0010617161
#> [4,] -0.0011965696
#> [5,]  0.0018711342
#> [6,]  0.0043772856
#> 
#> $`3`
#>              [,1]          [,2]         [,3]         [,4]         [,5]
#> [1,]  0.013975806  0.0102771551 -0.009422000 -0.003072717  0.002073221
#> [2,]  0.010277155  0.0262542530 -0.010605285  0.010610977 -0.001957098
#> [3,] -0.009422000 -0.0106052849  0.026978400 -0.001231771  0.011106031
#> [4,] -0.003072717  0.0106109773 -0.001231771  0.014386923 -0.004252644
#> [5,]  0.002073221 -0.0019570984  0.011106031 -0.004252644  0.016007680
#> [6,]  0.003296470  0.0001344649 -0.002587670 -0.006435978  0.007687265
#>               [,6]
#> [1,]  0.0032964703
#> [2,]  0.0001344649
#> [3,] -0.0025876703
#> [4,] -0.0064359784
#> [5,]  0.0076872649
#> [6,]  0.0190702703
#> 
#> $`6`
#>             [,1]        [,2]    [,3]        [,4]     [,5]     [,6]
#> [1,] 0.040642560 0.023984433 0.00000 0.008934021 0.000000 0.000000
#> [2,] 0.023984433 0.038848410 0.00000 0.007931051 0.000000 0.000000
#> [3,] 0.000000000 0.000000000 0.06250 0.000000000 0.027500 0.028750
#> [4,] 0.008934021 0.007931051 0.00000 0.018981951 0.000000 0.000000
#> [5,] 0.000000000 0.000000000 0.02750 0.000000000 0.062500 0.041875
#> [6,] 0.000000000 0.000000000 0.02875 0.000000000 0.041875 0.062500
#> 
#> $`10`
#>              [,1]        [,2]         [,3]         [,4]         [,5]
#> [1,]  0.051352458  0.01045015 -0.029935614 -0.007493846  0.003637139
#> [2,]  0.010450147  0.06735966 -0.027852563 -0.024835574  0.007889820
#> [3,] -0.029935614 -0.02785256  0.066364515  0.011166080 -0.016822196
#> [4,] -0.007493846 -0.02483557  0.011166080  0.065267486 -0.018461930
#> [5,]  0.003637139  0.00788982 -0.016822196 -0.018461930  0.035845040
#> [6,]  0.003500478  0.00871156 -0.007270601 -0.028192506  0.003876904
#>              [,6]
#> [1,]  0.003500478
#> [2,]  0.008711560
#> [3,] -0.007270601
#> [4,] -0.028192506
#> [5,]  0.003876904
#> [6,]  0.047456286
#> 
#> $`17`
#>               [,1]          [,2]         [,3]         [,4]          [,5]
#> [1,]  0.0217800000 -0.0003078989 0.0001815411 0.0068200000 -0.0037400000
#> [2,] -0.0003078989  0.0181563380 0.0005123611 0.0020086667  0.0001171111
#> [3,]  0.0001815411  0.0005123611 0.0209563380 0.0001171111  0.0021580000
#> [4,]  0.0068200000  0.0020086667 0.0001171111 0.0222222222  0.0000000000
#> [5,] -0.0037400000  0.0001171111 0.0021580000 0.0000000000  0.0222222222
#> [6,]  0.0001171111 -0.0034147333 0.0066898000 0.0000000000  0.0000000000
#>               [,6]
#> [1,]  0.0001171111
#> [2,] -0.0034147333
#> [3,]  0.0066898000
#> [4,]  0.0000000000
#> [5,]  0.0000000000
#> [6,]  0.0222222222
#> 
#> $`22`
#>               [,1]          [,2]         [,3]          [,4]          [,5]
#> [1,]  0.0089699841  0.0041652356 -0.002345901  0.0002136615  0.0046023671
#> [2,]  0.0041652356  0.0098724096 -0.003337540  0.0016866540  0.0009146944
#> [3,] -0.0023459008 -0.0033375396  0.005474520 -0.0011433425  0.0019541845
#> [4,]  0.0002136615  0.0016866540 -0.001143343  0.0063600625 -0.0027997905
#> [5,]  0.0046023671  0.0009146944  0.001954185 -0.0027997905  0.0083887281
#> [6,]  0.0014970814  0.0041750224  0.001042808 -0.0012367080  0.0029187176
#>              [,6]
#> [1,]  0.001497081
#> [2,]  0.004175022
#> [3,]  0.001042808
#> [4,] -0.001236708
#> [5,]  0.002918718
#> [6,]  0.006502810
#> 
#> $`26`
#>               [,1]         [,2]         [,3]         [,4]         [,5]
#> [1,]  0.0104375718  0.005605987 -0.001936891 -0.002773464  0.001571002
#> [2,]  0.0056059875  0.013027216 -0.003537973 -0.004469951  0.001817705
#> [3,] -0.0019368910 -0.003537973  0.018616772  0.001521170 -0.009415078
#> [4,] -0.0027734635 -0.004469951  0.001521170  0.008936471 -0.002698027
#> [5,]  0.0015710024  0.001817705 -0.009415078 -0.002698027  0.018357838
#> [6,]  0.0009145349  0.001553839 -0.007351147 -0.001308531  0.009794954
#>               [,6]
#> [1,]  0.0009145349
#> [2,]  0.0015538390
#> [3,] -0.0073511467
#> [4,] -0.0013085312
#> [5,]  0.0097949541
#> [6,]  0.0170464659
#> 
#> $`28`
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0075092512  0.0042802113 -4.038021e-03 -9.989750e-05  0.0009082770
#> [2,]  0.0042802113  0.0078062513 -2.082123e-03  7.211575e-04  0.0004559930
#> [3,] -0.0040380208 -0.0020821230  7.550669e-03 -7.175531e-05  0.0009517466
#> [4,] -0.0000998975  0.0007211575 -7.175531e-05  3.680820e-03 -0.0004697434
#> [5,]  0.0009082770  0.0004559930  9.517466e-04 -4.697434e-04  0.0040398813
#> [6,]  0.0005956717  0.0009603708  2.669609e-04 -2.343832e-03  0.0026412068
#>               [,6]
#> [1,]  0.0005956717
#> [2,]  0.0009603708
#> [3,]  0.0002669609
#> [4,] -0.0023438316
#> [5,]  0.0026412068
#> [6,]  0.0067149563
#> 
#> $`36`
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.014282857  0.0086227726 -0.0053932144 -0.0013807330  0.0047096947
#> [2,]  0.008622773  0.0135636480 -0.0059129280  0.0003337006  0.0019393143
#> [3,] -0.005393214 -0.0059129280  0.0096902423 -0.0001936746  0.0007569934
#> [4,] -0.001380733  0.0003337006 -0.0001936746  0.0054137623 -0.0028875966
#> [5,]  0.004709695  0.0019393143  0.0007569934 -0.0028875966  0.0088796366
#> [6,]  0.002496209  0.0037842789 -0.0003956320 -0.0018603463  0.0042007989
#>              [,6]
#> [1,]  0.002496209
#> [2,]  0.003784279
#> [3,] -0.000395632
#> [4,] -0.001860346
#> [5,]  0.004200799
#> [6,]  0.007169008
#> 
#> $`38`
#>               [,1]         [,2]         [,3]          [,4]         [,5]
#> [1,]  0.0286504803  0.018813919 -0.020205782 -0.0008423278  0.000970368
#> [2,]  0.0188139195  0.032216187 -0.022585837 -0.0045751455  0.002624629
#> [3,] -0.0202057817 -0.022585837  0.031850208  0.0026169392 -0.003884160
#> [4,] -0.0008423278 -0.004575145  0.002616939  0.0121243203 -0.005924576
#> [5,]  0.0009703680  0.002624629 -0.003884160 -0.0059245760  0.009633792
#> [6,]  0.0005846132  0.001692751 -0.001241113 -0.0049531470  0.003627659
#>               [,6]
#> [1,]  0.0005846132
#> [2,]  0.0016927508
#> [3,] -0.0012411125
#> [4,] -0.0049531470
#> [5,]  0.0036276587
#> [6,]  0.0081972270
olkin_siotani(becker09_list, becker09$N, type = 'average')
#> [[1]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0070295832  3.289086e-03 -2.364611e-03 -3.013323e-04  1.248852e-03
#> [2,]  0.0032890857  6.988217e-03 -2.317713e-03 -8.433319e-05  5.007012e-04
#> [3,] -0.0023646107 -2.317713e-03  6.446083e-03  2.398694e-05  3.967482e-05
#> [4,] -0.0003013323 -8.433319e-05  2.398694e-05  4.274625e-03 -1.305204e-03
#> [5,]  0.0012488522  5.007012e-04  3.967482e-05 -1.305204e-03  5.387832e-03
#> [6,]  0.0005656873  1.215118e-03 -1.506488e-04 -1.326923e-03  2.255165e-03
#>               [,6]
#> [1,]  0.0005656873
#> [2,]  0.0012151181
#> [3,] -0.0001506488
#> [4,] -0.0013269233
#> [5,]  0.0022551654
#> [6,]  0.0054139189
#> 
#> [[2]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.026978400  0.0126229775 -9.074992e-03 -1.156465e-03  0.0047928922
#> [2,]  0.012622978  0.0268196426 -8.895007e-03 -3.236571e-04  0.0019216099
#> [3,] -0.009074992 -0.0088950066  2.473902e-02  9.205799e-05  0.0001522655
#> [4,] -0.001156465 -0.0003236571  9.205799e-05  1.640532e-02 -0.0050091617
#> [5,]  0.004792892  0.0019216099  1.522655e-04 -5.009162e-03  0.0206776243
#> [6,]  0.002171016  0.0046634263 -5.781657e-04 -5.092516e-03  0.0086549589
#>               [,6]
#> [1,]  0.0021710162
#> [2,]  0.0046634263
#> [3,] -0.0005781657
#> [4,] -0.0050925164
#> [5,]  0.0086549589
#> [6,]  0.0207777429
#> 
#> [[3]]
#>              [,1]          [,2]          [,3]          [,4]         [,5]
#> [1,]  0.062387551  0.0291906356 -0.0209859201 -0.0026743244  0.011083563
#> [2,]  0.029190636  0.0620204235 -0.0205697028 -0.0007484571  0.004443723
#> [3,] -0.020985920 -0.0205697028  0.0572089859  0.0002128841  0.000352114
#> [4,] -0.002674324 -0.0007484571  0.0002128841  0.0379373006 -0.011583687
#> [5,]  0.011083563  0.0044437230  0.0003521140 -0.0115836865  0.047817006
#> [6,]  0.005020475  0.0107841733 -0.0013370081 -0.0117764442  0.020014592
#>              [,6]
#> [1,]  0.005020475
#> [2,]  0.010784173
#> [3,] -0.001337008
#> [4,] -0.011776444
#> [5,]  0.020014592
#> [6,]  0.048048530
#> 
#> [[4]]
#>              [,1]          [,2]          [,3]          [,4]         [,5]
#> [1,]  0.071300058  0.0333607264 -0.0239839087 -0.0030563707  0.012666929
#> [2,]  0.033360726  0.0708804840 -0.0235082317 -0.0008553795  0.005078541
#> [3,] -0.023983909 -0.0235082317  0.0653816981  0.0002432961  0.000402416
#> [4,] -0.003056371 -0.0008553795  0.0002432961  0.0433569150 -0.013238499
#> [5,]  0.012666929  0.0050785406  0.0004024160 -0.0132384989  0.054648007
#> [6,]  0.005737686  0.0123247694 -0.0015280093 -0.0134587934  0.022873820
#>              [,6]
#> [1,]  0.005737686
#> [2,]  0.012324769
#> [3,] -0.001528009
#> [4,] -0.013458793
#> [5,]  0.022873820
#> [6,]  0.054912606
#> 
#> [[5]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0221822402  0.0103788926 -7.461660e-03 -9.508709e-04  0.0039408225
#> [2,]  0.0103788926  0.0220517061 -7.313672e-03 -2.661181e-04  0.0015799904
#> [3,] -0.0074616605 -0.0073136721  2.034097e-02  7.569213e-05  0.0001251961
#> [4,] -0.0009508709 -0.0002661181  7.569213e-05  1.348882e-02 -0.0041186441
#> [5,]  0.0039408225  0.0015799904  1.251961e-04 -4.118644e-03  0.0170016022
#> [6,]  0.0017850578  0.0038343727 -4.753807e-04 -4.187180e-03  0.0071162996
#>               [,6]
#> [1,]  0.0017850578
#> [2,]  0.0038343727
#> [3,] -0.0004753807
#> [4,] -0.0041871802
#> [5,]  0.0071162996
#> [6,]  0.0170839219
#> 
#> [[6]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0099820081  0.0046705017 -3.357747e-03 -4.278919e-04  1.773370e-03
#> [2,]  0.0046705017  0.0099232678 -3.291152e-03 -1.197531e-04  7.109957e-04
#> [3,] -0.0033577472 -0.0032911524  9.153438e-03  3.406146e-05  5.633824e-05
#> [4,] -0.0004278919 -0.0001197531  3.406146e-05  6.069968e-03 -1.853390e-03
#> [5,]  0.0017733701  0.0007109957  5.633824e-05 -1.853390e-03  7.650721e-03
#> [6,]  0.0008032760  0.0017254677 -2.139213e-04 -1.884231e-03  3.202335e-03
#>               [,6]
#> [1,]  0.0008032760
#> [2,]  0.0017254677
#> [3,] -0.0002139213
#> [4,] -0.0018842311
#> [5,]  0.0032023348
#> [6,]  0.0076877649
#> 
#> [[7]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0195725649  0.0091578464 -6.583818e-03 -8.390037e-04  0.0034771963
#> [2,]  0.0091578464  0.0194573878 -6.453240e-03 -2.348101e-04  0.0013941092
#> [3,] -0.0065838181 -0.0064532401  1.794792e-02  6.678717e-05  0.0001104671
#> [4,] -0.0008390037 -0.0002348101  6.678717e-05  1.190190e-02 -0.0036340977
#> [5,]  0.0034771963  0.0013941092  1.104671e-04 -3.634098e-03  0.0150014137
#> [6,]  0.0015750510  0.0033832700 -4.194535e-04 -3.694571e-03  0.0062790878
#>               [,6]
#> [1,]  0.0015750510
#> [2,]  0.0033832700
#> [3,] -0.0004194535
#> [4,] -0.0036945707
#> [5,]  0.0062790878
#> [6,]  0.0150740488
#> 
#> [[8]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0077984438  3.648829e-03 -2.623240e-03 -3.342905e-04  1.385445e-03
#> [2,]  0.0036488294  7.752553e-03 -2.571213e-03 -9.355713e-05  5.554654e-04
#> [3,] -0.0026232400 -2.571213e-03  7.151123e-03  2.661051e-05  4.401425e-05
#> [4,] -0.0003342905 -9.355713e-05  2.661051e-05  4.742163e-03 -1.447961e-03
#> [5,]  0.0013854454  5.554654e-04  4.401425e-05 -1.447961e-03  5.977126e-03
#> [6,]  0.0006275594  1.348022e-03 -1.671260e-04 -1.472056e-03  2.501824e-03
#>               [,6]
#> [1,]  0.0006275594
#> [2,]  0.0013480217
#> [3,] -0.0001671260
#> [4,] -0.0014720555
#> [5,]  0.0025018241
#> [6,]  0.0060060663
#> 
#> [[9]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0142600116  0.0066721453 -4.796782e-03 -6.112741e-04  0.0025333859
#> [2,]  0.0066721453  0.0141760968 -4.701646e-03 -1.710759e-04  0.0010157081
#> [3,] -0.0047967817 -0.0047016463  1.307634e-02  4.865922e-05  0.0000804832
#> [4,] -0.0006112741 -0.0001710759  4.865922e-05  8.671383e-03 -0.0026476998
#> [5,]  0.0025333859  0.0010157081  8.048320e-05 -2.647700e-03  0.0109296014
#> [6,]  0.0011475371  0.0024649539 -3.056019e-04 -2.691759e-03  0.0045747640
#>               [,6]
#> [1,]  0.0011475371
#> [2,]  0.0024649539
#> [3,] -0.0003056019
#> [4,] -0.0026917587
#> [5,]  0.0045747640
#> [6,]  0.0109825212
#> 
#> [[10]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.033273360  0.0155683390 -0.0111924907 -0.0014263063  0.0059112337
#> [2,]  0.015568339  0.0330775592 -0.0109705081 -0.0003991771  0.0023699856
#> [3,] -0.011192491 -0.0109705081  0.0305114591  0.0001135382  0.0001877941
#> [4,] -0.001426306 -0.0003991771  0.0001135382  0.0202332270 -0.0061779661
#> [5,]  0.005911234  0.0023699856  0.0001877941 -0.0061779661  0.0255024033
#> [6,]  0.002677587  0.0057515591 -0.0007130710 -0.0062807702  0.0106744493
#>              [,6]
#> [1,]  0.002677587
#> [2,]  0.005751559
#> [3,] -0.000713071
#> [4,] -0.006280770
#> [5,]  0.010674449
#> [6,]  0.025625883
olkin_siotani(becker09_list, becker09$N, type = 'weighted')
#> [[1]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0069654427  0.0035826383 -2.546208e-03 -5.465475e-04  1.793430e-03
#> [2,]  0.0035826383  0.0068183101 -2.464542e-03 -2.054418e-04  7.900319e-04
#> [3,] -0.0025462082 -0.0024645424  5.646192e-03  8.429113e-05 -3.665714e-05
#> [4,] -0.0005465475 -0.0002054418  8.429113e-05  3.713599e-03 -1.322248e-03
#> [5,]  0.0017934299  0.0007900319 -3.665714e-05 -1.322248e-03  4.816630e-03
#> [6,]  0.0009032299  0.0017190669 -3.112306e-04 -1.332573e-03  2.183179e-03
#>               [,6]
#> [1,]  0.0009032299
#> [2,]  0.0017190669
#> [3,] -0.0003112306
#> [4,] -0.0013325731
#> [5,]  0.0021831791
#> [6,]  0.0048308442
#> 
#> [[2]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.026732240  0.0137495849 -0.0097719340 -0.0020975607  0.0068828929
#> [2,]  0.013749585  0.0261675684 -0.0094585142 -0.0007884523  0.0030320142
#> [3,] -0.009771934 -0.0094585142  0.0216691705  0.0003234957 -0.0001406842
#> [4,] -0.002097561 -0.0007884523  0.0003234957  0.0142521901 -0.0050745751
#> [5,]  0.006882893  0.0030320142 -0.0001406842 -0.0050745751  0.0184854450
#> [6,]  0.003466450  0.0065975001 -0.0011944526 -0.0051141994  0.0083786872
#>              [,6]
#> [1,]  0.003466450
#> [2,]  0.006597500
#> [3,] -0.001194453
#> [4,] -0.005114199
#> [5,]  0.008378687
#> [6,]  0.018539997
#> 
#> [[3]]
#>              [,1]         [,2]          [,3]          [,4]          [,5]
#> [1,]  0.061818304  0.031795915 -0.0225975974 -0.0048506092  0.0159166899
#> [2,]  0.031795915  0.060512502 -0.0218728140 -0.0018232960  0.0070115328
#> [3,] -0.022597597 -0.021872814  0.0501099567  0.0007480838 -0.0003253321
#> [4,] -0.004850609 -0.001823296  0.0007480838  0.0329581895 -0.0117349548
#> [5,]  0.015916690  0.007011533 -0.0003253321 -0.0117349548  0.0427475916
#> [6,]  0.008016165  0.015256719 -0.0027621716 -0.0118265861  0.0193757142
#>              [,6]
#> [1,]  0.008016165
#> [2,]  0.015256719
#> [3,] -0.002762172
#> [4,] -0.011826586
#> [5,]  0.019375714
#> [6,]  0.042873742
#> 
#> [[4]]
#>              [,1]         [,2]          [,3]          [,4]          [,5]
#> [1,]  0.070649490  0.036338189 -0.0258258256 -0.0055435533  0.0181905028
#> [2,]  0.036338189  0.069157145 -0.0249975017 -0.0020837669  0.0080131803
#> [3,] -0.025825826 -0.024997502  0.0572685220  0.0008549529 -0.0003718081
#> [4,] -0.005543553 -0.002083767  0.0008549529  0.0376665023 -0.0134113769
#> [5,]  0.018190503  0.008013180 -0.0003718081 -0.0134113769  0.0488543904
#> [6,]  0.009161332  0.017436250 -0.0031567676 -0.0135160983  0.0221436733
#>              [,6]
#> [1,]  0.009161332
#> [2,]  0.017436250
#> [3,] -0.003156768
#> [4,] -0.013516098
#> [5,]  0.022143673
#> [6,]  0.048998563
#> 
#> [[5]]
#>              [,1]         [,2]          [,3]          [,4]          [,5]
#> [1,]  0.021979841  0.011305214 -0.0080347013 -0.0017246610  0.0056592675
#> [2,]  0.011305214  0.021515556 -0.0077770005 -0.0006482830  0.0024929894
#> [3,] -0.008034701 -0.007777001  0.0178168735  0.0002659853 -0.0001156736
#> [4,] -0.001724661 -0.000648283  0.0002659853  0.0117184674 -0.0041724284
#> [5,]  0.005659268  0.002492989 -0.0001156736 -0.0041724284  0.0151991437
#> [6,]  0.002850192  0.005424611 -0.0009821055 -0.0042050084  0.0068891428
#>               [,6]
#> [1,]  0.0028501921
#> [2,]  0.0054246112
#> [3,] -0.0009821055
#> [4,] -0.0042050084
#> [5,]  0.0068891428
#> [6,]  0.0152439973
#> 
#> [[6]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0098909286  0.0050873464 -3.615616e-03 -0.0007760975  2.546670e-03
#> [2,]  0.0050873464  0.0096820003 -3.499650e-03 -0.0002917274  1.121845e-03
#> [3,] -0.0036156156 -0.0034996502  8.017593e-03  0.0001196934 -5.205314e-05
#> [4,] -0.0007760975 -0.0002917274  1.196934e-04  0.0052733103 -1.877593e-03
#> [5,]  0.0025466704  0.0011218452 -5.205314e-05 -0.0018775928  6.839615e-03
#> [6,]  0.0012825864  0.0024410751 -4.419475e-04 -0.0018922538  3.100114e-03
#>               [,6]
#> [1,]  0.0012825864
#> [2,]  0.0024410751
#> [3,] -0.0004419475
#> [4,] -0.0018922538
#> [5,]  0.0031001143
#> [6,]  0.0068597988
#> 
#> [[7]]
#>              [,1]          [,2]          [,3]          [,4]         [,5]
#> [1,]  0.019393978  0.0099751891 -0.0070894423 -0.0015217597  0.004993471
#> [2,]  0.009975189  0.0189843143 -0.0068620593 -0.0005720144  0.002199697
#> [3,] -0.007089442 -0.0068620593  0.0157207707  0.0002346929 -0.000102065
#> [4,] -0.001521760 -0.0005720144  0.0002346929  0.0103398242 -0.003681554
#> [5,]  0.004993471  0.0021996966 -0.0001020650 -0.0036815545  0.013411009
#> [6,]  0.002514875  0.0047864217 -0.0008665636 -0.0037103015  0.006078655
#>               [,6]
#> [1,]  0.0025148753
#> [2,]  0.0047864217
#> [3,] -0.0008665636
#> [4,] -0.0037103015
#> [5,]  0.0060786554
#> [6,]  0.0134505859
#> 
#> [[8]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0077272880  0.0039744894 -2.824700e-03 -6.063261e-04  1.989586e-03
#> [2,]  0.0039744894  0.0075640627 -2.734102e-03 -2.279120e-04  8.764416e-04
#> [3,] -0.0028246997 -0.0027341018  6.263745e-03  9.351047e-05 -4.066652e-05
#> [4,] -0.0006063261 -0.0002279120  9.351047e-05  4.119774e-03 -1.466869e-03
#> [5,]  0.0019895862  0.0008764416 -4.066652e-05 -1.466869e-03  5.343449e-03
#> [6,]  0.0010020206  0.0019070899 -3.452715e-04 -1.478323e-03  2.421964e-03
#>               [,6]
#> [1,]  0.0010020206
#> [2,]  0.0019070899
#> [3,] -0.0003452715
#> [4,] -0.0014783233
#> [5,]  0.0024219643
#> [6,]  0.0053592178
#> 
#> [[9]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.014129898  0.0072676377 -5.165165e-03 -0.0011087107  3.638101e-03
#> [2,]  0.007267638  0.0138314290 -4.999500e-03 -0.0004167534  1.602636e-03
#> [3,] -0.005165165 -0.0049995003  1.145370e-02  0.0001709906 -7.436163e-05
#> [4,] -0.001108711 -0.0004167534  1.709906e-04  0.0075333005 -2.682275e-03
#> [5,]  0.003638101  0.0016026361 -7.436163e-05 -0.0026822754  9.770878e-03
#> [6,]  0.001832266  0.0034872501 -6.313535e-04 -0.0027032197  4.428735e-03
#>               [,6]
#> [1,]  0.0018322663
#> [2,]  0.0034872501
#> [3,] -0.0006313535
#> [4,] -0.0027032197
#> [5,]  0.0044287347
#> [6,]  0.0097997126
#> 
#> [[10]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.032969762  0.0169578214 -0.0120520520 -0.0025869916  0.0084889013
#> [2,]  0.016957821  0.0322733344 -0.0116655008 -0.0009724245  0.0037394842
#> [3,] -0.012052052 -0.0116655008  0.0267253103  0.0003989780 -0.0001735105
#> [4,] -0.002586992 -0.0009724245  0.0003989780  0.0175777011 -0.0062586426
#> [5,]  0.008488901  0.0037394842 -0.0001735105 -0.0062586426  0.0227987155
#> [6,]  0.004275288  0.0081369168 -0.0014731582 -0.0063075126  0.0103337142
#>              [,6]
#> [1,]  0.004275288
#> [2,]  0.008136917
#> [3,] -0.001473158
#> [4,] -0.006307513
#> [5,]  0.010333714
#> [6,]  0.022865996

Master Prep Data Function

input_metafor <- prep_data(becker09, becker09$N, type = 'weighted', 
          variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                             'Selfconfidence_Performance', 
                             'Somatic_Cognitive',
                             'Selfconfidence_Cognitive',
                             'Selfconfidence_Somatic'),
          ID = 'ID')
fixed_model <- fit_model(data = input_metafor, effect_size = 'yi', 
          var_cor = 'V', moderators = ~ -1 + factor(outcome), 
          random_params = NULL)
random_model <- fit_model(data = input_metafor, effect_size = 'yi', 
          var_cor = 'V', moderators = ~ -1 + factor(outcome), 
          random_params = ~ factor(outcome) | factor(study))

Extract model data

model_out_fixed <- extract_model(fixed_model, 
                                 variable_names = c('Cognitive_Performance',
                                                    'Somatic_Performance',
                                                    'Selfconfidence_Performance', 
                                                    'Somatic_Cognitive',
                                                    'Selfconfidence_Cognitive',
                                                    'Selfconfidence_Somatic'))
model_out_random <- extract_model(random_model, 
                                  variable_names = c('Cognitive_Performance',
                                                     'Somatic_Performance',
                                                     'Selfconfidence_Performance', 
                                                     'Somatic_Cognitive',
                                                     'Selfconfidence_Cognitive',
                                                     'Selfconfidence_Somatic'))

Fit model with lavaan

model <- "## Regression paths
          Performance ~ Cognitive + Somatic + Selfconfidence
          Selfconfidence ~ Cognitive + Somatic"

path_output <- path_model(data = model_out_random, model = model, 
                          num_obs = 600)
summary(path_output)

Fit reduced model

model <- "## Regression paths
          Performance ~ Cognitive + Somatic"

path_output <- path_model(data = model_out_random, model = model, 
                            num_obs = 600)
summary(path_output)

Functions work with pipe %>%

library(dplyr)

model <- "## Regression paths
          Performance ~ Cognitive + Somatic + Selfconfidence
          Selfconfidence ~ Cognitive + Somatic"

prep_data(becker09, becker09$N, type = 'weighted', 
          variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                             'Selfconfidence_Performance', 
                             'Somatic_Cognitive',
                             'Selfconfidence_Cognitive',
                             'Selfconfidence_Somatic'),
          ID = 'ID') %>%
  fit_model(effect_size = 'yi', 
          var_cor = 'V', moderators = ~ -1 + factor(outcome), 
          random_params = ~ factor(outcome) | factor(study),
          structure = 'UN') %>%
  extract_model(variable_names = c('Cognitive_Performance',
                                   'Somatic_Performance',
                                   'Selfconfidence_Performance', 
                                   'Somatic_Cognitive',
                                   'Selfconfidence_Cognitive',
                                   'Selfconfidence_Somatic')) %>%
  path_model(model = model, num_obs = 600) %>% 
  summary()