setwd('~')
setwd('rfolder/sexdiff')
magic2 <- read.csv('tff_nv.csv')
setwd('~')
setwd('rfolder/sexdiff')
stop <- read.csv("stop.csv")
iqresults <- read.csv("iqresults.csv")
setwd('~')
setwd('rfolder/sexdiff/plots')
t <- stop
stop <- t
data cleaning and study exclusion
stop$Latent[is.na(stop$Latent)] <- 0
stop$try <- stop$Mean.age
pattern <- "^age = "
stop$try2[grepl(pattern, stop$try)] <- substring(stop$try, first = 7)[grepl(pattern, stop$try)]
pattern <- "^age="
stop$try2[grepl(pattern, stop$try)] <- substring(stop$try, first = 5)[grepl(pattern, stop$try)]
stop$temp3 <- as.numeric(stop$try2)
Warning: NAs introduced by coercion
stop$try2 <- sapply(stop$try2, calculate_average)
stop$Mean.age[!is.na(stop$Mean.age) & !is.na(stop$try2)] <- stop$try2[!is.na(stop$Mean.age) & !is.na(stop$try2)]
stop$Mean.age[!is.na(stop$Mean.age) & !is.na(stop$temp3)] <- stop$temp3[!is.na(stop$Mean.age) & !is.na(stop$temp3)]
stop$Mean.age <- as.numeric(stop$Mean.age)
stop$temp2 <- as.numeric(stop$Female.ratio)
Warning: NAs introduced by coercion
stop$Female.ratio[is.na(stop$temp2)] <- sapply(stop$Female.ratio[is.na(stop$temp2)], function(x) substr(x, start = 3, stop = nchar(x)-1))
stop$Female.ratio <- as.numeric(stop$Female.ratio)
stop$try <- stop$Number
stop$temp3 <- as.numeric(stop$Number)
Warning: NAs introduced by coercion
stop$Number <- gsub("^n = ", "", stop$Number)
stop$Number <- gsub("^n=", "", stop$Number)
stop$n <- as.numeric(stop$Number)
stop$Female.ratio[stop$Female.ratio>1 & !is.na(stop$Female.ratio)] <- stop$Female.ratio[stop$Female.ratio>1 & !is.na(stop$Female.ratio)]/100
stop$Female.ratio[is.na(stop$Female.ratio)] <- mean(stop$Female.ratio, na.rm=T)
pattern <- "^d = "
stop$Difference[grepl(pattern, stop$Difference)] <- substring(stop$Difference, first = 5)[grepl(pattern, stop$Difference)]
pattern <- "^d="
stop$Difference[grepl(pattern, stop$Difference)] <- substring(stop$Difference, first = 3)[grepl(pattern, stop$Difference)]
stop$Difference <- gsub(",", ".", stop$Difference)
stop$d <- as.numeric(stop$Difference)
stop$year <- gsub(".*?(\\d{4}).*", "\\1", stop$Authors...Year)
stop$year <- as.numeric(stop$year)
stop$year[is.na(stop$year)] <- mean(stop$year, na.rm=T)
############
stop$wn <- stop$n * stop$Weight
sum(stop$wn, na.rm=T)
[1] 51951899
sum(stop$n, na.rm=T)
[1] 58240961
stop$Ability[stop$Ability==' Verbal Ability'] <- 'Verbal'
stop$Ability[stop$Ability=='Verbal Ability '] <- 'Verbal'
stop$Ability[stop$Ability=='Verbal Ability'] <- 'Verbal'
stop$Ability[stop$Ability=='Opposites'] <- 'Verbal'
stop$Ability[stop$Ability=='Reading '] <- 'Reading'
stop$Ability[stop$Ability=='Full Scale '] <- 'Full Scale'
stop$Ability[stop$Ability=='General Knowledge '] <- 'General Knowledge'
stop$Ability[stop$Ability=='Spatial ability'] <- 'Spatial'
stop$Ability[stop$Ability=='Spatial Ability'] <- 'Spatial'
stop$Ability[stop$Ability=='Spatial '] <- 'Spatial'
stop$Ability[stop$Ability=='Verbal '] <- 'Verbal'
stop$Ability[stop$Ability=='Verbal reasoning'] <- 'Verbal Reasoning'
stop$Ability[stop$Ability=='Reasoning'] <- 'Verbal Reasoning'
stop$Ability[stop$Ability=='Scholastic Ability'] <- 'Scholastic'
stop$Ability[stop$Ability=='Verbal Reasoning'] <- 'Verbal'
stop$Ability[stop$Ability=='English Use'] <- 'Verbal'
stop$Ability[stop$Ability==''] <- 'Unknown'
stop$Ability[stop$Ability=='Mechanical'] <- 'Mechanical Reasoning'
stop$Ability[stop$Ability=='Ravens'] <- 'Matrices'
stop$Ability[stop$Ability=='Knowledge'] <- 'General Knowledge'
stop$Ability[stop$Ability=='Knowledge'] <- 'General Knowledge'
stop$Ability[stop$Ability=='Information'] <- 'General Knowledge'
stop$Ability[stop$Ability=='General knowledge'] <- 'General Knowledge'
stop$Ability[stop$Ability=='Mental Rotation'] <- 'Spatial'
stop$Ability[stop$Ability=='Vocabularly'] <- 'Vocabulary'
stop$Ability[stop$Ability=='Mathematical'] <- 'Mathematics'
stop$Test.Type[stop$Test.Type=='WAIS'] <- 'WAIS-I'
stop$Test.Type[stop$Test.Type=='SATM '] <- 'SATM'
stop$Test.Type[stop$Test.Type=='SATV '] <- 'SATM'
stop$Test.Type[stop$Test.Type=='WAIS'] <- 'WAIS-I'
stop$Test.Type[stop$Test.Type=='WAIS'] <- 'WAIS-I'
stop$Test.Type[stop$Test.Type=='WAIS-IV '] <- 'WAIS-IV'
stop$Test.Type[stop$Test.Type=='Ravens APM RPM'] <- 'Ravens APM'
stop$Test.Type[stop$Test.Type=='Ravens APM short'] <- 'Ravens APM Short'
stop$Test.Type[stop$Test.Type=='unique'] <- 'No ID'
stop$Test.Type[stop$Test.Type=='Unique'] <- 'No ID'
stop$Test.Type[stop$Test.Type=='improvised'] <- 'No ID'
stop$Test.Type[stop$Test.Type=='Improvised'] <- 'No ID'
stop$Test.Type[stop$Test.Type=='HCP'] <- 'No ID'
stop$Ability <- str_to_title(stop$Ability)
stop$Test.Type <- str_to_title(stop$Test.Type)
stop$Country <- str_to_title(stop$Country)
stop$Sample.Type <- str_to_title(stop$Sample.Type)
unique(stop$Sample.Type)
[1] "College Stud."
[2] "General Pop."
[3] "School Stud."
[4] "Lgbt & Straight"
[5] "Roma"
[6] "College Grads."
[7] "Varied"
[8] "Senior Management Applicants"
[9] "Twins"
[10] "Volunteers"
[11] "Gymnasium Students"
[12] "College Applicants"
[13] "College Applicants, Sample Corrected To General Population"
[14] "Community"
[15] "College Grads"
[16] "Job Applicants"
[17] "Job Applicants (Civil Service)"
[18] "Worker Applicants"
[19] "College Educated Adults"
[20] "Employees"
[21] "High School Grads"
[22] ""
unique(stop$Test.Type)
[1] "Raven Apm Short"
[2] "Raven Spm"
[3] "Raven Spm +"
[4] "Raven Apm"
[5] "Raven Spm Short"
[6] "Grt 2"
[7] "Raven Short"
[8] "Raven Rpm"
[9] "Wais-Iii"
[10] "Wais-Iv"
[11] "Wais-R"
[12] "Wais–R"
[13] "Wais–Iv"
[14] "No Id"
[15] "Ac"
[16] "Bpr5 Ar"
[17] "Bpr5 Vr"
[18] "Bpr5 Mr"
[19] "Bpr5 Nr"
[20] "Bpr5 Sr"
[21] "Bpr5"
[22] "Composite"
[23] "Bis"
[24] "Hagen Matrices"
[25] "Wmt Matrices"
[26] "Ist"
[27] "Swesat"
[28] "Swesatq"
[29] "Swesatv"
[30] "Cattel Cft 3"
[31] "Pma-R"
[32] "Kbit Fluid"
[33] "Nnat"
[34] "Mht"
[35] "Mab 2"
[36] "Bls-Iv"
[37] "Ah-4"
[38] "R-1"
[39] "G36"
[40] "Drtb"
[41] "Nz Iq Test"
[42] "Crt"
[43] "Wonderlic"
[44] "Bomat"
[45] "Writ"
[46] "Fit"
[47] "Watson–Glaser"
[48] "Picture And Moray House Test"
[49] "Mkgt International Knowledge"
[50] "Mkgt Technical Knowledge"
[51] "Mkgt Computational Knowledge"
[52] "Mkgt Literary Knowledge"
[53] "Mkgt Cultural Knowledge"
[54] "Mkgt Aesthetic Knowledge"
[55] "Mkgt"
[56] "British Ability Scales"
[57] "Wais-I"
[58] "Pfb"
[59] "Eft"
[60] "Bd"
[61] "Ceft"
[62] "Dat-Sr"
[63] "Ibt"
[64] "Peft"
[65] "Hft"
[66] "Sr"
[67] "Ib"
[68] "Wisc-Iv Fsiq"
[69] "Wisc-Iv Sim"
[70] "Wisc-Iv Voc"
[71] "Wisc-Iv Comp"
[72] "Wisc-Iv Bd"
[73] "Wisc-Iv Pc"
[74] "Wisc-Iv Mr"
[75] "Wisc-Iv Ds"
[76] "Wisc-Iv Lns"
[77] "Wisc-Iv Cod"
[78] "Wisc-Iv Ss"
[79] "Ppvt"
[80] "General Science"
[81] "Arithmetic Reasoning"
[82] "Word Knowledge"
[83] "Paragraph Comprehension"
[84] "Numerical Operations"
[85] "Coding Speed"
[86] "Auto Information"
[87] "Shop Information"
[88] "Mathematics Knowledge"
[89] "Mechanical Comprehension"
[90] "Electronics Information"
[91] "Assembling Objects"
[92] "Asvab"
[93] "Ai/Si"
[94] "Cat-3 V"
[95] "Cat-3 M"
[96] "Cat-3 Nv"
[97] "Cat-3"
[98] "Son-R"
[99] "Sat"
[100] "Satm"
[101] "Satv"
[102] "Gatb"
[103] "Bat-7"
[104] "Bat-7 Verbal"
[105] "Bat-7 Spatial"
[106] "Bat-7 Attention"
[107] "Bat-7 Reasoning"
[108] "Bat-7 Numerical"
[109] "Bat-7 Mechanical"
[110] "Bat-7 Spelling"
[111] "Wais-R Information"
[112] "Wais-R Digit Span"
[113] "Wais-R Vocabulary"
[114] "Wais-R Arithmetic"
[115] "Wais-R Comprehension"
[116] "Wais-R Similarities"
[117] "Wais-R Picture Completion"
[118] "Wais-R Picture Arrangement"
[119] "Wais-R Block Design"
[120] "Wais-R Object Assembly"
[121] "Wais-R Digit Symbol"
[122] "General Ability Test"
[123] "Wordsum"
[124] "Wais-I Information"
[125] "Wais-I Comprehension"
[126] "Wais-I Arithmetic"
[127] "Wais-I Similarities"
[128] "Wais-I Digit Span"
[129] "Wais-I Vocabulary"
[130] "Wais-I Digit Symbol"
[131] "Wais-I Picture Completion"
[132] "Wais-I Block Design"
[133] "Wais-I Picture Arrangement"
[134] "Wais-I Object Assembly"
[135] "Stanford-Binet 2"
[136] "Pet"
[137] "Petq"
[138] "Petv"
[139] "Pete"
[140] "Psatv"
[141] "Psatm"
[142] "Prounam Aa"
[143] "Prounam Vr"
[144] "Prounam Rn"
[145] "Prounam Ra"
[146] "Prounam Rm"
[147] "Prounam Re"
[148] "Prounam Sp"
[149] "Prounam Lu"
[150] "Prounam Ps"
[151] "Prounam Ii Aa"
[152] "Prounam Ii Vr"
[153] "Prounam Ii Rn"
[154] "Prounam Ii Ra"
[155] "Prounam Ii Rm"
[156] "Prounam Ii Re"
[157] "Prounam Ii Lu"
[158] "Prounam Ii Ps"
[159] "Dat Vr"
[160] "Dat C"
[161] "Dat Ra"
[162] "Dat O"
[163] "Dat L"
[164] "Dat"
[165] "Pirls"
[166] "Pisa S"
[167] "Pisa M"
[168] "Pisa R"
[169] "Kaufmangv"
[170] "Kaufmang"
[171] "Kaufmangc"
[172] "Ist2000r V"
[173] "Ist2000r N"
[174] "Ist2000r S"
[175] "Wais-Iii Vocabulary"
[176] "Wais-Iii Similarities"
[177] "Wais-Iii Information"
[178] "Wais-Iii Comprehension"
[179] "Wais-Iii Picture Completion"
[180] "Wais-Iii Block Design"
[181] "Wais-Iii Matrix Reasoning"
[182] "Wais-Iii Picture Arrangement"
[183] "Wais-Iii Arithmetic"
[184] "Wais-Iii Digit Span"
[185] "Wais-Iii Letter-Number"
[186] "Wais-Iii Digit Symbol"
[187] "Wais-Iii Symbol Search"
[188] "Wais-Iii Object Assembly"
[189] "Mrt"
[190] "Wisc-R Information"
[191] "Wisc-R Similarities"
[192] "Wisc-R Arithmetic"
[193] "Wisc-R Vocabulary"
[194] "Wisc-R Comprehension"
[195] "Wisc-R Picture Completion"
[196] "Wisc-R Picture Arangement"
[197] "Wisc-R Block Design"
[198] "Wisc-R Object Assembly"
[199] "Wisc-R Coding"
[200] "Wisc-R Mazes"
[201] "Wisc-R Digit Span"
[202] "Wppsi-Iv Information"
[203] "Wppsi-Iv Vocabulary"
[204] "Wppsi-Iv Picture Naming"
[205] "Wppsi-Iv Block Design"
[206] "Wppsi-Iv Object Assembly"
[207] "Wppsi-Iv Picture Memory"
[208] "Wppsi-Iv Zoo Locations"
[209] "Wppsi-Iv"
[210] "Wppsi-Iv Similarities"
[211] "Wppsi-Iv Comprehension"
[212] "Wppsi-Iv Rec Vocabulary"
[213] "Wppsi-Iv Matrix Reasoning"
[214] "Wppsi-Iv Picture Concepts"
[215] "Wppsi-Iv Bug Search"
[216] "Wppsi-Iv Cancellation"
[217] "Wppsi-Iv Animal Coding"
[218] "Cognitive Abilities Test 6"
[219] "Cognitive Abilities Test 7"
[220] "Reasoning Test Battery"
[221] "Cat3"
[222] "Kait"
[223] "Wisc-R"
[224] "Wisc-Iv"
[225] "Mab-Ii"
[226] "Gama"
[227] "Piaac Iq"
[228] "Wppsi"
[229] "Wisc-Iii"
[230] "Wj-R"
[231] "Wj-77"
[232] "Wj-Iii"
########
stop$Sample.Type[stop$Sample.Type=='College Grads'] <- 'College Grads.'
stop$Sample.Type[stop$Sample.Type=='College Educated Adults'] <- 'College Grads.'
stop$Sample.Type[stop$Sample.Type=='Community'] <- 'Volunteers'
stop$Sample.Type[stop$Sample.Type=='Varied'] <- 'Volunteers'
stop$Sample.Type[stop$Sample.Type=='College Applicants, Sample Corrected To General Population'] <- 'General Pop.'
stop$Sample.Type[stop$Sample.Type=='Twins'] <- 'General Pop.'
stop$Sample.Type[stop$Sample.Type=='General Pop. '] <- 'General Pop.'
stop$Sample.Type[stop$Sample.Type=='High School Grads'] <- 'General Pop.'
stop$Sample.Type[stop$Sample.Type=='Job Applicants (Civil Service)'] <- 'Job Applicants'
stop$Sample.Type[stop$Sample.Type=='Worker Applicants'] <- 'Job Applicants'
stop$Sample.Type[stop$Sample.Type=='School Students'] <- 'School Stud.'
stop$Sample.Type[stop$Sample.Type=='Gymnasium Students'] <- 'Elite Stud.'
stop$Country[stop$Country=='Croata'] <- 'Croatia'
stop$Country[stop$Country=='Columbia'] <- 'Colombia'
stop$Country[stop$Country=='Us'] <- 'Usa'
stop$Country[stop$Country=='Usa & Uk'] <- 'Us/Uk'
unique(stop$Sample.Type)
[1] "College Stud."
[2] "General Pop."
[3] "School Stud."
[4] "Lgbt & Straight"
[5] "Roma"
[6] "College Grads."
[7] "Volunteers"
[8] "Senior Management Applicants"
[9] "Elite Stud."
[10] "College Applicants"
[11] "Job Applicants"
[12] "Employees"
[13] ""
stop$code <- countrycode(stop$Country, origin = "country.name", destination = "iso3c")
Warning: Some values were not matched unambiguously: International
stop$se <- sqrt(2/stop$n + stop$d^2/stop$n)
sum(stop$n*stop$Weight)
[1] 51951899
max(stop$Weight, na.rm=T)
[1] 1
min(stop$Weight, na.rm=T)
[1] 0.033
max(stop$n, na.rm=T)
[1] 2220000
min(stop$n, na.rm=T)
[1] 26
stop <- stop %>% filter(Sample.Type=='General Pop.' | Sample.Type=='School Stud.')
stop <- stop %>% filter(Female.ratio > 0.4 & Female.ratio < 0.6)
stop <- stop %>% filter(!Test.Quality==7)
describe2(stop %>% select(n, wn, Test.Quality, Female.ratio, Mean.age))
stop$quality <- 'mid'
stop$quality[stop$Test.Quality < 3] <- 'high'
sum(stop$wn, na.rm=T)
[1] 15990325
fs <- stop %>% filter(Ability=='Full Scale')
fs2 <- fs %>%
group_by(code) %>%
summarise(d = sum(n))
fs2$alpha3 <- fs2$code
print(fs2, n=50)
world_map <- map_data("world")
world_map$alpha3 <- countrycode(world_map$region, origin = "country.name", destination = "iso3c")
Warning: Some values were not matched unambiguously: Ascension Island, Azores, Barbuda, Bonaire, Canary Islands, Chagos Archipelago, Grenadines, Heard Island, Kosovo, Madeira Islands, Micronesia, Saba, Saint Martin, Siachen Glacier, Sint Eustatius, Virgin Islands
world_map_data <- left_join(world_map, fs2, by = c('alpha3'))
world_map_data$color_category <- cut(world_map_data$d,
breaks = c(0, 100, 500, 1000, 5000, 10000, 100000, Inf),
labels = c("<= 100", "101 - 500", "501 - 1000", "1001 - 5000", "5001 - 10000", "10001 - 100000", "> 100000"),
right = TRUE)
# Plot
p <- ggplot(data = world_map_data, aes(x = long, y = lat, group = group, fill = color_category)) +
geom_polygon(color = "black") +
scale_fill_manual(name = "n",
values = c("<= 100" = "darkred",
"101 - 500" = "red3",
"501 - 1000" = "orange",
"1001 - 5000" = "yellow",
"5001 - 10000" = "greenyellow",
"10001 - 100000" = "green",
"> 100000" = "darkgreen")) +
theme_minimal() +
theme(plot.background = element_rect(fill = "white"),
axis.text = element_blank(),
axis.title = element_blank(),
axis.ticks = element_blank(),
axis.line = element_blank()) +
labs(title = "")
p
file_name <- paste0('', "plot_", 'paper1', ".png")
ggsave(filename = file_name, plot = p, dpi=888)
Saving 5.43 x 3.35 in image
fs <- stop
fs2 <- fs %>%
group_by(code) %>%
summarise(d = sum(n))
fs2$alpha3 <- fs2$code
print(fs2, n=50)
world_map <- map_data("world")
world_map$alpha3 <- countrycode(world_map$region, origin = "country.name", destination = "iso3c")
Warning: Some values were not matched unambiguously: Ascension Island, Azores, Barbuda, Bonaire, Canary Islands, Chagos Archipelago, Grenadines, Heard Island, Kosovo, Madeira Islands, Micronesia, Saba, Saint Martin, Siachen Glacier, Sint Eustatius, Virgin Islands
world_map_data <- left_join(world_map, fs2, by = c('alpha3'))
world_map_data$color_category <- cut(world_map_data$d,
breaks = c(0, 100, 500, 1000, 5000, 10000, 100000, 1000000, Inf),
labels = c("<= 100", "101 - 500", "501 - 1000", "1001 - 5000", "5001 - 10000", "10001 - 100000", "100001 - 1000000", "> 1000000"),
right = TRUE)
# Plot
p <- ggplot(data = world_map_data, aes(x = long, y = lat, group = group, fill = color_category)) +
geom_polygon(color = "black") +
scale_fill_manual(name = "n",
values = c("<= 100" = "darkred",
"101 - 500" = "red3",
"501 - 1000" = "orange",
"1001 - 5000" = "yellow",
"5001 - 10000" = "greenyellow",
"10001 - 100000" = "green",
"100001 - 1000000" = "darkgreen",
"> 1000000" = "#002200")) +
theme_minimal() +
theme(plot.background = element_rect(fill = "white"),
axis.text = element_blank(),
axis.title = element_blank(),
axis.ticks = element_blank(),
axis.line = element_blank()) +
labs(title = "")
p
file_name <- paste0('', "plot_", 'paper2', ".png")
ggsave(filename = file_name, plot = p, dpi=888)
Saving 5.43 x 3.35 in image
st2 <- stop %>% filter(Children.==0)
st22ad <- st2 %>%
group_by(Study.Name, Test.Type) %>%
summarise(n2 = sum(n), d2 = wtd.mean(d, n), Ability = Ability) %>%
distinct(Study.Name, Test.Type, .keep_all = TRUE)
Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in dplyr 1.1.0.
Please use `reframe()` instead.
When switching from `summarise()` to `reframe()`, remember that `reframe()` always returns an ungrouped data frame and adjust accordingly.`summarise()` has grouped output by 'Study.Name', 'Test.Type'. You can override using the `.groups` argument.
abilityad <- st22ad %>%
group_by(Ability) %>%
summarise(k = n(), n = sum(n2)) %>%
arrange(-k)
print(abilityad, n=100)
abiad <- abilityad %>% filter(k > 1 & n > 500)
abiad <- abiad %>% filter(!Ability=='Unknown')
st2 <- stop %>% filter(Children.==2)
st22kid <- st2 %>%
group_by(Study.Name, Test.Type) %>%
summarise(n2 = sum(n), d2 = wtd.mean(d, n), Ability = Ability) %>%
distinct(Study.Name, Test.Type, .keep_all = TRUE)
Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in dplyr 1.1.0.
Please use `reframe()` instead.
When switching from `summarise()` to `reframe()`, remember that `reframe()` always returns an ungrouped data frame and adjust accordingly.`summarise()` has grouped output by 'Study.Name', 'Test.Type'. You can override using the `.groups` argument.
abilitych <- st22kid %>%
group_by(Ability) %>%
summarise(k = n(), n = sum(n2)) %>%
arrange(-k)
print(abilitych, n=100)
abich <- abilitych %>% filter(k > 1 & n > 500)
abich <- abich %>% filter(!Ability=='Unknown')
fin <- (unique(stop$Ability) %in% abich$Ability & unique(stop$Ability) %in% abiad$Ability)
testab <- unique(stop$Ability)[fin]
st22ad$se <- sqrt(2/st22ad$n2 + st22ad$d2^2/st22ad$n2)
st22kid$se <- sqrt(2/st22kid$n2 + st22kid$d2^2/st22kid$n2)
adultdf <- data.frame(ability=testab, d=rep(0, 15), CIL=rep(0, 15), CIU=rep(0, 15))
i = 1
for(abil in testab) {
read <- st22ad %>% filter(Ability==abil)
print("")
print("")
print("")
print("")
print(abil)
print("")
print("")
print("")
print("")
if(nrow(read) > 0) {
metaobj <- metafor::rma(yi=d2, sei=se, data=read)
print(metaobj)
adultdf$ability[i] <- abil
adultdf$d[i] <- metaobj$b
adultdf$CIL[i] <- metaobj$ci.lb
adultdf$CIU[i] <- metaobj$ci.ub
i = i + 1
}
}
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Matrices"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 22; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0067 (SE = 0.0031)
tau (square root of estimated tau^2 value): 0.0819
I^2 (total heterogeneity / total variability): 77.75%
H^2 (total variability / sampling variability): 4.49
Test for Heterogeneity:
Q(df = 21) = 70.8526, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.2174 0.0216 10.0672 <.0001 0.1751 0.2598 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Full Scale"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 51; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0207 (SE = 0.0045)
tau (square root of estimated tau^2 value): 0.1438
I^2 (total heterogeneity / total variability): 97.65%
H^2 (total variability / sampling variability): 42.60
Test for Heterogeneity:
Q(df = 50) = 1361.8560, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.1744 0.0212 8.2325 <.0001 0.1328 0.2159 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Memory"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 6; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0077 (SE = 0.0060)
tau (square root of estimated tau^2 value): 0.0880
I^2 (total heterogeneity / total variability): 90.46%
H^2 (total variability / sampling variability): 10.48
Test for Heterogeneity:
Q(df = 5) = 45.0000, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0930 0.0400 2.3240 0.0201 0.0146 0.1715 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Mathematics"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 10; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0151 (SE = 0.0080)
tau (square root of estimated tau^2 value): 0.1228
I^2 (total heterogeneity / total variability): 97.21%
H^2 (total variability / sampling variability): 35.90
Test for Heterogeneity:
Q(df = 9) = 169.4714, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.3381 0.0413 8.1867 <.0001 0.2571 0.4190 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Nonverbal"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 21; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0081 (SE = 0.0035)
tau (square root of estimated tau^2 value): 0.0898
I^2 (total heterogeneity / total variability): 79.65%
H^2 (total variability / sampling variability): 4.91
Test for Heterogeneity:
Q(df = 20) = 100.9729, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.1354 0.0232 5.8307 <.0001 0.0899 0.1809 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Verbal"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 3; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0073 (SE = 0.0094)
tau (square root of estimated tau^2 value): 0.0854
I^2 (total heterogeneity / total variability): 88.37%
H^2 (total variability / sampling variability): 8.60
Test for Heterogeneity:
Q(df = 2) = 24.0492, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0704 0.0555 1.2689 0.2045 -0.0384 0.1792
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Mechanical Reasoning"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 3; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0208 (SE = 0.0218)
tau (square root of estimated tau^2 value): 0.1441
I^2 (total heterogeneity / total variability): 95.99%
H^2 (total variability / sampling variability): 24.93
Test for Heterogeneity:
Q(df = 2) = 42.4451, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.5420 0.0853 6.3580 <.0001 0.3750 0.7091 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Spatial"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 15; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0450 (SE = 0.0190)
tau (square root of estimated tau^2 value): 0.2121
I^2 (total heterogeneity / total variability): 97.52%
H^2 (total variability / sampling variability): 40.37
Test for Heterogeneity:
Q(df = 14) = 381.8299, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.2788 0.0582 4.7900 <.0001 0.1647 0.3929 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Similarities"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 6; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0103 (SE = 0.0082)
tau (square root of estimated tau^2 value): 0.1017
I^2 (total heterogeneity / total variability): 84.57%
H^2 (total variability / sampling variability): 6.48
Test for Heterogeneity:
Q(df = 5) = 34.9614, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0628 0.0466 1.3485 0.1775 -0.0285 0.1541
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Vocabulary"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 9; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0066 (SE = 0.0041)
tau (square root of estimated tau^2 value): 0.0813
I^2 (total heterogeneity / total variability): 89.25%
H^2 (total variability / sampling variability): 9.30
Test for Heterogeneity:
Q(df = 8) = 70.5648, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0465 0.0305 1.5253 0.1272 -0.0133 0.1064
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Reading"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0 (SE = 0.0012)
tau (square root of estimated tau^2 value): 0
I^2 (total heterogeneity / total variability): 0.00%
H^2 (total variability / sampling variability): 1.00
Test for Heterogeneity:
Q(df = 1) = 0.9254, p-val = 0.3361
Model Results:
estimate se zval pval ci.lb ci.ub
-0.1860 0.0124 -14.9917 <.0001 -0.2104 -0.1617 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Processing Speed"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 12; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0584 (SE = 0.0259)
tau (square root of estimated tau^2 value): 0.2416
I^2 (total heterogeneity / total variability): 98.52%
H^2 (total variability / sampling variability): 67.40
Test for Heterogeneity:
Q(df = 11) = 406.0841, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.2839 0.0712 -3.9894 <.0001 -0.4234 -0.1444 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "General Knowledge"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 7; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0268 (SE = 0.0171)
tau (square root of estimated tau^2 value): 0.1636
I^2 (total heterogeneity / total variability): 93.26%
H^2 (total variability / sampling variability): 14.84
Test for Heterogeneity:
Q(df = 6) = 73.9693, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.3984 0.0652 6.1093 <.0001 0.2706 0.5262 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Technical Knowledge"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 5; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0329 (SE = 0.0241)
tau (square root of estimated tau^2 value): 0.1814
I^2 (total heterogeneity / total variability): 98.22%
H^2 (total variability / sampling variability): 56.14
Test for Heterogeneity:
Q(df = 4) = 336.8825, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.7091 0.0826 8.5836 <.0001 0.5472 0.8710 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Common Sense"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 5; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0061 (SE = 0.0058)
tau (square root of estimated tau^2 value): 0.0780
I^2 (total heterogeneity / total variability): 77.80%
H^2 (total variability / sampling variability): 4.51
Test for Heterogeneity:
Q(df = 4) = 20.3259, p-val = 0.0004
Model Results:
estimate se zval pval ci.lb ci.ub
0.2105 0.0409 5.1460 <.0001 0.1303 0.2907 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
childdf <- data.frame(ability=testab, d=rep(0, 15), CIL=rep(0, 15), CIU=rep(15))
i = 1
testab
[1] "Matrices" "Full Scale"
[3] "Memory" "Mathematics"
[5] "Nonverbal" "Verbal"
[7] "Mechanical Reasoning" "Spatial"
[9] "Similarities" "Vocabulary"
[11] "Reading" "Processing Speed"
[13] "General Knowledge" "Technical Knowledge"
[15] "Common Sense"
for(abil in testab) {
read <- st22kid %>% filter(Ability==abil)
print("")
print("")
print("")
print("")
print(abil)
print("")
print("")
print("")
print("")
if(nrow(read) > 0) {
metaobj <- metafor::rma(yi=d2, sei=se, data=read)
print(metaobj)
childdf$ability[i] <- abil
childdf$d[i] <- metaobj$b
childdf$CIL[i] <- metaobj$ci.lb
childdf$CIU[i] <- metaobj$ci.ub
i = i + 1
}
}
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Matrices"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 10; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0173 (SE = 0.0090)
tau (square root of estimated tau^2 value): 0.1314
I^2 (total heterogeneity / total variability): 94.72%
H^2 (total variability / sampling variability): 18.95
Test for Heterogeneity:
Q(df = 9) = 146.1915, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.0511 0.0437 -1.1690 0.2424 -0.1367 0.0346
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Full Scale"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 28; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0104 (SE = 0.0031)
tau (square root of estimated tau^2 value): 0.1018
I^2 (total heterogeneity / total variability): 98.63%
H^2 (total variability / sampling variability): 72.90
Test for Heterogeneity:
Q(df = 27) = 1115.5763, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.0280 0.0204 -1.3717 0.1702 -0.0681 0.0120
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Memory"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 5; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0050 (SE = 0.0051)
tau (square root of estimated tau^2 value): 0.0707
I^2 (total heterogeneity / total variability): 69.96%
H^2 (total variability / sampling variability): 3.33
Test for Heterogeneity:
Q(df = 4) = 14.8190, p-val = 0.0051
Model Results:
estimate se zval pval ci.lb ci.ub
-0.1757 0.0381 -4.6063 <.0001 -0.2504 -0.1009 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Mathematics"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 4; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0122 (SE = 0.0103)
tau (square root of estimated tau^2 value): 0.1104
I^2 (total heterogeneity / total variability): 98.16%
H^2 (total variability / sampling variability): 54.39
Test for Heterogeneity:
Q(df = 3) = 207.0881, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.1824 0.0563 3.2401 0.0012 0.0720 0.2927 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Nonverbal"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 10; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0121 (SE = 0.0064)
tau (square root of estimated tau^2 value): 0.1101
I^2 (total heterogeneity / total variability): 98.55%
H^2 (total variability / sampling variability): 69.14
Test for Heterogeneity:
Q(df = 9) = 98.7385, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0064 0.0369 0.1746 0.8614 -0.0658 0.0787
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Verbal"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 3; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0363 (SE = 0.0367)
tau (square root of estimated tau^2 value): 0.1904
I^2 (total heterogeneity / total variability): 99.33%
H^2 (total variability / sampling variability): 149.07
Test for Heterogeneity:
Q(df = 2) = 297.9576, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.0574 0.1106 -0.5186 0.6040 -0.2742 0.1595
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Mechanical Reasoning"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0155 (SE = 0.0224)
tau (square root of estimated tau^2 value): 0.1244
I^2 (total heterogeneity / total variability): 97.85%
H^2 (total variability / sampling variability): 46.50
Test for Heterogeneity:
Q(df = 1) = 46.4975, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.3329 0.0890 3.7423 0.0002 0.1585 0.5072 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Spatial"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 15; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0562 (SE = 0.0232)
tau (square root of estimated tau^2 value): 0.2370
I^2 (total heterogeneity / total variability): 98.23%
H^2 (total variability / sampling variability): 56.60
Test for Heterogeneity:
Q(df = 14) = 264.6033, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0872 0.0640 1.3623 0.1731 -0.0382 0.2125
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Similarities"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0061 (SE = 0.0119)
tau (square root of estimated tau^2 value): 0.0778
I^2 (total heterogeneity / total variability): 72.10%
H^2 (total variability / sampling variability): 3.58
Test for Heterogeneity:
Q(df = 1) = 3.5847, p-val = 0.0583
Model Results:
estimate se zval pval ci.lb ci.ub
-0.0274 0.0644 -0.4261 0.6700 -0.1536 0.0987
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Vocabulary"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 6; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0357 (SE = 0.0237)
tau (square root of estimated tau^2 value): 0.1889
I^2 (total heterogeneity / total variability): 96.85%
H^2 (total variability / sampling variability): 31.72
Test for Heterogeneity:
Q(df = 5) = 114.8061, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.0655 0.0791 -0.8288 0.4072 -0.2205 0.0894
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Reading"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 3; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0054 (SE = 0.0055)
tau (square root of estimated tau^2 value): 0.0733
I^2 (total heterogeneity / total variability): 99.88%
H^2 (total variability / sampling variability): 836.27
Test for Heterogeneity:
Q(df = 2) = 2897.7840, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.2894 0.0428 -6.7635 <.0001 -0.3733 -0.2056 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Processing Speed"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 6; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0131 (SE = 0.0095)
tau (square root of estimated tau^2 value): 0.1143
I^2 (total heterogeneity / total variability): 92.28%
H^2 (total variability / sampling variability): 12.96
Test for Heterogeneity:
Q(df = 5) = 66.8432, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.3243 0.0502 -6.4604 <.0001 -0.4227 -0.2259 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "General Knowledge"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 6; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0852 (SE = 0.0552)
tau (square root of estimated tau^2 value): 0.2918
I^2 (total heterogeneity / total variability): 98.20%
H^2 (total variability / sampling variability): 55.53
Test for Heterogeneity:
Q(df = 5) = 270.4920, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.0577 0.1206 -0.4784 0.6324 -0.2941 0.1787
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Technical Knowledge"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 3; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0180 (SE = 0.0184)
tau (square root of estimated tau^2 value): 0.1341
I^2 (total heterogeneity / total variability): 97.94%
H^2 (total variability / sampling variability): 48.44
Test for Heterogeneity:
Q(df = 2) = 96.8365, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.4264 0.0782 5.4513 <.0001 0.2731 0.5797 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] ""
[1] ""
[1] ""
[1] ""
[1] "Common Sense"
[1] ""
[1] ""
[1] ""
[1] ""
Random-Effects Model (k = 2; tau^2 estimator: REML)
tau^2 (estimated amount of total heterogeneity): 0.0349 (SE = 0.0530)
tau (square root of estimated tau^2 value): 0.1867
I^2 (total heterogeneity / total variability): 93.07%
H^2 (total variability / sampling variability): 14.44
Test for Heterogeneity:
Q(df = 1) = 14.4394, p-val = 0.0001
Model Results:
estimate se zval pval ci.lb ci.ub
-0.1101 0.1368 -0.8048 0.4209 -0.3782 0.1580
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
childdf$ability <- paste0(childdf$ability, ' (C)')
childdf$child = 1
adultdf$child = 0
klaasje <- rbind(childdf, adultdf)
klaasje$child <- as.factor(klaasje$child)
klaasje <- klaasje %>%
mutate(ability = factor(ability, levels = ability[order(d)]))
klaasje$d <- klaasje$d*15
klaasje$CIL <- klaasje$CIL*15
klaasje$CIU <- klaasje$CIU*15
p <- ggplot(klaasje, aes(x=d, y=ability, color=child)) + # Add color aesthetic
geom_point() +
geom_errorbar(aes(xmin=CIL, xmax=CIU), width=.1) +
scale_color_manual(values=c("0"="black", "1"="red")) + # Map colors
geom_vline(xintercept = -5, linetype = "dashed", color = "black", alpha=0.4) +
geom_vline(xintercept = 0, linetype = "dashed", color = "black", alpha=0.4) +
geom_vline(xintercept = 5, linetype = "dashed", color = "black", alpha=0.4) +
geom_vline(xintercept = 10, linetype = "dashed", color = "black", alpha=0.4) +
theme_minimal() +
labs(x="Male advantage in IQ points", y="") +
theme_bw() +
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.title.x = element_text(size=12, face="bold"),
axis.text.y = element_text(size=10),
panel.spacing = unit(.1, "lines"),
legend.position = "none" # Hide the legend if not desired
)
p
file_name <- paste0('', "plot_", 'paper3', ".png")
ggsave(filename = file_name, plot = p, dpi=888)
Saving 5.43 x 3.35 in image
paper <- stop %>% filter(Test.Type=='Pirls' | Test.Type=='Pisa R')
paper$Test.Type[paper$Test.Type=='Pisa R'] <- 'aref'
paper$se = sqrt(2/paper$n + paper$d^2/paper$n)
metaobj <- metafor::rma(yi=d, sei=se, data=paper, mods = ~ Test.Type + code)
death <- data.frame(name=names(coef(metaobj)), d=as.numeric(coef(metaobj))-0.4928)
death$name[1] <- 'ALB'
death$d[1] <- -0.4928
death$name[2:length(death$name)] <- sapply(death$name[2:length(death$name)], function(x) substr(x, start = 5, stop = nchar(x)))
death <- death[1:88, ]
death$alpha3 <- death$name
paper2 <- stop %>% filter(Test.Type=='Pisa M')
paper2$se = sqrt(2/paper2$n + paper2$d^2/paper2$n)
metaobj <- metafor::rma(yi=d, sei=se, data=paper2, mods = ~ code)
death2 <- data.frame(name=names(coef(metaobj)), d=as.numeric(coef(metaobj)) -0.0857)
death2$name[1] <- 'ALB'
death2$d[1] <- -0.0857
death2$name[2:length(death2$name)] <- sapply(death2$name[2:length(death2$name)], function(x) substr(x, start = 5, stop = nchar(x)))
death2 <- death2[1:81, ]
death2$alpha3 <- death2$name
paper3 <- stop %>% filter(Test.Type=='Pisa S')
paper3$se = sqrt(2/paper3$n + paper3$d^2/paper3$n)
metaobj <- metafor::rma(yi=d, sei=se, data=paper3, mods = ~ code)
death3 <- data.frame(name=names(coef(metaobj)), d=as.numeric(coef(metaobj)) -0.2341)
death3$name[1] <- 'ALB'
death3$d[1] <- -0.2341
death3$name[2:length(death3$name)] <- sapply(death3$name[2:length(death3$name)], function(x) substr(x, start = 5, stop = nchar(x)))
death3 <- death3[1:81, ]
death3$alpha3 <- death3$name
############
other <- stop %>% filter(!(Test.Type=='Pisa S' | Test.Type=='Pisa R' | Test.Type=='Pisa M' | Test.Type=='Pirls'))
other <- other %>% filter(!is.na(code))
other$se = sqrt(2/other$n + other$d^2/other$n)
other$Ability[other$Ability == 'Full Scale'] <- 'aafs'
other$Children. <- as.factor(other$Children.)
metaobj <- metafor::rma(yi=d, sei=se, data=other, mods = ~ code + Ability + Children.)
Warning: 1 study with NAs omitted from model fitting.
death4 <- data.frame(name=names(coef(metaobj)), d=as.numeric(coef(metaobj)) - -0.2595)
death4$name[1] <- 'AUS'
death4$d[1] <- 0.2595
death4$name[2:length(death4$name)] <- sapply(death4$name[2:length(death4$name)], function(x) substr(x, start = 5, stop = nchar(x)))
death4 <- death4[1:51, ]
death4$alpha3 <- death4$name
##############
death$r <- death$d
death2$m <- death2$d
death3$s <- death3$d
death4$i <- death4$d
##########
zxc <- full_join(death, death4, by='alpha3')
zxc <- full_join(zxc, death2, by='alpha3')
zxc <- full_join(zxc, death3, by='alpha3')
zxc$c = rowMeans(subset(zxc, select=c(r, m, s)), na.rm = T)
upset <- zxc %>% select(s, r, m , i)
cor(upset, use='pairwise.complete.obs')
s r m i
s 1.00000 0.83349 0.87175 0.40595
r 0.83349 1.00000 0.72014 0.45485
m 0.87175 0.72014 1.00000 0.44977
i 0.40595 0.45485 0.44977 1.00000
cor.test(zxc$s, zxc$i)
Pearson's product-moment correlation
data: zxc$s and zxc$i
t = 2.74, df = 38, p-value = 0.0093
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.10812 0.63692
sample estimates:
cor
0.40595
cor.test(zxc$r, zxc$i)
Pearson's product-moment correlation
data: zxc$r and zxc$i
t = 3.23, df = 40, p-value = 0.0025
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.17513 0.66662
sample estimates:
cor
0.45485
cor.test(zxc$m, zxc$i)
Pearson's product-moment correlation
data: zxc$m and zxc$i
t = 3.1, df = 38, p-value = 0.0036
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.16079 0.66773
sample estimates:
cor
0.44977
cor.test(zxc$i, zxc$i)
Pearson's product-moment correlation
data: zxc$i and zxc$i
t = Inf, df = 49, p-value <0.0000000000000002
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
1 1
sample estimates:
cor
1
nrow(stop)
[1] 2086
n0 <- stop %>% filter(Ability=='Full Scale')
n1 <- stop %>% filter(stop$Children.==0 & Ability=='Full Scale')
n2 <- stop %>% filter(stop$Children.==0 & Ability=='Full Scale' & stop$Test.Quality<3)
best <- subset(stop, stop$Ability=='Full Scale' & stop$Test.Quality<3 & stop$Children.==0)
magic <- best %>%
group_by(Study.Name, Test.Type) %>%
summarise(n2 = sum(n), d2 = wtd.mean(d, n), hyperid = Authors...Year) %>%
distinct(Study.Name, Test.Type, .keep_all = TRUE)
Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in dplyr 1.1.0.
Please use `reframe()` instead.
When switching from `summarise()` to `reframe()`, remember that `reframe()` always returns an ungrouped data frame and adjust accordingly.`summarise()` has grouped output by 'Study.Name', 'Test.Type'. You can override using the `.groups` argument.
magic$se = sqrt(2/magic$n2 + magic$d2^2/magic$n2)
magic$se2 <- magic$se*15
magic$d3 <- magic$d2*15
metaobj <- metafor::rma(yi=d2, sei=se, data=magic)
summary(metaobj)
Random-Effects Model (k = 47; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
19.9263 -39.8526 -35.8526 -32.1953 -35.5735
tau^2 (estimated amount of total heterogeneity): 0.0218 (SE = 0.0050)
tau (square root of estimated tau^2 value): 0.1476
I^2 (total heterogeneity / total variability): 98.19%
H^2 (total variability / sampling variability): 55.32
Test for Heterogeneity:
Q(df = 46) = 1341.8354, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.1713 0.0226 7.5808 <.0001 0.1270 0.2156 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
magic$invse <- 1/magic$se
metafor::regtest(x=d3, sei=se2, data=magic, model='rma')
Regression Test for Funnel Plot Asymmetry
Model: mixed-effects meta-regression model
Predictor: standard error
Test for Funnel Plot Asymmetry: z = 0.5268, p = 0.5983
Limit Estimate (as sei -> 0): b = 2.2784 (CI: 1.0059, 3.5509)
par(cex.lab=1.2)
p <- funnel(metaobj, xlab='Male Advantage in Full Scale Ability (IQ-metric)')
text(magic$d3, magic$se2, labels = magic$Test.Type, cex = 0.7, pos = 1)
magic2$se = sqrt(2/magic2$n2 + magic2$d2^2/magic2$n2)
magic3 <- data.frame(battery = unique(magic2$Test), d = 0)
batteries <- unique(magic2$Test)
magic2$d3 <- magic2$d2*15
magic2$se2 <- magic2$se*15
metaobj0 <- metafor::rma(yi=d3, sei=se2, data=magic2)
summary(metaobj0)
Random-Effects Model (k = 47; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
-104.6440 209.2880 213.2880 216.9453 213.5671
tau^2 (estimated amount of total heterogeneity): 4.9026 (SE = 1.1195)
tau (square root of estimated tau^2 value): 2.2142
I^2 (total heterogeneity / total variability): 98.19%
H^2 (total variability / sampling variability): 55.32
Test for Heterogeneity:
Q(df = 46) = 1341.8354, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
2.5695 0.3389 7.5808 <.0001 1.9052 3.2338 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
par(mar = c(5, 6, 4, 2) + 0.1)
p <- funnel(metaobj0, xlab='Male Advantage in Full Scale Ability (IQ-metric)', cex.lab = 1.25,cex.main = 1, cex.axis = 1)
text(magic2$d3, magic2$se2, labels = magic2$Test.Type, cex = 0.75, pos = 1)
p <- magic2 %>%
mutate(Test.Type = fct_reorder(Test.Type, d3)) %>%
ggplot(aes(x = Test.Type, y = d3)) +
geom_violin(trim = FALSE, fill = "skyblue", alpha = 0.5) +
geom_jitter(width = 0.05, alpha = 0.7) +
geom_hline(yintercept = 0, color = "black", size = 0.5) + # Add a dark line at y = 0
coord_flip() +
scale_y_continuous(breaks = seq(-9, 9, by = 3), limits = c(-8, 8)) +
theme_bw() +
labs(x = "Test", y = "Male IQ Advantage (within adults)") +
theme(
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title.x = element_text(size = 14),
axis.title.y = element_text(size = 14)
)
p
file_name <- paste0('', "plot_", 'paper8', ".png")
ggsave(filename = file_name, plot = p, dpi=400)
Saving 5.43 x 3.35 in image
develop2 <- stop %>% filter(Ability == 'Full Scale')
develop2$se = sqrt(2/develop2$n + develop2$d^2/develop2$n)
lr <- lm(data=develop2, d ~ Mean.age)
lr2 <- lm(data=develop2, d ~ rcs(Mean.age, 5))
summary(lr)
Call:
lm(formula = d ~ Mean.age, data = develop2)
Residuals:
Min 1Q Median 3Q Max
-0.6596 -0.0878 0.0183 0.1066 0.4643
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.005585 0.021358 -0.26 0.7939
Mean.age 0.002096 0.000584 3.59 0.0004 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.18 on 237 degrees of freedom
Multiple R-squared: 0.0516, Adjusted R-squared: 0.0476
F-statistic: 12.9 on 1 and 237 DF, p-value: 0.0004
anova(lr, lr2)
Analysis of Variance Table
Model 1: d ~ Mean.age
Model 2: d ~ rcs(Mean.age, 5)
Res.Df RSS Df Sum of Sq F Pr(>F)
1 237 7.69
2 234 7.08 3 0.611 6.73 0.00023 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(lr2, lr)
Analysis of Variance Table
Model 1: d ~ rcs(Mean.age, 5)
Model 2: d ~ Mean.age
Res.Df RSS Df Sum of Sq F Pr(>F)
1 234 7.08
2 237 7.69 -3 -0.611 6.73 0.00023 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
ONLY FSIQ TESTS
metaobj <- metafor::rma(yi=d, sei=se, data=develop2, mods = ~ Mean.age + year + Female.ratio)
summary(metaobj)
Mixed-Effects Model (k = 239; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
79.8224 -159.6448 -149.6448 -132.3469 -149.3828
tau^2 (estimated amount of residual heterogeneity): 0.0237 (SE = 0.0025)
tau (square root of estimated tau^2 value): 0.1539
I^2 (residual heterogeneity / unaccounted variability): 98.14%
H^2 (unaccounted variability / sampling variability): 53.88
R^2 (amount of heterogeneity accounted for): 11.05%
Test for Residual Heterogeneity:
QE(df = 235) = 5060.4233, p-val < .0001
Test of Moderators (coefficients 2:4):
QM(df = 3) = 24.5537, p-val < .0001
Model Results:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
metaobj$se
[1] 1.24338763 0.00056551 0.00061578 0.35932564
metaobj$beta
[,1]
intrcpt 1.9999750
Mean.age 0.0022825
year -0.0011515
Female.ratio 0.5982189
develop3 <- stop
develop3$se = sqrt(2/develop3$n + develop3$d^2/develop3$n)
ALL TESTS WITH CONTROLS FOR ABILITIES TESTED
metaobj <- metafor::rma(yi=d, sei=se, data=develop3, mods = ~ Mean.age + Ability + Female.ratio + year)
summary(metaobj)
Mixed-Effects Model (k = 2086; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
1040.5098 -2081.0196 -1989.0196 -1730.4446 -1986.8511
tau^2 (estimated amount of residual heterogeneity): 0.0190 (SE = 0.0006)
tau (square root of estimated tau^2 value): 0.1377
I^2 (residual heterogeneity / unaccounted variability): 98.73%
H^2 (unaccounted variability / sampling variability): 78.89
R^2 (amount of heterogeneity accounted for): 69.19%
Test for Residual Heterogeneity:
QE(df = 2041) = 119655.7268, p-val < .0001
Test of Moderators (coefficients 2:45):
QM(df = 44) = 4342.8832, p-val < .0001
Model Results:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
metaobj$se
[1] 0.57422084 0.00033386 0.14342133 0.11509376 0.13160926
[6] 0.11124564 0.17522487 0.13162978 0.14346892 0.17526965
[11] 0.10199647 0.10506977 0.12052302 0.13158910 0.17166737
[16] 0.13158316 0.11683520 0.10173407 0.10382811 0.10312325
[21] 0.10894907 0.14478611 0.10528786 0.12058086 0.10336237
[26] 0.13160799 0.10408944 0.17615419 0.10166846 0.11055242
[31] 0.12419346 0.10173396 0.13146693 0.10960026 0.10342218
[36] 0.11729014 0.13174893 0.10635250 0.11056247 0.10463410
[41] 0.17439284 0.10537826 0.14164985 0.13697734 0.00028163
metaobj$beta
[,1]
intrcpt 2.77094079
Mean.age 0.00270399
AbilityArtistic Knowledge 0.08912689
AbilityAttention 0.16571875
AbilityBiological Knowledge -0.00046141
AbilityCommon Sense 0.18782804
AbilityCooking Knowledge -0.03436489
AbilityEntertainment Knowledge -0.14029223
AbilityFilm Knowledge -0.13775925
AbilityFinancial Knowledge 0.32563511
AbilityFull Scale 0.17064081
AbilityGeneral Knowledge 0.42425913
AbilityHistorical Knowledge 0.33315170
AbilityInternational Knowledge 0.27719142
AbilityKnowledge Of Animals 0.04358678
AbilityLiterary Knowledge 0.04718527
AbilityMathematical Knowledge 0.04954631
AbilityMathematical Literacy 0.23900598
AbilityMathematics 0.34221446
AbilityMatrices 0.22818265
AbilityMechanical Reasoning 0.59318206
AbilityMedical Knowledge -0.12151330
AbilityMemory -0.01946481
AbilityMusical Knowledge 0.00185654
AbilityNonverbal 0.18433069
AbilityPolitical Knowledge 0.32791631
AbilityProcessing Speed -0.18817629
AbilityPsychological Knowledge -0.20436879
AbilityReading -0.19741676
AbilityScholastic 0.32304462
AbilityScientific Knowledge 0.31662186
AbilityScientific Literacy 0.13684538
AbilitySequences 0.19267315
AbilitySimilarities 0.13399115
AbilitySpatial 0.33932706
AbilitySpelling -0.02804665
AbilitySporting Knowledge 0.45333583
AbilityTechnical Knowledge 0.61751671
AbilityUnknown 0.08041684
AbilityVerbal 0.07978952
AbilityVerbal-Numerical Reasoning 0.42550936
AbilityVocabulary 0.14339034
AbilityWriting -0.29150734
Female.ratio 0.39368036
year -0.00157459
ALL TESTS WITH NO CONTROLS FOR ABILITIES TESTED
metaobj2 <- metafor::rma(yi=d, sei=se, data=develop3, mods = ~ Mean.age+ Female.ratio + year)
summary(metaobj2)
Mixed-Effects Model (k = 2086; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
-0.6989 1.3977 11.3977 39.6032 11.4266
tau^2 (estimated amount of residual heterogeneity): 0.0567 (SE = 0.0018)
tau (square root of estimated tau^2 value): 0.2382
I^2 (residual heterogeneity / unaccounted variability): 99.61%
H^2 (unaccounted variability / sampling variability): 253.62
R^2 (amount of heterogeneity accounted for): 7.78%
Test for Residual Heterogeneity:
QE(df = 2082) = 570532.3328, p-val < .0001
Test of Moderators (coefficients 2:4):
QM(df = 3) = 173.3536, p-val < .0001
Model Results:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
metaobj2$se
[1] 0.83110775 0.00047360 0.22178512 0.00040954
metaobj2$beta
[,1]
intrcpt 5.2015419
Mean.age 0.0048146
Female.ratio 0.3715838
year -0.0027522
develop <- stop %>% filter(Ability %in% c('Full Scale', 'Matrices', 'Scholastic') & Female.ratio < .55 & Female.ratio > .45 & Test.Quality < 5)
develop$se = sqrt(2/develop$n + develop$d^2/develop$n)*15
develop$d <- develop$d*15
develop$Mean.age[develop$Mean.age > 20] <- 20
dat <- develop
dat$yi <- dat$d
dat$vi <- dat$se
metaobj <- metafor::rma(yi=d, sei=se, data=dat, mods = ~ rcs(Mean.age, 8))
summary(metaobj)
Mixed-Effects Model (k = 206; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
-458.3690 916.7379 930.7379 953.8261 931.3212
tau^2 (estimated amount of residual heterogeneity): 4.3199 (SE = 0.5283)
tau (square root of estimated tau^2 value): 2.0784
I^2 (residual heterogeneity / unaccounted variability): 97.44%
H^2 (unaccounted variability / sampling variability): 39.01
R^2 (amount of heterogeneity accounted for): 25.62%
Test for Residual Heterogeneity:
QE(df = 200) = 2572.8358, p-val < .0001
Test of Moderators (coefficients 2:6):
QM(df = 5) = 57.8912, p-val < .0001
Model Results:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
lr <- lm(data=dat, d ~ rcs(Mean.age, 8))
summary(lr)
Call:
lm(formula = d ~ rcs(Mean.age, 8), data = dat)
Residuals:
Min 1Q Median 3Q Max
-8.526 -1.295 0.175 1.476 6.268
Coefficients:
Estimate Std. Error t value
(Intercept) -5.702 1.597 -3.57
rcs(Mean.age, 8)Mean.age 0.743 0.255 2.91
rcs(Mean.age, 8)Mean.age' -1.994 1.044 -1.91
rcs(Mean.age, 8)Mean.age'' 13.138 7.848 1.67
rcs(Mean.age, 8)Mean.age''' -22.709 17.659 -1.29
rcs(Mean.age, 8)Mean.age'''' 16.981 29.369 0.58
Pr(>|t|)
(Intercept) 0.00045 ***
rcs(Mean.age, 8)Mean.age 0.00398 **
rcs(Mean.age, 8)Mean.age' 0.05764 .
rcs(Mean.age, 8)Mean.age'' 0.09571 .
rcs(Mean.age, 8)Mean.age''' 0.19994
rcs(Mean.age, 8)Mean.age'''' 0.56378
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.48 on 200 degrees of freedom
Multiple R-squared: 0.196, Adjusted R-squared: 0.176
F-statistic: 9.77 on 5 and 200 DF, p-value: 0.000000023
lr$coefficients[!is.na(lr$coefficients)] <- metaobj$b
uzi <- seq(from=3, to=20, by=0.1)
uzi2 <- data.frame(Mean.age=uzi)
uzi2$fit = predict(lr, uzi2, interval = "confidence")
p <- ggplot(uzi2) +
geom_point(mapping = aes(x=Mean.age, y=d, size = n), data=dat) +
geom_line(data = uzi2, aes(x = Mean.age, y = fit[, 1]), color = "blue", size = 1) +
geom_ribbon(data = uzi2, aes(x = Mean.age, ymin = fit[, 2], ymax = fit[, 3]), alpha = 0.35) + # Confidence interval shading
labs(x = "Age of sample", y = "Male Advantage in IQ") +
ylim(-5, 5) +
theme_bw() +
scale_size_area(
max_size = 12
) +
theme(
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title.x = element_text(size = 14),
axis.title.y = element_text(size = 14),
legend.position = "none"
)
p
file_name <- paste0('', "plot_", 'paper44', ".png")
ggsave(filename = file_name, plot = p, dpi=888)
Saving 5.43 x 3.35 in image
studies_with_u16 <- stop %>%
filter(Mean.age < 25) %>%
distinct(Study.Name)
studies_with_varied_ages <- stop %>%
group_by(Study.Name, Test.Type) %>%
summarise(
num_effect_sizes = n_distinct(d),
varied_ages = n_distinct(Mean.age) > 2,
.groups = 'drop'
) %>%
filter(num_effect_sizes > 2 & varied_ages)
studies_with_varied_ages
NA
lol <- stop %>% filter(Study.Name %in% studies_with_varied_ages$Study.Name & !(Link=='https://sci-hub.ru/10.1037/0033-2909.117.2.250'))
Studies with segregated ages, controls for ability tested
metaobj <- metafor::rma(yi=d, sei=se, data=lol, mods = ~ Mean.age + Ability + Female.ratio + year)
summary(metaobj)
Mixed-Effects Model (k = 410; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
145.4102 -290.8204 -242.8204 -147.8182 -239.5055
tau^2 (estimated amount of residual heterogeneity): 0.0229 (SE = 0.0019)
tau (square root of estimated tau^2 value): 0.1515
I^2 (residual heterogeneity / unaccounted variability): 98.69%
H^2 (unaccounted variability / sampling variability): 76.13
R^2 (amount of heterogeneity accounted for): 59.37%
Test for Residual Heterogeneity:
QE(df = 387) = 9658.7861, p-val < .0001
Test of Moderators (coefficients 2:23):
QM(df = 22) = 532.6204, p-val < .0001
Model Results:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
metaobj$se
[1] 0.93784565 0.00056150 0.09937718 0.06641718 0.07740142
[6] 0.09540297 0.07348333 0.06916548 0.07971824 0.08287636
[11] 0.07232961 0.07449221 0.08135837 0.08969291 0.09935281
[16] 0.07397075 0.09045642 0.07657246 0.08909914 0.07541319
[21] 0.07698338 0.30089769 0.00045226
metaobj$beta
[,1]
intrcpt 2.57207087
Mean.age 0.00074471
AbilityCommon Sense 0.02963548
AbilityFull Scale -0.05446028
AbilityGeneral Knowledge 0.34067264
AbilityMathematical Knowledge -0.14036633
AbilityMathematics 0.15461600
AbilityMatrices 0.00489700
AbilityMechanical Reasoning 0.36567912
AbilityMemory -0.26780394
AbilityNonverbal -0.00924835
AbilityProcessing Speed -0.34912845
AbilityReading -0.19949589
AbilityScholastic 0.07547225
AbilitySimilarities -0.09180721
AbilitySpatial 0.24880412
AbilitySpelling -0.21261940
AbilityTechnical Knowledge 0.44808134
AbilityUnknown -0.02901205
AbilityVerbal -0.11115988
AbilityVocabulary -0.02068954
Female.ratio 1.08085017
year -0.00154366
Studies with segregated ages, no controls for ability tested
metaobj2 <- metafor::rma(yi=d, sei=se, data=lol, mods = ~ Mean.age + Female.ratio + year)
summary(metaobj2)
Mixed-Effects Model (k = 410; tau^2 estimator: REML)
logLik deviance AIC BIC AICc
-3.3117 6.6234 16.6234 36.6551 16.7734
tau^2 (estimated amount of residual heterogeneity): 0.0561 (SE = 0.0042)
tau (square root of estimated tau^2 value): 0.2368
I^2 (residual heterogeneity / unaccounted variability): 99.53%
H^2 (unaccounted variability / sampling variability): 214.64
R^2 (amount of heterogeneity accounted for): 0.74%
Test for Residual Heterogeneity:
QE(df = 406) = 186772.0643, p-val < .0001
Test of Moderators (coefficients 2:4):
QM(df = 3) = 6.6536, p-val = 0.0838
Model Results:
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
metaobj2$se
[1] 1.15093282 0.00076198 0.41979156 0.00057070
metaobj2$beta
[,1]
intrcpt 1.845781214
Mean.age -0.000047166
Female.ratio 0.756458985
year -0.001087136
##################
h <- stop %>% filter(Ability=='Full Scale' & Children.==0) %>% group_by(Test.Quality) %>% summarise(meand = mean(d, na.rm=T))
h
zxc2 <- full_join(zxc, iqresults, by='alpha3') %>% select(c, NIQ, alpha3, s, r, m , i)
cor.test(zxc2$c, zxc2$NIQ)
Pearson's product-moment correlation
data: zxc2$c and zxc2$NIQ
t = 3.22, df = 85, p-value = 0.0018
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.12771 0.50508
sample estimates:
cor
0.32949
cor(zxc2 %>% select(-alpha3), use='pairwise.complete.obs')
c NIQ s r m i
c 1.00000 0.329493 0.96712 0.80586 0.92180 0.154959
NIQ 0.32949 1.000000 0.37495 0.10672 0.29847 -0.039901
s 0.96712 0.374955 1.00000 0.83349 0.87175 0.405955
r 0.80586 0.106723 0.83349 1.00000 0.72014 0.454848
m 0.92180 0.298467 0.87175 0.72014 1.00000 0.449774
i 0.15496 -0.039901 0.40595 0.45485 0.44977 1.000000
p <- GG_scatter(zxc2, 'NIQ', 'c', case_names = 'alpha3') +
xlab('National IQ') +
ylab('Sex Difference in PISA tests') +
theme(
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title.x = element_text(size = 14),
axis.title.y = element_text(size = 14)
)
p
file_name <- paste0('', "plot_", 'paper6', ".png")
ggsave(filename = file_name, plot = p, dpi=400, bg = 'white')
Saving 5.43 x 3.35 in image
#####################################
world_map <- map_data("world")
world_map$alpha3 <- countrycode(world_map$region, origin = "country.name", destination = "iso3c")
Warning: Some values were not matched unambiguously: Ascension Island, Azores, Barbuda, Bonaire, Canary Islands, Chagos Archipelago, Grenadines, Heard Island, Kosovo, Madeira Islands, Micronesia, Saba, Saint Martin, Siachen Glacier, Sint Eustatius, Virgin Islands
world_map_data <- full_join(world_map, zxc2, by = c('alpha3'))
bpm <- world_map_data %>% distinct(alpha3, .keep_all = TRUE)
bpm2 <- bpm %>% filter(!is.na(long) & !is.na(lat) & !is.na(c)) %>% select(c, NIQ, alpha3, long, lat)
neighbors <- kNN(bpm2 %>% select(-alpha3), k = 3)
bpm2$cspatial <- NA
for (i in 1:nrow(bpm2)) {
av1 <- bpm2$c[neighbors$id[i, 1]]
av2 <- bpm2$c[neighbors$id[i, 2]]
av3 <- bpm2$c[neighbors$id[i, 3]]
bpm2$cspatial[i] <- (av1 + av2 + av3)/3
}
GG_scatter(bpm2, 'cspatial', 'c', case_names='alpha3')
lr <- lm(data=bpm2, c ~ NIQ + cspatial)
summary(lr)
Call:
lm(formula = c ~ NIQ + cspatial, data = bpm2)
Residuals:
Min 1Q Median 3Q Max
-0.4990 -0.0411 0.0198 0.0647 0.2481
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.42072 0.15839 -2.66 0.0095 **
NIQ 0.00384 0.00168 2.29 0.0245 *
cspatial 0.50073 0.11034 4.54 0.000019 ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.123 on 82 degrees of freedom
Multiple R-squared: 0.286, Adjusted R-squared: 0.268
F-statistic: 16.4 on 2 and 82 DF, p-value: 0.00000103
###########
unique(stop$Ability)
[1] "Matrices"
[2] "Full Scale"
[3] "Memory"
[4] "Knowledge Of Animals"
[5] "Mathematics"
[6] "Sequences"
[7] "Attention"
[8] "Nonverbal"
[9] "Verbal"
[10] "Mechanical Reasoning"
[11] "Spatial"
[12] "Scholastic"
[13] "Similarities"
[14] "Verbal-Numerical Reasoning"
[15] "Vocabulary"
[16] "Reading"
[17] "Processing Speed"
[18] "General Knowledge"
[19] "Technical Knowledge"
[20] "Mathematical Knowledge"
[21] "Scientific Knowledge"
[22] "Spelling"
[23] "Common Sense"
[24] "Unknown"
[25] "Writing"
[26] "Scientific Literacy"
[27] "Mathematical Literacy"
[28] "Biological Knowledge"
[29] "Musical Knowledge"
[30] "Historical Knowledge"
[31] "Entertainment Knowledge"
[32] "International Knowledge"
[33] "Literary Knowledge"
[34] "Medical Knowledge"
[35] "Political Knowledge"
[36] "Sporting Knowledge"
[37] "Artistic Knowledge"
[38] "Cooking Knowledge"
[39] "Aesthetic Knowledge"
[40] "Film Knowledge"
[41] "Financial Knowledge"
[42] "Psychological Knowledge"