Library

library(formr)
library(effects)
## Lade nötiges Paket: carData
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
library(effectsize)
library(lme4)
## Lade nötiges Paket: Matrix
library(sjstats)
## 
## Attache Paket: 'sjstats'
## Die folgenden Objekte sind maskiert von 'package:effectsize':
## 
##     cohens_f, cramers_v, phi
library(lmerTest)
## 
## Attache Paket: 'lmerTest'
## Das folgende Objekt ist maskiert 'package:lme4':
## 
##     lmer
## Das folgende Objekt ist maskiert 'package:stats':
## 
##     step
library(ggplot2)
library(tidyr)
## 
## Attache Paket: 'tidyr'
## Die folgenden Objekte sind maskiert von 'package:Matrix':
## 
##     expand, pack, unpack
library(ggpubr)
library(RColorBrewer)
library(coefplot)
library(tibble)
library(purrr) # for running multiple regression
library(broom)
## 
## Attache Paket: 'broom'
## Das folgende Objekt ist maskiert 'package:sjstats':
## 
##     bootstrap
library(mvmeta)
## This is mvmeta 1.0.3. For an overview type: help('mvmeta-package').
library(lm.beta)
library(dplyr)
## 
## Attache Paket: 'dplyr'
## Die folgenden Objekte sind maskiert von 'package:formr':
## 
##     first, last
## Die folgenden Objekte sind maskiert von 'package:stats':
## 
##     filter, lag
## Die folgenden Objekte sind maskiert von 'package:base':
## 
##     intersect, setdiff, setequal, union
library(stringr)
library(tidyr)
library(knitr)
library(countrycode)

apatheme = theme_bw() +
  theme(panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        panel.border = element_blank(),
        axis.line = element_line(),
        legend.title = element_blank(),
        plot.title = element_text(hjust = 0.5))

Data

Load selected data based on 03_codebook

data_included_documented = read.csv(file = "data_included_documented.csv")[,-1]

Inclusion of Data

data_included_documented <- data_included_documented %>%
  mutate(region1 = countrycode(country,
                                 origin = "country.name",
                                 destination = "region"),
         region1 = ifelse(country == "Micronesia",
                            "East Asia and Pacific",
                            region1),
         region2 = countrycode(country,
                                 origin = "country.name",
                                 destination = "continent"),
         region2 = ifelse(country == "Micronesia",
                            "Oceania",
                            region2))
## Warning: There were 2 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `region1 = countrycode(country, origin = "country.name",
##   destination = "region")`.
## Caused by warning:
## ! Some values were not matched unambiguously: Micronesia
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 1 remaining warning.
table(data_included_documented$region1)
## 
##        East Asia & Pacific      East Asia and Pacific 
##                        674                          1 
##      Europe & Central Asia  Latin America & Caribbean 
##                       7441                       3325 
## Middle East & North Africa              North America 
##                         90                       1592 
##                 South Asia         Sub-Saharan Africa 
##                         59                         75
table(data_included_documented$region2)
## 
##   Africa Americas     Asia   Europe  Oceania 
##      108     4917      645     7417      170
data_included_documented = data_included_documented %>%
  mutate(region_final = ifelse(region2 == "Africa", "Africa",
                                  ifelse(region2 == "Asia", "Asia",
                                         ifelse(region2 == "Europe", "Europe",
                           ifelse(region2 == "Oceania", "Oceania",
                                  ifelse(region1 == "Latin America & Caribbean",
                                         "Latin and South America",
                                         ifelse(region1 == "North America",
                                                "North America", NA)))))))

data_included_documented <- data_included_documented %>%
  mutate(region_final = ifelse(country %in% c("Afghanistan", "Bahrain", "Iran",
                                                 "Iraq", "Israel", "Jordan", 
                                                 "Kazakhstan", "Kuwait", "Kyrgyzstan",
                                                 "Lebanon", "Pakistan", 
                                                 "Palestinian Territories", "Qatar",
                                                 "Saudi Arabia", "Syria", 
                                                 "Turkey", "Turkmenistan",
                                                 "United Arab Emirates", "Indonesia"),
                                  "Middle East and Central Asia", region_final),
         region_final = ifelse(country %in% c("Armenia", "Burma",
                                                 "China",
                                                 "East Timor (see Timor-Leste)", 
                                                 "Georgia", "Hong Kong", "India",
                                                 "Japan", "Malaysia", "Maldives",
                                                 "Nepal", "Philippines", "Singapore",
                                                 "South Korea", "Sri Lanka", 
                                                 "Taiwan", "Thailand", "Vietnam"), 
                                  "South and East Asia", region_final))

x <- data_included_documented %>% 
  select(country, region_final) %>%
  group_by(country, region_final) %>%
  summarize(n = n()) %>%
  arrange(region_final, country)
## `summarise()` has grouped output by 'country'. You can override using the
## `.groups` argument.
write.csv2(x, file = "country_regions.csv")

regions <- x %>%
  group_by(region_final) %>%
  summarize(countries = n(),
            participants = sum(n))

regions
## # A tibble: 7 × 3
##   region_final                 countries participants
##   <chr>                            <int>        <int>
## 1 Africa                              26          108
## 2 Europe                              41         7417
## 3 Latin and South America             33         3325
## 4 Middle East and Central Asia        19          103
## 5 North America                        2         1592
## 6 Oceania                              5          170
## 7 South and East Asia                 18          542

We will include all regions with more than 500 participants. This allows us to show effect sizes for a diverse range of regions.

These regions include the following countries (n)

Europe included 41 countries: France (n = 2,013); Germany (n = 1,846); Italy (n = 968); Spain (n = 562); United Kingdom (n = 499); Denmark (n = 395); Switzerland (n = 280); Austria (n = 197); Russia (n = 155); Belgium (n = 102); Ireland (n = 59); Portugal (n = 51); Netherlands (n = 44); Finland (n = 31); Sweden (n = 27); Romania (n = 24); Ukraine (n = 21); Belarus (n = 13); Luxembourg (n = 13); Estonia (n = 12); Norway (n = 12); Czechia (n = 11); Bulgaria (n = 9); Hungary (n = 9); Latvia (n = 8); Poland (n = 7); Andorra (n = 6); Bosnia and Herzegovina (n = 6); Croatia (n = 6); Iceland (n = 5); Serbia (n = 5); Greece (n = 4); Lithuania (n = 3); Slovakia (n = 3); Slovenia (n = 3); Albania (n = 2); Malta (n = 2); Liechtenstein (n = 1); Macedonia (n = 1); Monaco (n = 1); and Montenegro (n = 1).

Latin and South America included 33 countries: Mexico (n = 1157); Brazil (n = 806); Colombia (n = 387); Argentina (n = 217); Chile (n = 154); Peru (n = 119); Ecuador (n = 102); Venezuela (n = 67); Guatemala (n = 61); Costa Rica (n = 47); Dominican Republic (n = 41); El Salvador (n = 26); Uruguay (n = 24); Bolivia (n = 23); Honduras (n = 18); Nicaragua (n = 15); Panama (n = 15); Paraguay (n = 11); Trinidad and Tobago (n = 8); Jamaica (n = 6); Haiti (n = 4); Guyana (n = 3); Antigua and Barbuda (n = 2); Dominica (n = 2); Saint Lucia (n = 2); Aruba (n = 1); Bahamas (n = 1); Barbados (n = 1); Belize (n = 1); Cuba (n = 1); Grenada (n = 1); Saint Vincent and the Grenadines (n = 1); and Sint Maarten (n = 1).

North America included 2 countries: United States of America (n = 1254) and Canada (n = 338).

South and East Asia included 18 countries: Japan (n = 290); China (n = 90); India (n = 45); Philippines (n = 36); Singapore (n = 26); Malaysia (n = 17); Hong Kong (n = 8); Taiwan (n = 7); South Korea (n = 5); Thailand (n = 4); Georgia (n = 3); Sri Lanka (n = 3); Armenia (n = 2); Vietnam (n = 2); Burma (n = 1); East Timor (n = 1); Maldives (n = 1); and Nepal (n = 1).

Oceania included 5 countries: Australia (n = 133); New Zealand (n = 34); Fiji (n = 1); Marshall Islands (n = 1); and Micronesia (n = 1).

Africa included 26 countries: South Africa (n = 29); Morocco (n = 16); Algeria (n = 7); Tunisia (n = 7); Kenya (n = 6); Nigeria (n = 6); Senegal (n = 5); Namibia (n = 4); Cameroon (n = 3); Egypt (n = 3); Ghana (n = 3); Benin (n = 2); Central African Republic (n = 2); Mali (n = 2); Mauritius (n = 2); Botswana (n = 1); Cote d’Ivoire (n = 1); Ethiopia (n = 1); Guinea-Bissau (n = 1); Madagascar (n = 1); Mauritania (n = 1); South Sudan (n = 1); Swaziland (n = 1); Tanzania (n = 1); Uganda (n = 1); and Zimbabwe (n = 1).

Middle East and Central Asia included 19 countries: Indonesia (n = 18); United Arab Emirates (n = 14); Israel (n = 13); Kazakhstan (n = 9); Pakistan (n = 8); Turkey (n = 8); Iran (n = 7); Saudi Arabia (n = 6); Bahrain (n = 3); Lebanon (n = 3); Jordan (n = 2); Kyrgyzstan (n = 2); Palestinian Territories (n = 2); Qatar (n = 2); Turkmenistan (n = 2); Afghanistan (n = 1); Iraq (n = 1); Kuwait (n = 1); and Syria (n = 1).

We investigated how effects of political orientation on partner preferences differed between four different regions. Namely, these were Europe (n = 7,417), Latin and South America (n = 3,325), North America (n = 1,592), and South and East Asia (n = 542). We could not include Oceania (n = 170), Africa (n = 108), and Middle East and Central Asia (n = 103) because sample sizes were too small (n < 500) to reach any conclusions.

regions = regions %>% filter(participants > 500)
data_included_documented_reg = data_included_documented %>%
  filter(region_final %in% regions$region_final)
regions_reg =
  data_included_documented_reg %>%
  select(region_final, country) %>%
  table() %>%
  as.data.frame() %>%
  filter(Freq != 0) %>%
  arrange(-Freq)


regions_reg
## # A tibble: 94 × 3
##    region_final            country                   Freq
##    <fct>                   <fct>                    <int>
##  1 Europe                  France                    2013
##  2 Europe                  Germany                   1846
##  3 North America           United States of America  1254
##  4 Latin and South America Mexico                    1157
##  5 Europe                  Italy                      968
##  6 Latin and South America Brazil                     806
##  7 Europe                  Spain                      562
##  8 Europe                  United Kingdom             499
##  9 Europe                  Denmark                    395
## 10 Latin and South America Colombia                   387
## # ℹ 84 more rows

Analyses

Political, Ethnic, and Religious Similarity

H1a Preference for Similarity in Political Beliefs
H1a(1) Linear Effect
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_politicalsim, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_politicalsim = data_included_documented_reg_wide %>%
  select(-pref_politicalsim) %>%
  map(~lm(scale(data_included_documented_reg_wide$pref_politicalsim) ~ scale(.x),
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_politicalsim_lin_coef = models_pref_politicalsim %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname == "scale(.x)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_politicalsim_lin_se = models_pref_politicalsim %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_politicalsim_lin_analyses = left_join(models_pref_politicalsim_lin_coef,
                                            models_pref_politicalsim_lin_se,
                                            by = "name") %>%
  mutate(outcome = "H2a) Prefered Political Similarity - Linear Effect")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_politicalsim)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_politicalsim_lin_analyses$n = countries_reg$Freq
data_included_documented_reg %>% filter(!is.na(pref_politicalsim)) %>% nrow()
## [1] 12574
model = mvmeta(mean ~ 1, data = models_pref_politicalsim_lin_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_politicalsim_lin_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error         z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)   -0.1146      0.0087  -13.1769    0.0000   -0.1316   -0.0975  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 48.8327 (df = 3), p-value = 0.0000
## I-square statistic = 93.9%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##   logLik       AIC       BIC  
## -12.6385   27.2770   26.6633
H1a(2) Quadratic Effect: Regression 1 (x <= breaking_point)
data_included_documented_reg_wide_reg1 = data_included_documented_reg %>%
  dplyr::filter(political_orientation <= 3) %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_politicalsim, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_politicalsim_reg1 = data_included_documented_reg_wide_reg1 %>%
  select(-pref_politicalsim) %>%
  map(~lm(scale(data_included_documented_reg_wide_reg1$pref_politicalsim) ~
            scale(.x),
          data = data_included_documented_reg_wide_reg1)) %>%
  map(lm.beta)

models_pref_politicalsim_quad_coef_reg1 = models_pref_politicalsim_reg1 %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname == "scale(.x)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)


models_pref_politicalsim_quad_se_reg1 = models_pref_politicalsim_reg1 %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_politicalsim_quad_analyses_reg1 = left_join(models_pref_politicalsim_quad_coef_reg1,
                                            models_pref_politicalsim_quad_se_reg1,
                                            by = "name") %>%
  mutate(outcome = "H2a(1)) Preferred Political Similarity - Quadratic Effect Regression 1")

models_pref_politicalsim_quad_analyses_reg1$n = countries_reg$Freq

data_included_documented_reg %>% filter(political_orientation <= 3, !is.na(pref_politicalsim)) %>% nrow()
## [1] 10318
model = mvmeta(mean ~ 1, data = models_pref_politicalsim_quad_analyses_reg1, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_politicalsim_quad_analyses_reg1, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error         z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)   -0.2573      0.0093  -27.5273    0.0000   -0.2757   -0.2390  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 12.6538 (df = 3), p-value = 0.0054
## I-square statistic = 76.3%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
##  5.1275  -8.2551  -8.8688
H1a(2) Quadratic Effect: Regression 2 (x >= breaking_point)
data_included_documented_reg_wide_reg2 = data_included_documented_reg %>%
  dplyr::filter(political_orientation >= 3) %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_politicalsim, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_politicalsim_reg2 = data_included_documented_reg_wide_reg2 %>%
  select(-pref_politicalsim) %>%
  map(~lm(scale(data_included_documented_reg_wide_reg2$pref_politicalsim) ~
            scale(.x),
          data = data_included_documented_reg_wide_reg2)) %>%
  map(lm.beta)

models_pref_politicalsim_quad_coef_reg2 = models_pref_politicalsim_reg2 %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname == "scale(.x)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)


models_pref_politicalsim_quad_se_reg2 = models_pref_politicalsim_reg1 %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_politicalsim_quad_analyses_reg2 = left_join(models_pref_politicalsim_quad_coef_reg2,
                                            models_pref_politicalsim_quad_se_reg2,
                                            by = "name") %>%
  mutate(outcome = "H2a(1)) Preferred Political Similarity - Quadratic Effect Regression 2")

models_pref_politicalsim_quad_analyses_reg2$n = countries_reg$Freq

data_included_documented_reg %>% filter(political_orientation >= 3, !is.na(pref_politicalsim)) %>% nrow()
## [1] 7139
model = mvmeta(mean ~ 1, data = models_pref_politicalsim_quad_analyses_reg2, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_politicalsim_quad_analyses_reg2, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.2017      0.0093  21.5717    0.0000    0.1833    0.2200  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 32.0230 (df = 3), p-value = 0.0000
## I-square statistic = 90.6%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
## -4.5570  11.1141  10.5004
H1b Preference for Similarity in Ethnicity/Race
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_ethnicalsim, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_ethnicalsim = data_included_documented_reg_wide %>%
  select(-pref_ethnicalsim) %>%
  map(~lm(data_included_documented_reg_wide$pref_ethnicalsim ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_ethnicalsim_coef = models_pref_ethnicalsim %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_ethnicalsim_se = models_pref_ethnicalsim %>%
 map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_ethnicalsim_analyses = left_join(models_pref_ethnicalsim_coef,
                                            models_pref_ethnicalsim_se,
                                            by = "name") %>%
  mutate(outcome = "H2b) Preferred Ethnic Similarity")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_ethnicalsim)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_ethnicalsim_analyses$n = countries_reg$Freq
sum(models_pref_ethnicalsim_analyses$n)
## [1] 8394
model = mvmeta(mean ~ 1, data = models_pref_ethnicalsim_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_ethnicalsim_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.1553      0.0118  13.1363    0.0000    0.1321    0.1785  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 22.8516 (df = 3), p-value = 0.0000
## I-square statistic = 86.9%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
## -1.1326   4.2652   3.6515
H1c Preference for Similarity in Religion
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_religioussim, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_religioussim = data_included_documented_reg_wide %>%
  select(-pref_religioussim) %>%
  map(~lm(data_included_documented_reg_wide$pref_religioussim ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_religioussim_coef = models_pref_religioussim %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_religioussim_se = models_pref_religioussim %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_religioussim_analyses = left_join(models_pref_religioussim_coef,
                                            models_pref_religioussim_se,
                                            by = "name") %>%
  mutate(outcome = "H2c) Preferred Religious Similarity")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_religioussim)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_religioussim_analyses$n = countries_reg$Freq
sum(models_pref_religioussim_analyses$n)
## [1] 12561
model = mvmeta(mean ~ 1, data = models_pref_religioussim_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_religioussim_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error       z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.1197      0.0143  8.3861    0.0000    0.0917    0.1476  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 6.9915 (df = 3), p-value = 0.0722
## I-square statistic = 57.1%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##   logLik       AIC       BIC  
##   6.1681  -10.3362  -10.9499

Ideal Partner Preferences

H2a Preference for the Level of Financial Security- Successfulness
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_level_financially_secure_successful_ambitious, Europe, 'South and East Asia', 'Latin and South America',
         'North America')

models_pref_level_financially_secure_successful_ambitious = data_included_documented_reg_wide %>%
  select(-pref_level_financially_secure_successful_ambitious) %>%
  map(~lm(data_included_documented_reg_wide$pref_level_financially_secure_successful_ambitious ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_level_financially_secure_successful_ambitious_coef = models_pref_level_financially_secure_successful_ambitious %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_level_financially_secure_successful_ambitious_se = models_pref_level_financially_secure_successful_ambitious %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))

models_pref_level_financially_secure_successful_ambitious_analyses = left_join(models_pref_level_financially_secure_successful_ambitious_coef,
                                            models_pref_level_financially_secure_successful_ambitious_se,
                                            by = "name") %>%
  mutate(outcome = "H3a) Financial Security-Successfulness")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_level_financially_secure_successful_ambitious)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_level_financially_secure_successful_ambitious_analyses$n = countries_reg$Freq
sum(models_pref_level_financially_secure_successful_ambitious_analyses$n)
## [1] 12183
model = mvmeta(mean ~ 1, data = models_pref_level_financially_secure_successful_ambitious_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_level_financially_secure_successful_ambitious_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.1402      0.0058  24.2049    0.0000    0.1288    0.1516  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 20.0226 (df = 3), p-value = 0.0002
## I-square statistic = 85.0%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
##  3.2386  -4.4772  -5.0909
H2b Preference for the Level of Confidence-Assertiveness
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_level_confident_assertive, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_level_confident_assertive = data_included_documented_reg_wide %>%
  select(-pref_level_confident_assertive) %>%
  map(~lm(data_included_documented_reg_wide$pref_level_confident_assertive ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_level_confident_assertive_coef = models_pref_level_confident_assertive %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_level_confident_assertive_se = models_pref_level_confident_assertive %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_level_confident_assertive_analyses = left_join(models_pref_level_confident_assertive_coef,
                                            models_pref_level_confident_assertive_se,
                                            by = "name") %>%
  mutate(outcome = "H3d) Confidence-Assertiveness")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_level_confident_assertive)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_level_confident_assertive_analyses$n = countries_reg$Freq
sum(models_pref_level_confident_assertive_analyses$n)
## [1] 12325
model = mvmeta(mean ~ 1, data = models_pref_level_confident_assertive_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_level_confident_assertive_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.0838      0.0052  16.0304    0.0000    0.0736    0.0941  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 39.8036 (df = 3), p-value = 0.0000
## I-square statistic = 92.5%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
## -6.2581  14.5161  13.9024
H2c Preference for the Level of Education-Intelligence
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_level_intelligence_educated, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_level_intelligence_educated = data_included_documented_reg_wide %>%
  select(-pref_level_intelligence_educated) %>%
  map(~lm(data_included_documented_reg_wide$pref_level_intelligence_educated ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_level_intelligence_educated_coef = models_pref_level_intelligence_educated %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_level_intelligence_educated_se = models_pref_level_intelligence_educated %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_level_intelligence_educated_analyses = left_join(models_pref_level_intelligence_educated_coef,
                                            models_pref_level_intelligence_educated_se,
                                            by = "name") %>%
  mutate(outcome = "H3e) Education-Intelligence")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_level_intelligence_educated)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_level_intelligence_educated_analyses$n = countries_reg$Freq
sum(models_pref_level_intelligence_educated_analyses$n)
## [1] 12354
model = mvmeta(mean ~ 1, data = models_pref_level_intelligence_educated_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_level_intelligence_educated_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error       z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.0316      0.0053  5.9355    0.0000    0.0211    0.0420  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 57.7990 (df = 3), p-value = 0.0000
## I-square statistic = 94.8%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##   logLik       AIC       BIC  
## -15.3288   32.6576   32.0439
H2d Preference for the Level of Kindness-Supportiveness
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_level_kind_supportive, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_level_kind_supportive = data_included_documented_reg_wide %>%
  select(-pref_level_kind_supportive) %>%
  map(~lm(data_included_documented_reg_wide$pref_level_kind_supportive ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_level_kind_supportive_coef = models_pref_level_kind_supportive %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_level_kind_supportive_se = models_pref_level_kind_supportive %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_level_kind_supportive_analyses = left_join(models_pref_level_kind_supportive_coef,
                                            models_pref_level_kind_supportive_se,
                                            by = "name") %>%
  mutate(outcome = "H3b) Kindness-Supportiveness")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_level_kind_supportive)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_level_kind_supportive_analyses$n = countries_reg$Freq
sum(models_pref_level_kind_supportive_analyses$n)
## [1] 12359
model = mvmeta(mean ~ 1, data = models_pref_level_kind_supportive_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_level_kind_supportive_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error       z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.0275      0.0046  6.0045    0.0000    0.0186    0.0365  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 22.5497 (df = 3), p-value = 0.0001
## I-square statistic = 86.7%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
##  2.8106  -3.6212  -4.2349
H2e Preference for the Level of Attractiveness
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(pref_level_attractiveness, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_pref_level_attractiveness = data_included_documented_reg_wide %>%
  select(-pref_level_attractiveness) %>%
  map(~lm(data_included_documented_reg_wide$pref_level_attractiveness ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_pref_level_attractiveness_coef = models_pref_level_attractiveness %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_pref_level_attractiveness_se = models_pref_level_attractiveness %>%
 map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_pref_level_attractiveness_analyses = left_join(models_pref_level_attractiveness_coef,
                                            models_pref_level_attractiveness_se,
                                            by = "name") %>%
  mutate(outcome = "H3c) Attractiveness")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(pref_level_attractiveness)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_pref_level_attractiveness_analyses$n = countries_reg$Freq
sum(models_pref_level_attractiveness_analyses$n)
## [1] 12160
model = mvmeta(mean ~ 1, data = models_pref_level_attractiveness_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_pref_level_attractiveness_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.0669      0.0061  10.9552    0.0000    0.0549    0.0788  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 28.1503 (df = 3), p-value = 0.0000
## I-square statistic = 89.3%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
## -1.0840   4.1680   3.5543

Ideal Age and Height

H3a(1) Ideal Age (Importance)
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(imp_age, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_imp_age = data_included_documented_reg_wide %>%
  select(-imp_age) %>%
  map(~lm(data_included_documented_reg_wide$imp_age ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_imp_age_coef = models_imp_age %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_imp_age_se = models_imp_age %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_imp_age_analyses = left_join(models_imp_age_coef,
                                            models_imp_age_se,
                                            by = "name") %>%
  mutate(outcome = "H4a(1)) Ideal Age (Importance)")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(imp_age)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_imp_age_analyses$n = countries_reg$Freq
sum(models_imp_age_analyses$n)
## [1] 12735
model = mvmeta(mean ~ 1, data = models_imp_age_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_imp_age_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error       z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.0855      0.0092  9.2870    0.0000    0.0675    0.1036  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 3.4451 (df = 3), p-value = 0.3279
## I-square statistic = 12.9%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##   logLik       AIC       BIC  
##   9.6023  -17.2046  -17.8183
H3a(2) Ideal Age (Level)
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(ideal_age_rel, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_ideal_age_rel = data_included_documented_reg_wide %>%
  select(-ideal_age_rel) %>%
  map(~lm(data_included_documented_reg_wide$ideal_age_rel ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_ideal_age_rel_coef = models_ideal_age_rel %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_ideal_age_rel_se = models_ideal_age_rel %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_ideal_age_rel_analyses = left_join(models_ideal_age_rel_coef,
                                            models_ideal_age_rel_se,
                                            by = "name") %>%
  mutate(outcome = "H4a(2)) Ideal Age (Level)")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(ideal_age_rel)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_ideal_age_rel_analyses$n = countries_reg$Freq
sum(models_ideal_age_rel_analyses$n)
## [1] 11699
model = mvmeta(mean ~ 1, data = models_ideal_age_rel_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_ideal_age_rel_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error       z  Pr(>|z|)  95%ci.lb  95%ci.ub   
## (Intercept)    0.0092      0.0203  0.4541    0.6497   -0.0306    0.0491   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 0.4564 (df = 3), p-value = 0.9284
## I-square statistic = 1.0%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##   logLik       AIC       BIC  
##   7.8754  -13.7507  -14.3645
H3b(1) Ideal Height (Importance)
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(imp_height, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_imp_height = data_included_documented_reg_wide %>%
  select(-imp_height) %>%
  map(~lm(data_included_documented_reg_wide$imp_height ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_imp_height_coef = models_imp_height %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_imp_height_se = models_imp_height %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_imp_height_analyses = left_join(models_imp_height_coef,
                                            models_imp_height_se,
                                            by = "name") %>%
  mutate(outcome = "H4b(1)) Ideal Height (Importance)")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(imp_height)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_imp_height_analyses$n = countries_reg$Freq
sum(models_imp_height_analyses$n)
## [1] 12650
model = mvmeta(mean ~ 1, data = models_imp_height_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_imp_height_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error        z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.1151      0.0097  11.9081    0.0000    0.0962    0.1341  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 12.3750 (df = 3), p-value = 0.0062
## I-square statistic = 75.8%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##  logLik      AIC      BIC  
##  4.9179  -7.8358  -8.4495
H3b(2) Ideal Height (Level)
data_included_documented_reg_wide = data_included_documented_reg %>%
  pivot_wider(names_from = region_final, values_from = political_orientation) %>%
  select(ideal_height, Europe, 'South and East Asia', 'Latin and South America', 'North America')

models_ideal_height = data_included_documented_reg_wide %>%
  select(-ideal_height) %>%
  map(~lm(data_included_documented_reg_wide$ideal_height ~ .x,
      data = data_included_documented_reg_wide)) %>%
  map(lm.beta)

models_ideal_height_coef = models_ideal_height %>%
  map(coef) %>%
  as.data.frame() %>%
  rownames_to_column(var = "rowname") %>%
  filter(rowname != "(Intercept)") %>%
  pivot_longer(cols = -rowname) %>%
  select(-rowname) %>%
  rename(mean = value)

models_ideal_height_se = models_ideal_height %>%
  map(tidy) %>%
  tibble(models_pref_politicalsim_lin_se = ., Names = names(.)) %>%
  hoist(models_pref_politicalsim_lin_se, coefficients = "std.error") %>%
  select(-models_pref_politicalsim_lin_se) %>%
  unnest_wider(., coefficients, names_sep = "_") %>%
  select(coefficients_2, Names) %>%
  rename("name" = "Names",
         "se" = "coefficients_2") %>%
  mutate(name = ifelse(name == "South and East Asia",
                       "South.and.East.Asia",
                       ifelse(name == "Latin and South America",
                       "Latin.and.South.America",
                       ifelse(name == "North America",
                       "North.America",
                       name))))


models_ideal_height_analyses = left_join(models_ideal_height_coef,
                                            models_ideal_height_se,
                                            by = "name") %>%
  mutate(outcome = "H4b(2)) Ideal Height (Level)")

countries_reg =
  data_included_documented_reg %>%
  filter(!is.na(ideal_height)) %>%
  select(region_final) %>%
  table() %>%
  as.data.frame() %>%
  arrange(-Freq)

models_ideal_height_analyses$n = countries_reg$Freq
sum(models_ideal_height_analyses$n)
## [1] 12158
model = mvmeta(mean ~ 1, data = models_ideal_height_analyses, S = se^2,
               method = "fixed")
summary(model)
## Call:  mvmeta(formula = mean ~ 1, S = se^2, data = models_ideal_height_analyses, 
##     method = "fixed")
## 
## Univariate fixed-effects meta-analysis
## Dimension: 1
## 
## Fixed-effects coefficients
##              Estimate  Std. Error       z  Pr(>|z|)  95%ci.lb  95%ci.ub     
## (Intercept)    0.0110      0.0029  3.7530    0.0002    0.0053    0.0168  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Univariate Cochran Q-test for heterogeneity:
## Q = 61.3516 (df = 3), p-value = 0.0000
## I-square statistic = 95.1%
## 
## 4 studies, 4 observations, 1 fixed and 0 random-effects parameters
##   logLik       AIC       BIC  
## -14.7521   31.5043   30.8906
LS0tDQp0aXRsZTogPGZvbnQgY29sb3I9IiM2NkMyQTUiPkV4cGxvcmF0b3J5IEFuYWx5c2VzIFJlZ2lvbnM8L2ZvbnQ+DQpjc2w6IGFwYS1jdXN0b20tbm8taXNzdWUuY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nRpdGxlID0gZWxlbWVudF90ZXh0KGhqdXN0ID0gMC41KSkNCmBgYA0KDQojIyMgRGF0YQ0KTG9hZCBzZWxlY3RlZCBkYXRhIGJhc2VkIG9uIDAzX2NvZGVib29rDQpgYGB7cn0NCmRhdGFfaW5jbHVkZWRfZG9jdW1lbnRlZCA9IHJlYWQuY3N2KGZpbGUgPSAiZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkLmNzdiIpWywtMV0NCmBgYA0KDQojIyMgSW5jbHVzaW9uIG9mIERhdGENCmBgYHtyfQ0KZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkIDwtIGRhdGFfaW5jbHVkZWRfZG9jdW1lbnRlZCAlPiUNCiAgbXV0YXRlKHJlZ2lvbjEgPSBjb3VudHJ5Y29kZShjb3VudHJ5LA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luID0gImNvdW50cnkubmFtZSIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbiA9ICJyZWdpb24iKSwNCiAgICAgICAgIHJlZ2lvbjEgPSBpZmVsc2UoY291bnRyeSA9PSAiTWljcm9uZXNpYSIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVhc3QgQXNpYSBhbmQgUGFjaWZpYyIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9uMSksDQogICAgICAgICByZWdpb24yID0gY291bnRyeWNvZGUoY291bnRyeSwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbiA9ICJjb3VudHJ5Lm5hbWUiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdGluYXRpb24gPSAiY29udGluZW50IiksDQogICAgICAgICByZWdpb24yID0gaWZlbHNlKGNvdW50cnkgPT0gIk1pY3JvbmVzaWEiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICJPY2VhbmlhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpb24yKSkNCg0KdGFibGUoZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkJHJlZ2lvbjEpDQp0YWJsZShkYXRhX2luY2x1ZGVkX2RvY3VtZW50ZWQkcmVnaW9uMikNCg0KZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkID0gZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkICU+JQ0KICBtdXRhdGUocmVnaW9uX2ZpbmFsID0gaWZlbHNlKHJlZ2lvbjIgPT0gIkFmcmljYSIsICJBZnJpY2EiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmZWxzZShyZWdpb24yID09ICJBc2lhIiwgIkFzaWEiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZmVsc2UocmVnaW9uMiA9PSAiRXVyb3BlIiwgIkV1cm9wZSIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICBpZmVsc2UocmVnaW9uMiA9PSAiT2NlYW5pYSIsICJPY2VhbmlhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZmVsc2UocmVnaW9uMSA9PSAiTGF0aW4gQW1lcmljYSAmIENhcmliYmVhbiIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJMYXRpbiBhbmQgU291dGggQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmZWxzZShyZWdpb24xID09ICJOb3J0aCBBbWVyaWNhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOb3J0aCBBbWVyaWNhIiwgTkEpKSkpKSkpDQoNCmRhdGFfaW5jbHVkZWRfZG9jdW1lbnRlZCA8LSBkYXRhX2luY2x1ZGVkX2RvY3VtZW50ZWQgJT4lDQogIG11dGF0ZShyZWdpb25fZmluYWwgPSBpZmVsc2UoY291bnRyeSAlaW4lIGMoIkFmZ2hhbmlzdGFuIiwgIkJhaHJhaW4iLCAiSXJhbiIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIklyYXEiLCAiSXNyYWVsIiwgIkpvcmRhbiIsIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJLYXpha2hzdGFuIiwgIkt1d2FpdCIsICJLeXJneXpzdGFuIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTGViYW5vbiIsICJQYWtpc3RhbiIsIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJQYWxlc3RpbmlhbiBUZXJyaXRvcmllcyIsICJRYXRhciIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNhdWRpIEFyYWJpYSIsICJTeXJpYSIsIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJUdXJrZXkiLCAiVHVya21lbmlzdGFuIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5pdGVkIEFyYWIgRW1pcmF0ZXMiLCAiSW5kb25lc2lhIiksDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk1pZGRsZSBFYXN0IGFuZCBDZW50cmFsIEFzaWEiLCByZWdpb25fZmluYWwpLA0KICAgICAgICAgcmVnaW9uX2ZpbmFsID0gaWZlbHNlKGNvdW50cnkgJWluJSBjKCJBcm1lbmlhIiwgIkJ1cm1hIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ2hpbmEiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJFYXN0IFRpbW9yIChzZWUgVGltb3ItTGVzdGUpIiwgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkdlb3JnaWEiLCAiSG9uZyBLb25nIiwgIkluZGlhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSmFwYW4iLCAiTWFsYXlzaWEiLCAiTWFsZGl2ZXMiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZXBhbCIsICJQaGlsaXBwaW5lcyIsICJTaW5nYXBvcmUiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJTb3V0aCBLb3JlYSIsICJTcmkgTGFua2EiLCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVGFpd2FuIiwgIlRoYWlsYW5kIiwgIlZpZXRuYW0iKSwgDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlNvdXRoIGFuZCBFYXN0IEFzaWEiLCByZWdpb25fZmluYWwpKQ0KDQp4IDwtIGRhdGFfaW5jbHVkZWRfZG9jdW1lbnRlZCAlPiUgDQogIHNlbGVjdChjb3VudHJ5LCByZWdpb25fZmluYWwpICU+JQ0KICBncm91cF9ieShjb3VudHJ5LCByZWdpb25fZmluYWwpICU+JQ0KICBzdW1tYXJpemUobiA9IG4oKSkgJT4lDQogIGFycmFuZ2UocmVnaW9uX2ZpbmFsLCBjb3VudHJ5KQ0KDQp3cml0ZS5jc3YyKHgsIGZpbGUgPSAiY291bnRyeV9yZWdpb25zLmNzdiIpDQoNCnJlZ2lvbnMgPC0geCAlPiUNCiAgZ3JvdXBfYnkocmVnaW9uX2ZpbmFsKSAlPiUNCiAgc3VtbWFyaXplKGNvdW50cmllcyA9IG4oKSwNCiAgICAgICAgICAgIHBhcnRpY2lwYW50cyA9IHN1bShuKSkNCg0KcmVnaW9ucw0KYGBgDQpXZSB3aWxsIGluY2x1ZGUgYWxsIHJlZ2lvbnMgd2l0aCBtb3JlIHRoYW4gNTAwIHBhcn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AgaG9pc3QobW9kZWxzX3ByZWZfcG9saXRpY2Fsc2ltX2xpbl9zZSwgY29lZmZpY2llbnRzID0gInN0ZC5lcnJvciIpICU+JQ0KICBzZWxlY3QoLW1vZGVsc19wcmVmX3BvbGl0aWNhbHNpbV9saW5fc2UpICU+JQ0KICB1bm5lc3Rfd2lkZXIoLiwgY29lZmZpY2llbnRzLCBuYW1lc19zZXAgPSAiXyIpICU+JQ0KICBzZWxlY3QoY29lZmZpY2llbnRzXzIsIE5hbWVzKSAlPiUNCiAgcmVuYW1lKCJuYW1lIiA9ICJOYW1lcyIsDQogICAgICAgICAic2UiID0gImNvZWZmaWNpZW50c18yIikgJT4lDQogIG11dGF0ZShuYW1lID0gaWZlbHNlKG5hbWUgPT0gIlNvdXRoIGFuZCBFYXN0IEFzaWEiLA0KICAgICAgICAgICAgICAgICAgICAgICAiU291dGguYW5kLkVhc3QuQXNpYSIsDQogICAgICAgICAgICAgICAgICAgICAgIGlmZWxzZShuYW1lID09ICJMYXRpbiBhbmQgU291dGggQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgICJMYXRpbi5hbmQuU291dGguQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgIGlmZWxzZShuYW1lID09ICJOb3J0aCBBbWVyaWNhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgIk5vcnRoLkFtZXJpY2EiLA0KICAgICAgICAgICAgICAgICAgICAgICBuYW1lKSkpKQ0KDQoNCm1vZGVsc19wcmVmX3JlbGlnaW91c3NpbV9hbmFseXNlcyA9IGxlZnRfam9pbihtb2RlbHNfcHJlZl9yZWxpZ2lvdXNzaW1fY29lZiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxzX3ByZWZfcmVsaWdpb3Vzc2ltX3NlLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJuYW1lIikgJT4lDQogIG11dGF0ZShvdXRjb21lID0g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gaWZlbHNlKG5hbWUgPT0gIlNvdXRoIGFuZCBFYXN0IEFzaWEiLA0KICAgICAgICAgICAgICAgICAgICAgICAiU291dGguYW5kLkVhc3QuQXNpYSIsDQogICAgICAgICAgICAgICAgICAgICAgIGlmZWxzZShuYW1lID09ICJMYXRpbiBhbmQgU291dGggQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgICJMYXRpbi5hbmQuU291dGguQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgIGlmZWxzZShuYW1lID09ICJOb3J0aCBBbWVyaWNhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgIk5vcnRoLkFtZXJpY2EiLA0KICAgICAgICAgICAgICAgICAgICAgICBuYW1lKSkpKQ0KDQoNCm1vZGVsc19wcmVmX2xldmVsX2F0dHJhY3RpdmVuZXNzX2FuYWx5c2VzID0gbGVmdF9qb2luKG1vZGVsc19wcmVmX2xldmVsX2F0dHJhY3RpdmVuZXNzX2NvZWYsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsc19wcmVmX2xldmVsX2F0dHJhY3RpdmVuZXNzX3NlLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieSA9ICJuYW1lIikgJT4lDQogIG11dGF0ZShvdXRjb21lID0gIkgzYykgQXR0cmFjdGl2ZW5lc3MiKQ0KDQpjb3VudHJpZXNfcmVnID0NCiAgZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkX3JlZyAlPiUNCiAgZmlsdGVyKCFpcy5uYShwcmVmX2xldmVsX2F0dHJhY3RpdmVuZXNzKSkgJT4lDQogIHNlbGVjdChyZWdpb25fZmluYWwpICU+JQ0KICB0YWJsZSgpICU+JQ0KICBhcy5kYXRhLmZyYW1lKCkgJT4lDQogIGFycmFuZ2UoLUZyZXEpDQoNCm1vZGVsc19wcmVmX2xldmVsX2F0dHJhY3RpdmVuZXNzX2FuYWx5c2VzJG4gPSBjb3Vud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B0aWJibGUobW9kZWxzX3ByZWZfcG9saXRpY2Fsc2ltX2xpbl9zZSA9IC4sIE5hbWVzID0gbmFtZXMoLikpICU+JQ0KICBob2lzdChtb2RlbHNfcHJlZl9wb2xpdGljYWxzaW1fbGluX3NlLCBjb2VmZmljaWVudHMgPSAic3RkLmVycm9yIikgJT4lDQogIHNlbGVjdCgtbW9kZWxzX3ByZWZfcG9saXRpY2Fsc2ltX2xpbl9zZSkgJT4lDQogIHVubmVzdF93aWRlciguLCBjb2VmZmljaWVudHMsIG5hbWVzX3NlcCA9ICJfIikgJT4lDQogIHNlbGVjdChjb2VmZmljaWVudHNfMiwgTmFtZXMpICU+JQ0KICByZW5hbWUoIm5hbWUiID0gIk5hbWVzIiwNCiAgICAgICAgICJzZSIgPSAiY29lZmZpY2llbnRzXzIiKSAlPiUNCiAgbXV0YXRlKG5hbWUgPSBpZmVsc2UobmFtZSA9PSAiU291dGggYW5kIEVhc3QgQXNpYSIsDQogICAgICAgICAgICAgICAgICAgICAgICJTb3V0aC5hbmQuRWFzdC5Bc2lhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgaWZlbHNlKG5hbWUgPT0gIkxhdGluIGFuZCBTb3V0aCBBbWVyaWNhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgIkxhdGluLmFuZC5Tb3V0aC5BbWVyaWNhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgaWZlbHNlKG5hbWUgPT0gIk5vcnRoIEFtZXJpY2EiLA0KICAgICAgICAgICAgICAgICAgICAgICAiTm9ydGguQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgIG5hbWUpKSkpDQoNCg0KbW9kZWxzX2lkZWFsX2FnZV9yZWxfYW5hbHlzZXMgPSBsZWZ0X2pvaW4obW9kZWxzX2lkZWFsX2FnZV9yZWxfY29lZiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxzX2lkZWFsX2FnZV9yZWxfc2UsDQogICAgICA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ZmaWNpZW50c18yLCBOYW1lcykgJT4lDQogIHJlbmFtZSgibmFtZSIgPSAiTmFtZXMiLA0KICAgICAgICAgInNlIiA9ICJjb2VmZmljaWVudHNfMiIpICU+JQ0KICBtdXRhdGUobmFtZSA9IGlmZWxzZShuYW1lID09ICJTb3V0aCBhbmQgRWFzdCBBc2lhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgIlNvdXRoLmFuZC5FYXN0LkFzaWEiLA0KICAgICAgICAgICAgICAgICAgICAgICBpZmVsc2UobmFtZSA9PSAiTGF0aW4gYW5kIFNvdXRoIEFtZXJpY2EiLA0KICAgICAgICAgICAgICAgICAgICAgICAiTGF0aW4uYW5kLlNvdXRoLkFtZXJpY2EiLA0KICAgICAgICAgICAgICAgICAgICAgICBpZmVsc2UobmFtZSA9PSAiTm9ydGggQW1lcmljYSIsDQogICAgICAgICAgICAgICAgICAgICAgICJOb3J0aC5BbWVyaWNhIiwNCiAgICAgICAgICAgICAgICAgICAgICAgbmFtZSkpKSkNCg0KDQptb2RlbHNfaW1wX2hlaWdodF9hbmFseXNlcyA9IGxlZnRfam9pbihtb2RlbHNfaW1wX2hlaWdodF9jb2VmLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbHNfaW1wX2hlaWdodF9zZSwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnkgPSAibmFtZSIpICU+JQ0KICBtdXRhdGUob3V0Y29tZSA9ICJINGIoMSkpIElkZWFsIEhlaWdodCAoSW1wb3J0YW5jZSkiKQ0KDQpjb3VudHJpZXNfcmVnID0NCiAgZGF0YV9pbmNsdWRlZF9kb2N1bWVudGVkX3JlZyAlPiUNCiAgZmlsdGVyKCFpcy5uYShpbXBfaGVpZ2h0KSkgJT4lDQogIHNlbGVjdChyZWdpb25fZmluYWwpICU+JQ0KICB0YWJsZSgpICU+JQ0KICBhcy5kYXRhLmZyYW1lKCkgJT4lDQogIGFycmFuZ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