Example Chapter Becker Aloe Cheung

Becker Aloe Cheung

2025-03-26

We load the necessary packages as well as the data set for the example. Because for this example we are using only complete data we remove the the two studies with NA (i.e., Study 6 and Study 17).

library(mars)

becker09 <- na.omit(becker09) # ommiting studies with NA

Next, we create a list, which will be imputed in our other functions.

becker09_list <- df_to_corr(becker09, 
                            variables = c('Cognitive_Performance',
                                          'Somatic_Performance',
                                          'Selfconfidence_Performance', 
                                          'Somatic_Cognitive',
                                          'Selfconfidence_Cognitive',
                                          'Selfconfidence_Somatic'),
                            ID = 'ID')

Calculate OS

There are currently three options for the variance-covariance matrix of the correlation matrix (i.e, simple, average, and weighted) for this example we selected the weighted option.

#olkin_siotani(becker09_list, becker09$N, type = 'simple')
#olkin_siotani(becker09_list, becker09$N, type = 'average')
olkin_siotani(becker09_list, becker09$N, type = 'weighted')
#> [[1]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0068964508  0.0034592598 -0.0024249951 -0.0007709388  0.0019806619
#> [2,]  0.0034592598  0.0066061710 -0.0022932962 -0.0002788858  0.0008637677
#> [3,] -0.0024249951 -0.0022932962  0.0053155444  0.0001634926 -0.0001362802
#> [4,] -0.0007709388 -0.0002788858  0.0001634926  0.0037574849 -0.0013337746
#> [5,]  0.0019806619  0.0008637677 -0.0001362802 -0.0013337746  0.0048166300
#> [6,]  0.0010242015  0.0018602041 -0.0005187913 -0.0013441468  0.0021616446
#>               [,6]
#> [1,]  0.0010242015
#> [2,]  0.0018602041
#> [3,] -0.0005187913
#> [4,] -0.0013441468
#> [5,]  0.0021616446
#> [6,]  0.0048308442
#> 
#> [[2]]
#>              [,1]         [,2]          [,3]          [,4]          [,5]
#> [1,]  0.026467460  0.013276078 -0.0093067379 -0.0029587381  0.0076014592
#> [2,]  0.013276078  0.025353413 -0.0088012989 -0.0010703186  0.0033150004
#> [3,] -0.009306738 -0.008801299  0.0204001974  0.0006274581 -0.0005230214
#> [4,] -0.002958738 -0.001070319  0.0006274581  0.0144206177 -0.0051188104
#> [5,]  0.007601459  0.003315000 -0.0005230214 -0.0051188104  0.0184854450
#> [6,]  0.003930719  0.007139162 -0.0019910370 -0.0051586176  0.0082960414
#>              [,6]
#> [1,]  0.003930719
#> [2,]  0.007139162
#> [3,] -0.001991037
#> [4,] -0.005158618
#> [5,]  0.008296041
#> [6,]  0.018539997
#> 
#> [[3]]
#>              [,1]         [,2]         [,3]         [,4]         [,5]
#> [1,]  0.069949715  0.035086777 -0.024596379 -0.007819522  0.020089571
#> [2,]  0.035086777  0.067005449 -0.023260576 -0.002828699  0.008761072
#> [3,] -0.024596379 -0.023260576  0.053914807  0.001658282 -0.001382271
#> [4,] -0.007819522 -0.002828699  0.001658282  0.038111633 -0.013528285
#> [5,]  0.020089571  0.008761072 -0.001382271 -0.013528285  0.048854390
#> [6,]  0.010388330  0.018867784 -0.005262026 -0.013633489  0.021925252
#>              [,6]
#> [1,]  0.010388330
#> [2,]  0.018867784
#> [3,] -0.005262026
#> [4,] -0.013633489
#> [5,]  0.021925252
#> [6,]  0.048998563
#> 
#> [[4]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.009792960  0.0049121488 -0.0034434930 -0.0010947331  0.0028125399
#> [2,]  0.004912149  0.0093807628 -0.0032564806 -0.0003960179  0.0012265501
#> [3,] -0.003443493 -0.0032564806  0.0075480730  0.0002321595 -0.0001935179
#> [4,] -0.001094733 -0.0003960179  0.0002321595  0.0053356286 -0.0018939599
#> [5,]  0.002812540  0.0012265501 -0.0001935179 -0.0018939599  0.0068396147
#> [6,]  0.001454366  0.0026414898 -0.0007366837 -0.0019086885  0.0030695353
#>               [,6]
#> [1,]  0.0014543662
#> [2,]  0.0026414898
#> [3,] -0.0007366837
#> [4,] -0.0019086885
#> [5,]  0.0030695353
#> [6,]  0.0068597988
#> 
#> [[5]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.019201883  0.0096316644 -0.0067519471 -0.0021465355  0.0055147841
#> [2,]  0.009631664  0.0183936526 -0.0063852560 -0.0007765056  0.0024050003
#> [3,] -0.006751947 -0.0063852560  0.0148001432  0.0004552147 -0.0003794469
#> [4,] -0.002146536 -0.0007765056  0.0004552147  0.0104620168 -0.0037136468
#> [5,]  0.005514784  0.0024050003 -0.0003794469 -0.0037136468  0.0134110091
#> [6,]  0.002851698  0.0051793917 -0.0014444778 -0.0037425265  0.0060186967
#>              [,6]
#> [1,]  0.002851698
#> [2,]  0.005179392
#> [3,] -0.001444478
#> [4,] -0.003742526
#> [5,]  0.006018697
#> [6,]  0.013450586
#> 
#> [[6]]
#>               [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.0076507501  0.0038376163 -0.0026902289 -0.0008552602  0.0021972968
#> [2,]  0.0038376163  0.0073287209 -0.0025441255 -0.0003093890  0.0009582423
#> [3,] -0.0026902289 -0.0025441255  0.0058969321  0.0001813746 -0.0001511859
#> [4,] -0.0008552602 -0.0003093890  0.0001813746  0.0041684598 -0.0014796561
#> [5,]  0.0021972968  0.0009582423 -0.0001511859 -0.0014796561  0.0053434489
#> [6,]  0.0011362236  0.0020636639 -0.0005755341 -0.0014911629  0.0023980745
#>               [,6]
#> [1,]  0.0011362236
#> [2,]  0.0020636639
#> [3,] -0.0005755341
#> [4,] -0.0014911629
#> [5,]  0.0023980745
#> [6,]  0.0053592178
#> 
#> [[7]]
#>              [,1]          [,2]          [,3]          [,4]          [,5]
#> [1,]  0.013989943  0.0070173555 -0.0049192757 -0.0015639044  0.0040179142
#> [2,]  0.007017355  0.0134010897 -0.0046521151 -0.0005657398  0.0017522145
#> [3,] -0.004919276 -0.0046521151  0.0107829615  0.0003316564 -0.0002764542
#> [4,] -0.001563904 -0.0005657398  0.0003316564  0.0076223265 -0.0027056569
#> [5,]  0.004017914  0.0017522145 -0.0002764542 -0.0027056569  0.0097708781
#> [6,]  0.002077666  0.0037735568 -0.0010524053 -0.0027266979  0.0043850504
#>              [,6]
#> [1,]  0.002077666
#> [2,]  0.003773557
#> [3,] -0.001052405
#> [4,] -0.002726698
#> [5,]  0.004385050
#> [6,]  0.009799713
#> 
#> [[8]]
#>              [,1]         [,2]          [,3]         [,4]          [,5]
#> [1,]  0.032643200  0.016373829 -0.0114783100 -0.003649110  0.0093751330
#> [2,]  0.016373829  0.031269209 -0.0108549353 -0.001320060  0.0040885004
#> [3,] -0.011478310 -0.010854935  0.0251602435  0.000773865 -0.0006450598
#> [4,] -0.003649110 -0.001320060  0.0007738650  0.017785429 -0.0063131995
#> [5,]  0.009375133  0.004088500 -0.0006450598 -0.006313200  0.0227987155
#> [6,]  0.004847887  0.008804966 -0.0024556123 -0.006362295  0.0102317844
#>              [,6]
#> [1,]  0.004847887
#> [2,]  0.008804966
#> [3,] -0.002455612
#> [4,] -0.006362295
#> [5,]  0.010231784
#> [6,]  0.022865996

Master Prep Data Function

The function below creates and organize elements that are then fitted internally into the metafor package. Below we fitted fixed and random-effects models and extracted some more detail information from objects that are not directly output by the functions. First, we see results under fixed-effect models.

mars(data = becker09, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     estimation_method = 'FE',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic')) |>
  summary()

Now we fit a random-effects model and extract some objects from this output.

model_out_random <- mars(data = becker09, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic'))
summary(model_out_random)
#> Results generated with MARS:v 0.2.2 
#> Wednesday, March 26, 2025
#> 
#> Model Type: 
#> multivariate
#> 
#> Estimation Method: 
#> Restricted Maximum Likelihood
#> 
#> Model Formula: 
#> NULL
#> 
#> Data Summary: 
#> Number of Effect Sizes: 48
#> Number of Fixed Effects: 6
#> Number of Random Effects: 6
#> 
#> Random Components: 
#>          ri_1     ri_2     ri_3      ri_4      ri_5       ri_6
#> ri_1  0.13206  0.07632 -0.03147  0.003063 -0.018160  0.0022334
#> ri_2  0.99881  0.04421 -0.01700  0.001536 -0.009868  0.0008382
#> ri_3 -0.42101 -0.39314  0.04231 -0.007312  0.009631 -0.0122626
#> ri_4  0.23221  0.20120 -0.97940  0.001318 -0.001498  0.0022789
#> ri_5 -0.62535 -0.58730  0.58594 -0.516447  0.006385 -0.0024652
#> ri_6  0.09674  0.06275 -0.93846  0.988288 -0.485633  0.0040356
#> 
#> Fixed Effects Estimates: 
#>  attribute estimate      SE  z_test   p_value   lower     upper
#>       ri_1 -0.09772 0.13778 -0.7093 4.782e-01 -0.3678  0.172324
#>       ri_2 -0.17554 0.08620 -2.0363 4.172e-02 -0.3445 -0.006584
#>       ri_3  0.31868 0.08407  3.7906 1.503e-04  0.1539  0.483463
#>       ri_4  0.52719 0.03335 15.8079 2.747e-56  0.4618  0.592552
#>       ri_5 -0.41755 0.04590 -9.0963 9.348e-20 -0.5075 -0.327579
#>       ri_6 -0.40070 0.04182 -9.5822 9.504e-22 -0.4827 -0.318736
#> 
#> Model Fit Statistics: 
#>  logLik    Dev   AIC   BIC  AICc
#>   18.63 -37.25 16.75 63.67 29.48
#> 
#> Q Error: 230.642 (42), p < 0.0001
#> 
#> I2 (General): 
#>  names values
#>   ri_1  94.53
#>   ri_2  85.26
#>   ri_3  84.70
#>   ri_4  14.70
#>   ri_5  45.52
#>   ri_6  34.56
#> 
#> I2 (Jackson): 
#>  names values
#>   ri_1  90.98
#>   ri_2  77.93
#>   ri_3  81.33
#>   ri_4  16.13
#>   ri_5  43.25
#>   ri_6  31.42
#> 
#> I2 (Between): 83.39602

Fit path model

Now, we are ready to input the average correlation matrix and its variance covariance matrix and our own function to appropriate estimate SE via the multivariate delta method.

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


mars(data = becker09, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic')) |>
  path_model(model = model) |>
  summary()
#> Results generated with MARS:v 0.2.2 
#> Wednesday, March 26, 2025
#> 
#> Model Type: 
#> multivariate
#>  
#> Average Correlation Matrix: 
#>                Performance   Cognitive    Somatic Selfconfidence
#> Performance     1.00000000 -0.09772148 -0.1755405      0.3186829
#> Cognitive      -0.09772148  1.00000000  0.5271874     -0.4175481
#> Somatic        -0.17554051  0.52718744  1.0000000     -0.4006950
#> Selfconfidence  0.31868294 -0.41754809 -0.4006950      1.0000000
#> 
#>  
#>  Model Fitted: 
#>  ## Regression paths
#> Performance ~ Cognitive + Somatic + Selfconfidence
#> Selfconfidence ~ Cognitive + Somatic
#>  
#>  
#> Fixed Effects: 
#>                                    predictor        outcome    estimate
#> Cognitive -> Performance           Cognitive    Performance  0.08319698
#> Somatic -> Performance               Somatic    Performance -0.09266449
#> Selfconfidence -> Performance Selfconfidence    Performance  0.31629148
#> Cognitive -> Selfconfidence        Cognitive Selfconfidence -0.28571432
#> Somatic -> Selfconfidence            Somatic Selfconfidence -0.25007001
#>                               standard_errors test_statistic      p_value
#> Cognitive -> Performance           0.15425511      0.5393466 5.896477e-01
#> Somatic -> Performance             0.06354512     -1.4582471 1.447725e-01
#> Selfconfidence -> Performance      0.10216822      3.0957913 1.962884e-03
#> Cognitive -> Selfconfidence        0.03848494     -7.4240552 1.135878e-13
#> Somatic -> Selfconfidence          0.05226454     -4.7846974 1.712452e-06
#> 
#>  
#>  Fit Statistics: 
#>                    Type                Value
#> 1      Model Chi-Square     14.23 (2), 8e-04
#> 2 Null Model Chi-Square           642.23 (6)
#> 3                   CFI                0.981
#> 4                   TLI                0.942
#> 5                 RMSEA 0.103 [0.048, 0.166]
#> 6                  SRMR                0.232

Team

We now subset the data to obtain results only for the studies that reported on Team sports.

becker09_T <- subset(becker09, becker09$Team == "T")
mars(data = becker09_T, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic')) |>
  summary()
#> Results generated with MARS:v 0.2.2 
#> Wednesday, March 26, 2025
#> 
#> Model Type: 
#> multivariate
#> 
#> Estimation Method: 
#> Restricted Maximum Likelihood
#> 
#> Model Formula: 
#> NULL
#> 
#> Data Summary: 
#> Number of Effect Sizes: 18
#> Number of Fixed Effects: 6
#> Number of Random Effects: 6
#> 
#> Random Components: 
#>         ri_1     ri_2       ri_3       ri_4       ri_5      ri_6
#> ri_1  0.1130  0.07312  0.0092197  0.0012143 -0.0604203 -0.015517
#> ri_2  0.9841  0.04884  0.0003625 -0.0003564 -0.0389002 -0.004652
#> ri_3  0.1885  0.01127  0.0211624  0.0042598 -0.0056167 -0.020890
#> ri_4  0.1231 -0.05496  0.9978056  0.0008612 -0.0007894 -0.004167
#> ri_5 -0.9996 -0.97903 -0.2147559 -0.1496176  0.0323231  0.008956
#> ri_6 -0.3185 -0.14526 -0.9909683 -0.9799149  0.3437839  0.020999
#> 
#> Fixed Effects Estimates: 
#>  attribute estimate     SE z_test   p_value    lower    upper
#>       ri_1  -0.1245 0.2048 -0.608 5.432e-01 -0.52589  0.27688
#>       ri_2  -0.1853 0.1425 -1.300 1.936e-01 -0.46464  0.09408
#>       ri_3   0.2329 0.1043  2.232 2.563e-02  0.02837  0.43740
#>       ri_4   0.5825 0.0455 12.803 1.581e-37  0.49335  0.67171
#>       ri_5  -0.3928 0.1160 -3.385 7.123e-04 -0.62024 -0.16535
#>       ri_6  -0.3534 0.1015 -3.482 4.969e-04 -0.55223 -0.15448
#> 
#> Model Fit Statistics: 
#>  logLik    Dev   AIC BIC  AICc
#>   11.04 -22.09 31.91  45 171.9
#> 
#> Q Error: 50.049 (12), p < 0.0001
#> 
#> I2 (General): 
#>  names values
#>   ri_1  94.43
#>   ri_2  88.00
#>   ri_3  76.06
#>   ri_4  11.45
#>   ri_5  82.91
#>   ri_6  75.92
#> 
#> I2 (Jackson): 
#>  names values
#>   ri_1  90.45
#>   ri_2  80.82
#>   ri_3  66.53
#>   ri_4  14.25
#>   ri_5  80.55
#>   ri_6  69.67
#> 
#> I2 (Between): 85.57973
# random_model2 <- fit_model(data = input_metafor2, effect_size = 'yi', 
#                            var_cor = 'V', moderators = ~ -1 + factor(outcome), 
#                            random_params = ~ factor(outcome) | factor(study))

Fit path model

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


mars(data = becker09_T, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic')) |>
  path_model(model = model) |>
  summary()
#> Results generated with MARS:v 0.2.2 
#> Wednesday, March 26, 2025
#> 
#> Model Type: 
#> multivariate
#>  
#> Average Correlation Matrix: 
#>                Performance  Cognitive    Somatic Selfconfidence
#> Performance      1.0000000 -0.1245064 -0.1852846      0.2328837
#> Cognitive       -0.1245064  1.0000000  0.5825298     -0.3927941
#> Somatic         -0.1852846  0.5825298  1.0000000     -0.3533528
#> Selfconfidence   0.2328837 -0.3927941 -0.3533528      1.0000000
#> 
#>  
#>  Model Fitted: 
#>  ## Regression paths
#> Performance ~ Cognitive + Somatic + Selfconfidence
#> Selfconfidence ~ Cognitive + Somatic
#>  
#>  
#> Fixed Effects: 
#>                                    predictor        outcome   estimate
#> Cognitive -> Performance           Cognitive    Performance  0.0309183
#> Somatic -> Performance               Somatic    Performance -0.1333659
#> Selfconfidence -> Performance Selfconfidence    Performance  0.1979030
#> Cognitive -> Selfconfidence        Cognitive Selfconfidence -0.2829834
#> Somatic -> Selfconfidence            Somatic Selfconfidence -0.1885065
#>                               standard_errors test_statistic      p_value
#> Cognitive -> Performance           0.25963865      0.1190821 9.052103e-01
#> Somatic -> Performance             0.08357876     -1.5956910 1.105578e-01
#> Selfconfidence -> Performance      0.16482003      1.2007217 2.298592e-01
#> Cognitive -> Selfconfidence        0.06464079     -4.3777839 1.198921e-05
#> Somatic -> Selfconfidence          0.12485886     -1.5097568 1.311055e-01
#> 
#>  
#>  Fit Statistics: 
#>                    Type             Value
#> 1      Model Chi-Square 3.541 (2), 0.1703
#> 2 Null Model Chi-Square        320.78 (6)
#> 3                   CFI             0.995
#> 4                   TLI             0.985
#> 5                 RMSEA 0.056 [NA, 0.164]
#> 6                  SRMR             0.205

Individual

Similarly, we now subset the data to obtain results only for the studies that reported on Individual sports.

becker09_I <- subset(becker09, becker09$Team == "I")
mars(data = becker09_I, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic')) |>
  summary()
#> Results generated with MARS:v 0.2.2 
#> Wednesday, March 26, 2025
#> 
#> Model Type: 
#> multivariate
#> 
#> Estimation Method: 
#> Restricted Maximum Likelihood
#> 
#> Model Formula: 
#> NULL
#> 
#> Data Summary: 
#> Number of Effect Sizes: 30
#> Number of Fixed Effects: 6
#> Number of Random Effects: 6
#> 
#> Random Components: 
#>         ri_1     ri_2     ri_3       ri_4      ri_5      ri_6
#> ri_1  0.1947  0.07610 -0.06015  0.0019425  0.013600  0.020942
#> ri_2  0.8003  0.04644 -0.02143  0.0005690  0.004873  0.002169
#> ri_3 -0.5329 -0.38883  0.06542 -0.0073427  0.024498  0.005809
#> ri_4  0.1399  0.08389 -0.91207  0.0009907 -0.004007 -0.001602
#> ri_5  0.2253  0.16531  0.70019 -0.9306298  0.018711  0.009663
#> ri_6  0.5285  0.11209  0.25292 -0.5666477  0.786733  0.008063
#> 
#> Fixed Effects Estimates: 
#>  attribute estimate      SE  z_test   p_value    lower    upper
#>       ri_1 -0.08366 0.20962 -0.3991 6.898e-01 -0.49451  0.32719
#>       ri_2 -0.18289 0.11427 -1.6005 1.095e-01 -0.40686  0.04108
#>       ri_3  0.33753 0.12615  2.6756 7.460e-03  0.09028  0.58479
#>       ri_4  0.49047 0.04562 10.7501 5.922e-27  0.40105  0.57989
#>       ri_5 -0.46567 0.07947 -5.8599 4.632e-09 -0.62143 -0.30992
#>       ri_6 -0.49761 0.06086 -8.1765 2.921e-16 -0.61689 -0.37833
#> 
#> Model Fit Statistics: 
#>  logLik    Dev   AIC   BIC  AICc
#>   11.39 -22.79 31.21 63.02 59.21
#> 
#> Q Error: 190.914 (24), p < 0.0001
#> 
#> I2 (General): 
#>  names values
#>   ri_1  95.77
#>   ri_2  84.36
#>   ri_3  88.37
#>   ri_4  10.32
#>   ri_5  68.49
#>   ri_6  48.37
#> 
#> I2 (Jackson): 
#>  names values
#>   ri_1  93.28
#>   ri_2  78.52
#>   ri_3  88.30
#>   ri_4  10.40
#>   ri_5  65.30
#>   ri_6  49.12
#> 
#> I2 (Between): 86.61981

# random_model3 <- fit_model(data = input_metafor3, effect_size = 'yi', 
#                            var_cor = 'V', moderators = ~ -1 + factor(outcome), 
#                            random_params = ~ factor(outcome) | factor(study))

Fit path model

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


mars(data = becker09_I, studyID = 'ID',
     effectID = 'numID', sample_size = 'N',
     effectsize_type = 'cor',
     varcov_type = 'weighted',
     variable_names = c('Cognitive_Performance', 'Somatic_Performance',
                        'Selfconfidence_Performance',
                        'Somatic_Cognitive',
                        'Selfconfidence_Cognitive',
                        'Selfconfidence_Somatic')) |>
  path_model(model = model) |>
  summary()
#> Results generated with MARS:v 0.2.2 
#> Wednesday, March 26, 2025
#> 
#> Model Type: 
#> multivariate
#>  
#> Average Correlation Matrix: 
#>                Performance   Cognitive    Somatic Selfconfidence
#> Performance     1.00000000 -0.08366225 -0.1828908      0.3375302
#> Cognitive      -0.08366225  1.00000000  0.4904679     -0.4656716
#> Somatic        -0.18289084  0.49046789  1.0000000     -0.4976085
#> Selfconfidence  0.33753017 -0.46567157 -0.4976085      1.0000000
#> 
#>  
#>  Model Fitted: 
#>  ## Regression paths
#> Performance ~ Cognitive + Somatic + Selfconfidence
#> Selfconfidence ~ Cognitive + Somatic
#>  
#>  
#> Fixed Effects: 
#>                                    predictor        outcome    estimate
#> Cognitive -> Performance           Cognitive    Performance  0.11330325
#> Somatic -> Performance               Somatic    Performance -0.05881252
#> Selfconfidence -> Performance Selfconfidence    Performance  0.36102667
#> Cognitive -> Selfconfidence        Cognitive Selfconfidence -0.29180740
#> Somatic -> Selfconfidence            Somatic Selfconfidence -0.35448633
#>                               standard_errors test_statistic      p_value
#> Cognitive -> Performance           0.23313037      0.4860081 6.269614e-01
#> Somatic -> Performance             0.13568155     -0.4334599 6.646807e-01
#> Selfconfidence -> Performance      0.14686285      2.4582573 1.396131e-02
#> Cognitive -> Selfconfidence        0.06212853     -4.6968345 2.642244e-06
#> Somatic -> Selfconfidence          0.08749797     -4.0513664 5.091940e-05
#> 
#>  
#>  Fit Statistics: 
#>                    Type               Value
#> 1      Model Chi-Square   19.292 (2), 1e-04
#> 2 Null Model Chi-Square         427.836 (6)
#> 3                   CFI               0.959
#> 4                   TLI               0.877
#> 5                 RMSEA 0.164 [0.09, 0.247]
#> 6                  SRMR                0.27

Partial correlation matrix

Here we compute the synthetic partial correlation from the average correlation matrix.

# partial corr matrix
part_cor <- round(corpcor::vec2sm(model_out_random$beta_r),3)
diag(part_cor) <- 1
part_cor

# var-cov matrix of partials
Psy <- model_out_random$varcov_beta
round(var_path(model_out_random$beta_r, Psy, type = 'pcor'), 4)

Partial from uni approach

Here we work with partial correlation for each study and then synthesize that information.

#---------------------------------------------------------------------
# Create a data set with 8 complete studies
#---------------------------------------------------------------------
R <-  becker09_list
R$"6" <- NULL
R$"17" <- NULL
n <- becker09$N[c(-3, -5)]
#------------------------------------------------------------------
# first replace NA by zeros
RR <- R                           # redifine list

PR <- lapply(RR, cor2pcor)
pr <- unlist(lapply(PR, '[[', 4))
var_pr <- (1-pr^2)^2 / (n - 3 -1)

rma.uni(pr, var_pr)