assignment_11

Required libraries

library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(meta)
Loading required package: metadat
Loading 'meta' package (version 7.0-0).
Type 'help(meta)' for a brief overview.
Readers of 'Meta-Analysis with R (Use R!)' should install
older version of 'meta' package: https://tinyurl.com/dt4y5drs

###Reading the data

m_data <- readxl::read_excel("data/metaanalysis_data.xlsx")

Running meta analysis for boys play with female toys, using both fixed and random effect

m.raw_boys_play_female <- metacont(n.e=N_boys,
                  mean.e=Mean_boys_play_female,
                  sd.e=SD_boys_play_female,
                  n.c=N_boys,
                  mean.c=Mean_boys_play_male,
                  sd.c=SD_boys_play_male,
                  data=m_data,
                  studlab=paste(Study),
                  comb.fixed = TRUE,
                  comb.random = TRUE,
)

Plotting forest for it

m.raw_boys_play_female %>% forest()

Plotting funnel

m.raw_boys_play_female %>% funnel()

Finding does authers gender effect it

m.raw_boys_play_female %>% metareg(`Study` + `Male authors`)
Warning: Redundant predictors dropped from the model.

Mixed-Effects Model (k = 27; tau^2 estimator: REML)

tau^2 (estimated amount of residual heterogeneity):     3533.5690 (SE = 1717.1262)
tau (square root of estimated tau^2 value):             59.4438
I^2 (residual heterogeneity / unaccounted variability): 95.40%
H^2 (unaccounted variability / sampling variability):   21.76
R^2 (amount of heterogeneity accounted for):            75.79%

Test for Residual Heterogeneity:
QE(df = 11) = 67.4317, p-val < .0001

Test of Moderators (coefficients 2:16):
QM(df = 15) = 77.6871, p-val < .0001

Model Results:

                                            estimate        se     zval    pval 
intrcpt                                     -61.4400   68.8601  -0.8922  0.3723 
StudyArthur (2014)                           39.4400   94.7653   0.4162  0.6773 
StudyBerenbaum & Hines (1992)              -230.3100  112.2511  -2.0517  0.0402 
StudyBerenbaum & Snyder (1995)             -396.3500   98.8473  -4.0097  <.0001 
StudyDoering et al (1989)                  -191.4600   92.7990  -2.0632  0.0391 
StudyIdle et al. (1993)                    -195.1600  104.8050  -1.8621  0.0626 
StudyLamminmäki & Hines (2012)               95.8900   93.1081   1.0299  0.3031 
StudyLi & Wong (2016)                      -126.3000   94.0128  -1.3434  0.1791 
StudyPasterski et al. (2005)               -125.0741   79.0919  -1.5814  0.1138 
StudySchau et al. (1980)                   -203.5200  101.7731  -1.9997  0.0455 
StudyServin et al. (1999)                   -70.6846   79.0026  -0.8947  0.3709 
StudyTodd et al. (2016)                      19.4234   77.0643   0.2520  0.8010 
Studyvan de Beek (2009)                      43.4300   93.3567   0.4652  0.6418 
StudyWilansky-Traynor & Lobel (2008)        -20.6667   82.0371  -0.2519  0.8011 
StudyZosuls et al. (2009)                    70.4484   75.7783   0.9297  0.3525 
StudyZosuls, Ruble & Tamis-LeMonda (2014)    26.3400   80.8598   0.3257  0.7446 
                                               ci.lb      ci.ub      
intrcpt                                    -196.4032    73.5232      
StudyArthur (2014)                         -146.2965   225.1765      
StudyBerenbaum & Hines (1992)              -450.3181   -10.3019    * 
StudyBerenbaum & Snyder (1995)             -590.0872  -202.6128  *** 
StudyDoering et al (1989)                  -373.3426    -9.5774    * 
StudyIdle et al. (1993)                    -400.5741    10.2541    . 
StudyLamminmäki & Hines (2012)              -86.5985   278.3785      
StudyLi & Wong (2016)                      -310.5617    57.9617      
StudyPasterski et al. (2005)               -280.0913    29.9431      
StudySchau et al. (1980)                   -402.9915    -4.0485    * 
StudyServin et al. (1999)                  -225.5270    84.1577      
StudyTodd et al. (2016)                    -131.6199   170.4667      
Studyvan de Beek (2009)                    -139.5459   226.4059      
StudyWilansky-Traynor & Lobel (2008)       -181.4564   140.1231      
StudyZosuls et al. (2009)                   -78.0744   218.9712      
StudyZosuls, Ruble & Tamis-LeMonda (2014)  -132.1424   184.8224      

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
m.raw_boys_play_female %>% metareg(`Study` + `Female authors`)
Warning: Redundant predictors dropped from the model.

Mixed-Effects Model (k = 27; tau^2 estimator: REML)

tau^2 (estimated amount of residual heterogeneity):     3533.5690 (SE = 1717.1262)
tau (square root of estimated tau^2 value):             59.4438
I^2 (residual heterogeneity / unaccounted variability): 95.40%
H^2 (unaccounted variability / sampling variability):   21.76
R^2 (amount of heterogeneity accounted for):            75.79%

Test for Residual Heterogeneity:
QE(df = 11) = 67.4317, p-val < .0001

Test of Moderators (coefficients 2:16):
QM(df = 15) = 77.6871, p-val < .0001

Model Results:

                                            estimate        se     zval    pval 
intrcpt                                     -61.4400   68.8601  -0.8922  0.3723 
StudyArthur (2014)                           39.4400   94.7653   0.4162  0.6773 
StudyBerenbaum & Hines (1992)              -230.3100  112.2511  -2.0517  0.0402 
StudyBerenbaum & Snyder (1995)             -396.3500   98.8473  -4.0097  <.0001 
StudyDoering et al (1989)                  -191.4600   92.7990  -2.0632  0.0391 
StudyIdle et al. (1993)                    -195.1600  104.8050  -1.8621  0.0626 
StudyLamminmäki & Hines (2012)               95.8900   93.1081   1.0299  0.3031 
StudyLi & Wong (2016)                      -126.3000   94.0128  -1.3434  0.1791 
StudyPasterski et al. (2005)               -125.0741   79.0919  -1.5814  0.1138 
StudySchau et al. (1980)                   -203.5200  101.7731  -1.9997  0.0455 
StudyServin et al. (1999)                   -70.6846   79.0026  -0.8947  0.3709 
StudyTodd et al. (2016)                      19.4234   77.0643   0.2520  0.8010 
Studyvan de Beek (2009)                      43.4300   93.3567   0.4652  0.6418 
StudyWilansky-Traynor & Lobel (2008)        -20.6667   82.0371  -0.2519  0.8011 
StudyZosuls et al. (2009)                    70.4484   75.7783   0.9297  0.3525 
StudyZosuls, Ruble & Tamis-LeMonda (2014)    26.3400   80.8598   0.3257  0.7446 
                                               ci.lb      ci.ub      
intrcpt                                    -196.4032    73.5232      
StudyArthur (2014)                         -146.2965   225.1765      
StudyBerenbaum & Hines (1992)              -450.3181   -10.3019    * 
StudyBerenbaum & Snyder (1995)             -590.0872  -202.6128  *** 
StudyDoering et al (1989)                  -373.3426    -9.5774    * 
StudyIdle et al. (1993)                    -400.5741    10.2541    . 
StudyLamminmäki & Hines (2012)              -86.5985   278.3785      
StudyLi & Wong (2016)                      -310.5617    57.9617      
StudyPasterski et al. (2005)               -280.0913    29.9431      
StudySchau et al. (1980)                   -402.9915    -4.0485    * 
StudyServin et al. (1999)                  -225.5270    84.1577      
StudyTodd et al. (2016)                    -131.6199   170.4667      
Studyvan de Beek (2009)                    -139.5459   226.4059      
StudyWilansky-Traynor & Lobel (2008)       -181.4564   140.1231      
StudyZosuls et al. (2009)                   -78.0744   218.9712      
StudyZosuls, Ruble & Tamis-LeMonda (2014)  -132.1424   184.8224      

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Running meta analysis for girls play with male toys, using both fixed and random effect

m.raw_girsl_play_male <- metacont(n.e=N_girls,
                       mean.e=Mean_girls_play_male,
                       sd.e=SD_girls_play_male,
                       n.c=N_girls,
                       mean.c=Mean_girls_play_female,
                       sd.c=SD_girls_play_female,
                       data=m_data,
                       studlab=paste(Study),
                       comb.fixed = TRUE,
                       comb.random = TRUE,
)

Plotting forest for it

m.raw_girsl_play_male %>% forest()

Plotting funnel

m.raw_girsl_play_male %>% funnel()

Finding does authers gender effect it

m.raw_girsl_play_male %>% metareg(`Study` + `Male authors`)
Warning: Redundant predictors dropped from the model.

Mixed-Effects Model (k = 27; tau^2 estimator: REML)

tau^2 (estimated amount of residual heterogeneity):     0.0000 (SE = 59.8757)
tau (square root of estimated tau^2 value):             0.0017
I^2 (residual heterogeneity / unaccounted variability): 0.00%
H^2 (unaccounted variability / sampling variability):   1.00
R^2 (amount of heterogeneity accounted for):            100.00%

Test for Residual Heterogeneity:
QE(df = 11) = 19.4724, p-val = 0.0531

Test of Moderators (coefficients 2:16):
QM(df = 15) = 162.5384, p-val < .0001

Model Results:

                                            estimate       se     zval    pval 
intrcpt                                    -289.9200  39.0966  -7.4155  <.0001 
StudyArthur (2014)                           99.9200  42.9721   2.3252  0.0201 
StudyBerenbaum & Hines (1992)               177.1200  84.6453   2.0925  0.0364 
StudyBerenbaum & Snyder (1995)              226.9800  77.8848   2.9143  0.0036 
StudyDoering et al (1989)                   243.1200  54.8950   4.4288  <.0001 
StudyIdle et al. (1993)                     420.6200  71.3300   5.8968  <.0001 
StudyLamminmäki & Hines (2012)              243.3700  44.0020   5.5309  <.0001 
StudyLi & Wong (2016)                       150.0200  45.6678   3.2850  0.0010 
StudyPasterski et al. (2005)                153.6560  45.2637   3.3947  0.0007 
StudySchau et al. (1980)                    254.4800  54.3716   4.6804  <.0001 
StudyServin et al. (1999)                   190.8796  44.3647   4.3025  <.0001 
StudyTodd et al. (2016)                     247.5081  39.4134   6.2798  <.0001 
Studyvan de Beek (2009)                     212.5700  43.2776   4.9118  <.0001 
StudyWilansky-Traynor & Lobel (2008)        234.6633  41.5398   5.6491  <.0001 
StudyZosuls et al. (2009)                   213.7384  40.7297   5.2477  <.0001 
StudyZosuls, Ruble & Tamis-LeMonda (2014)   259.2200  39.5358   6.5566  <.0001 
                                               ci.lb      ci.ub      
intrcpt                                    -366.5479  -213.2921  *** 
StudyArthur (2014)                           15.6963   184.1437    * 
StudyBerenbaum & Hines (1992)                11.2182   343.0218    * 
StudyBerenbaum & Snyder (1995)               74.3287   379.6313   ** 
StudyDoering et al (1989)                   135.5277   350.7123  *** 
StudyIdle et al. (1993)                     280.8157   560.4243  *** 
StudyLamminmäki & Hines (2012)              157.1278   329.6122  *** 
StudyLi & Wong (2016)                        60.5128   239.5272   ** 
StudyPasterski et al. (2005)                 64.9408   242.3712  *** 
StudySchau et al. (1980)                    147.9136   361.0464  *** 
StudyServin et al. (1999)                   103.9265   277.8328  *** 
StudyTodd et al. (2016)                     170.2593   324.7569  *** 
Studyvan de Beek (2009)                     127.7474   297.3926  *** 
StudyWilansky-Traynor & Lobel (2008)        153.2468   316.0798  *** 
StudyZosuls et al. (2009)                   133.9097   293.5670  *** 
StudyZosuls, Ruble & Tamis-LeMonda (2014)   181.7311   336.7088  *** 

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
m.raw_girsl_play_male %>% metareg(`Study` + `Female authors`)
Warning: Redundant predictors dropped from the model.

Mixed-Effects Model (k = 27; tau^2 estimator: REML)

tau^2 (estimated amount of residual heterogeneity):     0.0000 (SE = 59.8757)
tau (square root of estimated tau^2 value):             0.0017
I^2 (residual heterogeneity / unaccounted variability): 0.00%
H^2 (unaccounted variability / sampling variability):   1.00
R^2 (amount of heterogeneity accounted for):            100.00%

Test for Residual Heterogeneity:
QE(df = 11) = 19.4724, p-val = 0.0531

Test of Moderators (coefficients 2:16):
QM(df = 15) = 162.5384, p-val < .0001

Model Results:

                                            estimate       se     zval    pval 
intrcpt                                    -289.9200  39.0966  -7.4155  <.0001 
StudyArthur (2014)                           99.9200  42.9721   2.3252  0.0201 
StudyBerenbaum & Hines (1992)               177.1200  84.6453   2.0925  0.0364 
StudyBerenbaum & Snyder (1995)              226.9800  77.8848   2.9143  0.0036 
StudyDoering et al (1989)                   243.1200  54.8950   4.4288  <.0001 
StudyIdle et al. (1993)                     420.6200  71.3300   5.8968  <.0001 
StudyLamminmäki & Hines (2012)              243.3700  44.0020   5.5309  <.0001 
StudyLi & Wong (2016)                       150.0200  45.6678   3.2850  0.0010 
StudyPasterski et al. (2005)                153.6560  45.2637   3.3947  0.0007 
StudySchau et al. (1980)                    254.4800  54.3716   4.6804  <.0001 
StudyServin et al. (1999)                   190.8796  44.3647   4.3025  <.0001 
StudyTodd et al. (2016)                     247.5081  39.4134   6.2798  <.0001 
Studyvan de Beek (2009)                     212.5700  43.2776   4.9118  <.0001 
StudyWilansky-Traynor & Lobel (2008)        234.6633  41.5398   5.6491  <.0001 
StudyZosuls et al. (2009)                   213.7384  40.7297   5.2477  <.0001 
StudyZosuls, Ruble & Tamis-LeMonda (2014)   259.2200  39.5358   6.5566  <.0001 
                                               ci.lb      ci.ub      
intrcpt                                    -366.5479  -213.2921  *** 
StudyArthur (2014)                           15.6963   184.1437    * 
StudyBerenbaum & Hines (1992)                11.2182   343.0218    * 
StudyBerenbaum & Snyder (1995)               74.3287   379.6313   ** 
StudyDoering et al (1989)                   135.5277   350.7123  *** 
StudyIdle et al. (1993)                     280.8157   560.4243  *** 
StudyLamminmäki & Hines (2012)              157.1278   329.6122  *** 
StudyLi & Wong (2016)                        60.5128   239.5272   ** 
StudyPasterski et al. (2005)                 64.9408   242.3712  *** 
StudySchau et al. (1980)                    147.9136   361.0464  *** 
StudyServin et al. (1999)                   103.9265   277.8328  *** 
StudyTodd et al. (2016)                     170.2593   324.7569  *** 
Studyvan de Beek (2009)                     127.7474   297.3926  *** 
StudyWilansky-Traynor & Lobel (2008)        153.2468   316.0798  *** 
StudyZosuls et al. (2009)                   133.9097   293.5670  *** 
StudyZosuls, Ruble & Tamis-LeMonda (2014)   181.7311   336.7088  *** 

---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1