knitr::opts_chunk$set(echo = TRUE)

library(tidyverse)
library(haven)
library(dplyr)
library(psych)
library(DT)
# library(knitr)
library(openxlsx)
library(expss)

library(psych)
library(likert)
library(careless)
library(corrplot)

library(survey) # analyze survey with weights
library(srvyr) 

library(knitr)

library(readr)
library(lavaan)

library(qualtRics)
library(corrplot)
library(sem)
library(semPlot)
library(semPower)

library(lavaan)
library(GPArotation)
library(lme4)
library(ggplot2)

library(tidyr)
library(RColorBrewer)

#set working directory & load data set
setwd("~/Google Drive/My Drive/CircEUlar/WP4/WP4 Survey")
d <- read_sav("Circular Consumption Survey_updated.sav") # create extra columns for open-ended questions, though response labels are preserved

As the data set includes many variables that are not relevant for the current RQ, we will create a new data set with only the relevant variables.

#data set with only columns relevant for the analysis
#dR <- subset(d, select = c(37:40, 149:152, 154:157, 159:162, 258:261, 263:266, 268:271, 295:261, 263:266, 268:271, 295:297, 299:301, 303:306, 308, 309))

dR <- subset(d, select = c("country", "gender", "birthyear", "educ_UK", "educ_NL", "educ_DE", "educ_IT", "educ_LT", "hhincome", "bio_val", "alt_val", "ego_val", "hed_val", "ccb_gov", "ccb_busi", "ccb_cit", "ccb_se", "ccb_oe", "ccb_pn", "ccb_pa", "ccb_ar", "pweight"))

Sample descriptives

dR$age <- 2024 - dR$birthyear

#For continuous variables:

# Age - Mean and SD
age_per_country <- dR %>%
  group_by(country) %>%
  summarise(
    mean_age = mean(age, na.rm = TRUE),  # Mean age
    sd_age = sd(age, na.rm = TRUE)       # Standard deviation of age
  )
print(age_per_country)
## # A tibble: 5 × 3
##   country            mean_age sd_age
##   <dbl+lbl>             <dbl>  <dbl>
## 1 1 [United Kingdom]     48.3   18.0
## 2 2 [Germany]            51.3   16.3
## 3 3 [Netherlands]        48.9   17.7
## 4 4 [Italy]              50.9   17.5
## 5 5 [Lithuania]          48.0   17.5
hist(dR$age, 
     main="Age of participants",    
     xlab="Year of birth",    
     ylab="Amount of people",          
     col="lightblue",               
     border="black")

Countries: 1 = United Kingdom 2 = Germany 3 = The Netherlands 4 = Italy 5 = Lithuania

#For categorical variables:

#country
table(dR$country)
## 
##    1    2    3    4    5 
## 1053 1100 1081 1409 1008
#gender distribution per country 
table(dR$country, dR$gender)
##    
##       1   2
##   1 519 534
##   2 536 564
##   3 535 546
##   4 694 715
##   5 462 546
# education
dR$educ_group_UK <- cut(dR$educ_UK, breaks=c(-1, 2, 4, 8), labels = c("0-2", "3-4", "5-8"))
dR$educ_group_DE <- cut(dR$educ_DE, breaks=c(-1, 3, 5, 8), labels = c("0-3", "4-5", "6-8"))
dR$educ_group_NL <- cut(dR$educ_NL, breaks=c(-1, 2, 4, 8), labels = c("0-2", "3-4", "5-8"))
dR$educ_group_IT <- cut(dR$educ_IT, breaks=c(-1, 2, 4, 8), labels = c("0-2", "3-4", "5-8"))
dR$educ_group_LT <- cut(dR$educ_LT, breaks=c(-1, 2, 4, 8), labels = c("0-2", "3-4", "5-8"))

tab <- data.frame(
  UK = as.numeric(prop.table(table(d$educ_group_UK)) * 100),
  DE = as.numeric(prop.table(table(d$educ_group_DE)) * 100),
  NL = as.numeric(prop.table(table(d$educ_group_NL)) * 100),
  IT = as.numeric(prop.table(table(d$educ_group_IT)) * 100),
  LT = as.numeric(prop.table(table(d$educ_group_LT)) * 100)
)
## Warning: Unknown or uninitialised column: `educ_group_UK`.
## Warning: Unknown or uninitialised column: `educ_group_DE`.
## Warning: Unknown or uninitialised column: `educ_group_NL`.
## Warning: Unknown or uninitialised column: `educ_group_IT`.
## Warning: Unknown or uninitialised column: `educ_group_LT`.
#rownames(tab) <- c("0-2", "3-4", "5-8")
round(tab, 1)
## [1] UK DE NL IT LT
## <0 rows> (or 0-length row.names)
tab
## [1] UK DE NL IT LT
## <0 rows> (or 0-length row.names)
#household income per country
table(dR$country, dR$hhincome)
##    
##       1   2   3   4   5   6   7   8   9  10  11
##   1  44  83 146 148 118  95  99  44  95  64 117
##   2  16  49 106 122 123 131 111 111 126 108  97
##   3  27  32  73  98 134 157 152  88 148 101  71
##   4  71  96 239 275 211 167 142  70  84  28  26
##   5 149 229 239 155  99  57  27  13  17   7  16

gender: 1 male 2 female 3 diverse 99 prefer not to say

Rename model variables (and code so that higher numbers is stronger agreement/engagement)

Descriptives of model variables

describeBy(dR[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
## Warning in describeBy(dR[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", : no
## grouping variable requested
##      vars    n mean   sd median trimmed  mad min max range  skew kurtosis   se
## bio     1 5651 4.84 1.80      5    5.00 1.48   1   7     6 -0.52    -0.76 0.02
## alt     2 5651 4.90 1.83      5    5.07 1.48   1   7     6 -0.61    -0.74 0.02
## hed     3 5651 4.75 1.82      5    4.88 1.48   1   7     6 -0.46    -0.85 0.02
## ego     4 5651 3.84 1.68      4    3.84 1.48   1   7     6  0.06    -0.73 0.02
## pa      5 5651 4.38 1.76      4    4.46 1.48   1   7     6 -0.29    -0.74 0.02
## ar      6 5651 3.90 1.75      4    3.91 1.48   1   7     6 -0.07    -0.85 0.02
## se      7 5651 3.66 1.71      4    3.64 1.48   1   7     6  0.01    -0.80 0.02
## oe      8 5651 3.69 1.71      4    3.67 1.48   1   7     6 -0.02    -0.78 0.02
## pn      9 5651 3.51 1.75      4    3.45 1.48   1   7     6  0.12    -0.88 0.02
## gov    10 5651 3.09 1.82      3    2.93 2.97   1   7     6  0.39    -0.91 0.02
## busi   11 5651 3.06 1.80      3    2.90 2.97   1   7     6  0.38    -0.90 0.02
## ind    12 5651 3.44 1.79      4    3.36 1.48   1   7     6  0.13    -0.96 0.02
summary(dR[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
##       bio             alt             hed             ego       
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:4.000   1st Qu.:3.000   1st Qu.:3.000  
##  Median :5.000   Median :5.000   Median :5.000   Median :4.000  
##  Mean   :4.843   Mean   :4.902   Mean   :4.748   Mean   :3.844  
##  3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:6.000   3rd Qu.:5.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##        pa              ar              se              oe       
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:3.000   1st Qu.:2.000   1st Qu.:2.000  
##  Median :4.000   Median :4.000   Median :4.000   Median :4.000  
##  Mean   :4.377   Mean   :3.902   Mean   :3.662   Mean   :3.692  
##  3rd Qu.:6.000   3rd Qu.:5.000   3rd Qu.:5.000   3rd Qu.:5.000  
##  Max.   :7.000   Max.   :7.000   Max.   :7.000   Max.   :7.000  
##        pn             gov            busi            ind       
##  Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.000   1st Qu.:1.00   1st Qu.:1.000   1st Qu.:2.000  
##  Median :4.000   Median :3.00   Median :3.000   Median :4.000  
##  Mean   :3.514   Mean   :3.09   Mean   :3.062   Mean   :3.441  
##  3rd Qu.:5.000   3rd Qu.:4.00   3rd Qu.:4.000   3rd Qu.:5.000  
##  Max.   :7.000   Max.   :7.00   Max.   :7.000   Max.   :7.000
std_devs <- sapply(dR[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")], sd, na.rm = TRUE)
print(std_devs)
##      bio      alt      hed      ego       pa       ar       se       oe 
## 1.800941 1.827367 1.815965 1.676475 1.759294 1.754855 1.708616 1.712705 
##       pn      gov     busi      ind 
## 1.751646 1.816225 1.798300 1.788116

Histograms of model variables for all countries together

# Biospheric values
hist(dR$bio, 
     main = "Distribution of Scores", 
     xlab = "Biospheric values", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Altruistic values
hist(dR$alt, 
     main = "Distribution of Scores", 
     xlab = "Altruistic values", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Hedonic values
hist(dR$hed, 
     main = "Distribution of Scores", 
     xlab = "Hedonic values", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Egoistic values
hist(dR$ego, 
     main = "Distribution of Scores", 
     xlab = "Egoistic values", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Problem awareness
hist(dR$pa, 
     main = "Distribution of Scores", 
     xlab = "Problem awareness", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Ascription of responsibility
hist(dR$ar, 
     main = "Distribution of Scores", 
     xlab = "Ascription of Responsibility", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Self-efficacy
hist(dR$se, 
     main = "Distribution of Scores", 
     xlab = "Self-efficacy", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Outcome efficacy
hist(dR$oe, 
     main = "Distribution of Scores", 
     xlab = "Outcome efficacy", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

# Personal norms
hist(dR$pn, 
     main = "Distribution of Scores", 
     xlab = "Outcome efficacy", 
     ylab = "Frequency", 
     col = "lightblue", 
     border = "black")

Figure with overview over all means, sd per variable, per country

dR_reduced <- subset(dR, select = c("country", "bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind"))


# Reshape the data to long format
dR_long <- dR_reduced %>%
  pivot_longer(-country, names_to = "variable", values_to = "value")
dR_long
## # A tibble: 67,812 × 3
##    country     variable value
##    <dbl+lbl>   <chr>    <dbl>
##  1 2 [Germany] bio          7
##  2 2 [Germany] alt          6
##  3 2 [Germany] hed          6
##  4 2 [Germany] ego          3
##  5 2 [Germany] pa           6
##  6 2 [Germany] ar           6
##  7 2 [Germany] se           5
##  8 2 [Germany] oe           4
##  9 2 [Germany] pn           5
## 10 2 [Germany] gov          5
## # ℹ 67,802 more rows
dR_long$country <- as.factor(dR_long$country)
dR_long$variable <- as.factor(dR_long$variable)

dR_long <- dR_long %>%
  mutate(variable = factor(variable, 
                           levels = c("ind", "busi", "gov", "pn", "oe", "se", "ar", "pa", "ego", "hed", "alt","bio"), 
                           labels = c("CCBs aimed at other individuals", "CCBs aimed at businesses", "CCBs aimed at governments", "Personal norms", "Outcome efficacy", "Self-efficacy", "Ascription of responsibility", "Problem awareness", "Egoistic values", "Hedonic values", "Altruistic values", "Biospheric values")))

variables_m_sd <- ggplot(dR_long) +
  aes(x = value, y = variable, colour = country, fill = country) +
  stat_summary(fun = mean, geom = "point", size = 3, position = position_dodge(width = 0.5)) +  # Mean as points
  stat_summary(fun.data = mean_sdl, fun.args = list(mult = 1), 
               geom = "errorbar", width = 0.2, position = position_dodge(width = 0.5)) +  # SD as error bars
    scale_colour_manual(values = rev(brewer.pal(n = 5, name = "Dark2"))) +
  labs(
    x = "means ± SD",                       # Rename x-axis
    y = "variable",           # Rename y-axis
    colour = "country",       # Rename colour legend
    fill = "country"
  ) +
  #legend ...
  theme_bw()

variables_m_sd 

# Export as PDF
#pdf("Figure variables and M, SD.pdf", width = 8, height = 12)

Testing country differences in the extended VBN variables

library(effectsize)
## 
## Attaching package: 'effectsize'
## The following object is masked from 'package:xtable':
## 
##     display
## The following object is masked from 'package:psych':
## 
##     phi
aov_bio <- aov(bio ~ country, data = dR)
summary(aov_bio)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        1    282  282.28   88.38 <2e-16 ***
## Residuals   5649  18043    3.19                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_alt <- aov(alt ~ country, data = dR)
summary(aov_alt)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        1    327   327.4   99.76 <2e-16 ***
## Residuals   5649  18539     3.3                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_hed <- aov(hed ~ country, data = dR)
summary(aov_hed)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        1    586   586.3   183.5 <2e-16 ***
## Residuals   5649  18046     3.2                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_ego <- aov(ego ~ country, data = dR)
summary(aov_ego)
##               Df Sum Sq Mean Sq F value Pr(>F)  
## country        1     10  10.151   3.614 0.0574 .
## Residuals   5649  15870   2.809                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_pa <- aov(pa ~ country, data = dR)
summary(aov_pa)
##               Df Sum Sq Mean Sq F value Pr(>F)
## country        1      7   7.275   2.351  0.125
## Residuals   5649  17480   3.094
aov_ar <- aov(ar ~ country, data = dR)
summary(aov_ar)
##               Df Sum Sq Mean Sq F value  Pr(>F)   
## country        1     27  27.377   8.902 0.00286 **
## Residuals   5649  17372   3.075                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_se <- aov(se ~ country, data = dR)
summary(aov_se)
##               Df Sum Sq Mean Sq F value Pr(>F)
## country        1      1   1.147   0.393  0.531
## Residuals   5649  16493   2.920
aov_oe <- aov(oe ~ country, data = dR)
summary(aov_oe)
##               Df Sum Sq Mean Sq F value   Pr(>F)    
## country        1     36   35.82   12.23 0.000473 ***
## Residuals   5649  16538    2.93                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_pn <- aov(pn ~ country, data = dR)
summary(aov_pn)
##               Df Sum Sq Mean Sq F value   Pr(>F)    
## country        1     56   55.97    18.3 1.92e-05 ***
## Residuals   5649  17280    3.06                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Effect sizes (η² for ANOVA)
library(effectsize)
eta_squared(aov_bio)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter | Eta2 |       95% CI
## -------------------------------
## country   | 0.02 | [0.01, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_alt)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter | Eta2 |       95% CI
## -------------------------------
## country   | 0.02 | [0.01, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_hed)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter | Eta2 |       95% CI
## -------------------------------
## country   | 0.03 | [0.02, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_ego)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter |     Eta2 |       95% CI
## -----------------------------------
## country   | 6.39e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_pa)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter |     Eta2 |       95% CI
## -----------------------------------
## country   | 4.16e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_ar)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter |     Eta2 |       95% CI
## -----------------------------------
## country   | 1.57e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_se)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter |     Eta2 |       95% CI
## -----------------------------------
## country   | 6.95e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_oe)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter |     Eta2 |       95% CI
## -----------------------------------
## country   | 2.16e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_pn)
## For one-way between subjects designs, partial eta squared is equivalent
##   to eta squared. Returning eta squared.
## # Effect Size for ANOVA
## 
## Parameter |     Eta2 |       95% CI
## -----------------------------------
## country   | 3.23e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

Results from anova: For all variables there are significant country differences.

Results from effect sizes: The effect sizes are very small to small.

Engagement in CCBs

Descriptives for CCBs

#overall
describe(dR$gov)
##    vars    n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 5651 3.09 1.82      3    2.93 2.97   1   7     6 0.39    -0.91 0.02
describe(dR$busi)
##    vars    n mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 5651 3.06 1.8      3     2.9 2.97   1   7     6 0.38     -0.9 0.02
describe(dR$ind)
##    vars    n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 5651 3.44 1.79      4    3.36 1.48   1   7     6 0.13    -0.96 0.02
table(dR$gov)/5651
## 
##          1          2          3          4          5          6          7 
## 0.29800035 0.13625907 0.12174836 0.22031499 0.11502389 0.06299770 0.04565564
table(dR$busi)/5651
## 
##          1          2          3          4          5          6          7 
## 0.30578659 0.12900372 0.12015572 0.22987082 0.11502389 0.05821978 0.04193948
table(dR$ind)/5651
## 
##          1          2          3          4          5          6          7 
## 0.21748363 0.12050964 0.13165811 0.24898248 0.14793842 0.08210936 0.05131835
#per country
dR <- dR %>%
  mutate(country = case_when(
    country == 1 ~ "United Kingdom",
    country == 2 ~ "Germany",
    country == 3 ~ "Netherlands",
    country == 4 ~ "Italy",
    country == 5 ~ "Lithuania",
    TRUE ~ as.character(country)  # fallback for unmatched values
  ))
print(dR %>%
  group_by(country) %>%
  summarise(
    mean_ccb_gov = mean(gov, na.rm = TRUE),
    sd_ccb_gov = sd(gov, na.rm = TRUE),
    mean_ccb_busi = mean(busi, na.rm = TRUE),
    sd_ccb_busi = sd(busi, na.rm = TRUE),
    mean_ccb_ind = mean(ind, na.rm = TRUE),
    sd_ccb_ind = sd(ind, na.rm = TRUE)
  ))
## # A tibble: 5 × 7
##   country        mean_ccb_gov sd_ccb_gov mean_ccb_busi sd_ccb_busi mean_ccb_ind
##   <chr>                 <dbl>      <dbl>         <dbl>       <dbl>        <dbl>
## 1 Germany                2.96       1.86          2.84        1.80         3.10
## 2 Italy                  3.18       1.74          3.14        1.71         3.75
## 3 Lithuania              3.53       1.75          3.66        1.75         3.94
## 4 Netherlands            2.50       1.63          2.54        1.62         2.75
## 5 United Kingdom         3.29       1.94          3.15        1.94         3.60
## # ℹ 1 more variable: sd_ccb_ind <dbl>

Distributions of CCBs for all countries together

# Reshape data to long format for the 3 variables
dR_long <- dR %>%
  pivot_longer(
    cols = c(gov, busi, ind),
    names_to = "variable",
    values_to = "value")

# Rename variable labels for nicer x-axis
dR_long$variable <- factor(dR_long$variable, 
                          levels = c("gov", "busi", "ind"),
                          labels = c("Governments", "Businesses", "Other individuals"))

# Plot all countries pooled, with violins and boxplots by variable
ccb_plot <- ggplot(dR_long, aes(x = variable, y = value, fill = variable)) +
  geom_violin(trim = FALSE, alpha = 0.6) +
  geom_boxplot(width = 0.1, outlier.size = 0.5, color = "black") +
  scale_fill_manual(values = rev(brewer.pal(n = 4, name = "YlGnBu"))) +
  scale_y_continuous(
    breaks = 0:8,  # full scale breaks (adjust if needed)
    labels = c(" ", "(1) Never", "(2)", "(3)", "(4)", "(5)", "(6)", "(7) Frequently", "")
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),  # remove minor grid lines
    text = element_text(color = "black"),  # make all text black
    axis.text = element_text(color = "black"),  # explicitly make axis text black
    axis.title = element_text(color = "black"),  # axis titles black
    plot.title = element_text(color = "black", hjust = 0.5),  # title black and centered
    legend.text = element_text(color = "black"),  # legend text black (if legend shown)
    legend.title = element_text(color = "black")  # legend title black
  ) +
  labs(title = "Distribution of CCBs for different actors (all countries pooled)",
       x = "CCBs aimed at",
       y = "Freuquency of engagement") +
  theme(axis.text.x = element_text(angle = 30, vjust = 0.7, hjust = 0.8),
        legend.position = "none",
        plot.title = element_text(hjust = 0.5))

ccb_plot

ggsave("ccb_plot.png", plot = ccb_plot, width = 10, height = 6, dpi = 300)

Country differences in CCB engagement

library(lsr)

aov_gov <- aov(gov ~ country, data = dR)
summary(aov_gov)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        4    648  161.97   50.84 <2e-16 ***
## Residuals   5646  17990    3.19                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(aov_gov)
##            eta.sq eta.sq.part
## country 0.0347626   0.0347626
aov_busi <- aov(busi ~ country, data = dR)
summary(aov_busi)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        4    719  179.79   57.83 <2e-16 ***
## Residuals   5646  17552    3.11                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(aov_busi)
##             eta.sq eta.sq.part
## country 0.03936066  0.03936066
aov_ind <- aov(ind ~ country, data = dR)
summary(aov_ind)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        4   1050  262.60   87.14 <2e-16 ***
## Residuals   5646  17015    3.01                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
etaSquared(aov_ind)
##             eta.sq eta.sq.part
## country 0.05814637  0.05814637

Distributions of CCBs per country

CCBs aimed at governments

ccb_gov_plot <- ggplot(dR, aes(x = country, y = gov, fill = country)) +
  geom_violin(trim = FALSE, alpha = 0.6) +
  geom_boxplot(width = 0.1, outlier.size = 0.5, color = "black") +
  scale_fill_manual(values = rev(brewer.pal(n = 5, name = "Dark2"))) + 
  theme_minimal() +
  scale_y_continuous(
    breaks = 0:8,  # full scale breaks (adjust if needed)
    labels = c(" ", "(1) Never", "(2)", "(3)", "(4)", "(5)", "(6)", "(7) Frequently", "")
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),  # remove minor grid lines
    text = element_text(color = "black"),  # make all text black
    axis.text = element_text(color = "black"),  # explicitly make axis text black
    axis.title = element_text(color = "black"),  # axis titles black
    plot.title = element_text(color = "black", hjust = 0.5),  # title black and centered
    legend.text = element_text(color = "black"),  # legend text black (if legend shown)
    legend.title = element_text(color = "black")  # legend title black
  ) +
  labs(title = "Distribution of CCBs aimed at governments by country",
       x = "Country",
       y = "Frequency of engagement") +
  theme(axis.text.x = element_text(angle = 30, vjust = 0.5, hjust=1),
        legend.position = "none",
        plot.title = element_text(hjust = 0.5))
ccb_gov_plot

ggsave("ccb_gov_plot.png", plot = ccb_gov_plot, width = 10, height = 6, dpi = 300)

CCBs aimed at businesses

ccb_busi_plot <- ggplot(dR, aes(x = country, y = busi, fill = country)) +
  geom_violin(trim = FALSE, alpha = 0.6) +
  geom_boxplot(width = 0.1, outlier.size = 0.5, color = "black") +
  scale_fill_manual(values = rev(brewer.pal(n = 5, name = "Dark2"))) + 
  theme_minimal() +
  scale_y_continuous(
    breaks = 0:8,  # full scale breaks (adjust if needed)
    labels = c(" ", "(1) Never", "(2)", "(3)", "(4)", "(5)", "(6)", "(7) Frequently", "")
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),  # remove minor grid lines
    text = element_text(color = "black"),  # make all text black
    axis.text = element_text(color = "black"),  # explicitly make axis text black
    axis.title = element_text(color = "black"),  # axis titles black
    plot.title = element_text(color = "black", hjust = 0.5),  # title black and centered
    legend.text = element_text(color = "black"),  # legend text black (if legend shown)
    legend.title = element_text(color = "black")  # legend title black
  ) +
  labs(title = "Distribution of CCBs aimed at businesses by country",
       x = "Country",
       y = "Frequency of engagement") +
  theme(axis.text.x = element_text(angle = 30, vjust = 0.5, hjust=1),
        legend.position = "none",
        plot.title = element_text(hjust = 0.5))
ccb_busi_plot

ggsave("ccb_busi_plot.png", plot = ccb_busi_plot, width = 10, height = 6, dpi = 300)

CCBs aimed at other individuals

ccb_ind_plot <- ggplot(dR, aes(x = country, y = ind, fill = country)) +
  geom_violin(trim = FALSE, alpha = 0.6) +
  geom_boxplot(width = 0.1, outlier.size = 0.5, color = "black") +
  scale_fill_manual(values = rev(brewer.pal(n = 5, name = "Dark2"))) + 
  theme_minimal() +
  scale_y_continuous(
    breaks = 0:8,  
    labels = c(" ", "(1) Never", "(2)", "(3)", "(4)", "(5)", "(6)", "(7) Frequently", "")
  ) +
  theme_minimal() +
  theme(
    panel.grid.minor = element_blank(),  # remove minor grid lines
    text = element_text(color = "black"),  # make all text black
    axis.text = element_text(color = "black"),  # explicitly make axis text black
    axis.title = element_text(color = "black"),  # axis titles black
    plot.title = element_text(color = "black", hjust = 0.5),  # title black and centered
    legend.text = element_text(color = "black"),  # legend text black (if legend shown)
    legend.title = element_text(color = "black")  # legend title black
  ) +
  labs(title = "Distribution of CCBs aimed at other individuals by country",
       x = "Country",
       y = "Frequency of engagement") +
  theme(axis.text.x = element_text(angle = 30, vjust = 0.5, hjust=1),
        legend.position = "none",
        plot.title = element_text(hjust = 0.5))
ccb_ind_plot

ggsave("ccb_ind_plot.png", plot = ccb_ind_plot, width = 10, height = 6, dpi = 300)

Testing differences between different CCBs

There is a significant difference between the means of CCBs aimed at individuals versus CCBs aimed at governments or businesses. However, the effect sizes are negligible to small.

library(afex)
## ************
## Welcome to afex. For support visit: http://afex.singmann.science/
## - Functions for ANOVAs: aov_car(), aov_ez(), and aov_4()
## - Methods for calculating p-values with mixed(): 'S', 'KR', 'LRT', and 'PB'
## - 'afex_aov' and 'mixed' objects can be passed to emmeans() for follow-up tests
## - Get and set global package options with: afex_options()
## - Set sum-to-zero contrasts globally: set_sum_contrasts()
## - For example analyses see: browseVignettes("afex")
## ************
## 
## Attaching package: 'afex'
## The following object is masked from 'package:lme4':
## 
##     lmer
library(emmeans)
## Welcome to emmeans.
## Caution: You lose important information if you filter this package's results.
## See '? untidy'
library(effectsize)
library(effsize)
## 
## Attaching package: 'effsize'
## The following object is masked from 'package:psych':
## 
##     cohen.d
#Sig. test for means of CCBs
dR_long <- dR %>%
  dplyr::select(id, gov, busi, ind) %>%
  tidyr::pivot_longer(cols = c(gov, busi, ind), names_to = "CCB_type", values_to = "value")

#checking for sig. differences between CCBs
aov_res <- aov_ez(id = "id", dv = "value", within = "CCB_type", data = dR_long)
summary(aov_res)
## 
## Univariate Type III Repeated-Measures ANOVA Assuming Sphericity
## 
##             Sum Sq num Df Error SS den Df  F value    Pr(>F)    
## (Intercept) 173326      1    44589   5650 21962.75 < 2.2e-16 ***
## CCB_type       505      2    10385  11300   274.63 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Mauchly Tests for Sphericity
## 
##          Test statistic    p-value
## CCB_type        0.97529 2.0447e-31
## 
## 
## Greenhouse-Geisser and Huynh-Feldt Corrections
##  for Departure from Sphericity
## 
##           GG eps Pr(>F[GG])    
## CCB_type 0.97589  < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##             HF eps  Pr(>F[HF])
## CCB_type 0.9762206 1.7606e-114
#post hoc tests as ANOVA is signficiant
emmeans(aov_res, pairwise ~ CCB_type)
## $emmeans
##  CCB_type emmean     SE   df lower.CL upper.CL
##  gov        3.09 0.0242 5650     3.04     3.14
##  busi       3.06 0.0239 5650     3.01     3.11
##  ind        3.44 0.0238 5650     3.39     3.49
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast   estimate     SE   df t.ratio p.value
##  gov - busi    0.028 0.0173 5650   1.621  0.2369
##  gov - ind    -0.351 0.0194 5650 -18.107  <.0001
##  busi - ind   -0.379 0.0174 5650 -21.826  <.0001
## 
## P value adjustment: tukey method for comparing a family of 3 estimates
# Calculate effect sizes for pairwise differences
dR_subset <- dR %>% select(gov, busi, ind)

cohen_d_ind_gov <- cohen.d(dR_subset$ind, dR_subset$gov, paired = TRUE)
cohen_d_ind_gov
## 
## Cohen's d
## 
## d estimate: 0.1948821 (negligible)
## 95 percent confidence interval:
##     lower     upper 
## 0.1735857 0.2161784
cohen_d_ind_busi <- cohen.d(dR_subset$ind, dR_subset$busi, paired = TRUE)
cohen_d_ind_busi
## 
## Cohen's d
## 
## d estimate: 0.2114729 (small)
## 95 percent confidence interval:
##     lower     upper 
## 0.1922699 0.2306759

Testing CCB differences between countries

aov_gov <- aov(gov ~ country, data = dR)
summary(aov_gov)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        4    648  161.97   50.84 <2e-16 ***
## Residuals   5646  17990    3.19                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_busi <- aov(busi ~ country, data = dR)
summary(aov_busi)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        4    719  179.79   57.83 <2e-16 ***
## Residuals   5646  17552    3.11                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
aov_ind <- aov(ind ~ country, data = dR)
summary(aov_ind)
##               Df Sum Sq Mean Sq F value Pr(>F)    
## country        4   1050  262.60   87.14 <2e-16 ***
## Residuals   5646  17015    3.01                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Post hoc pairwise comparisons (Tukey)
TukeyHSD(aov_gov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = gov ~ country, data = dR)
## 
## $country
##                                  diff         lwr         upr     p adj
## Italy-Germany               0.2235073  0.02753805  0.41947660 0.0160221
## Lithuania-Germany           0.5755483  0.36317588  0.78792080 0.0000000
## Netherlands-Germany        -0.4595694 -0.66816646 -0.25097238 0.0000000
## United Kingdom-Germany      0.3276681  0.11767699  0.53765928 0.0002036
## Lithuania-Italy             0.3520410  0.15111228  0.55296976 0.0000177
## Netherlands-Italy          -0.6830767 -0.88001080 -0.48614269 0.0000000
## United Kingdom-Italy        0.1041608 -0.09424932  0.30257094 0.6066034
## Netherlands-Lithuania      -1.0351178 -1.24838081 -0.82185472 0.0000000
## United Kingdom-Lithuania   -0.2478802 -0.46250705 -0.03325336 0.0141212
## United Kingdom-Netherlands  0.7872376  0.57634577  0.99812935 0.0000000
TukeyHSD(aov_busi)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = busi ~ country, data = dR)
## 
## $country
##                                    diff        lwr         upr     p adj
## Italy-Germany               0.306290728  0.1127183  0.49986320 0.0001561
## Lithuania-Germany           0.819390332  0.6096153  1.02916536 0.0000000
## Netherlands-Germany        -0.292422841 -0.4984686 -0.08637705 0.0010316
## United Kingdom-Germany      0.315583182  0.1081603  0.52300603 0.0003234
## Lithuania-Italy             0.513099603  0.3146283  0.71157088 0.0000000
## Netherlands-Italy          -0.598713569 -0.7932390 -0.40418812 0.0000000
## United Kingdom-Italy        0.009292454 -0.1866910  0.20527592 0.9999370
## Netherlands-Lithuania      -1.111813173 -1.3224679 -0.90115845 0.0000000
## United Kingdom-Lithuania   -0.503807150 -0.7158090 -0.29180530 0.0000000
## United Kingdom-Netherlands  0.608006023  0.3996936  0.81631849 0.0000000
TukeyHSD(aov_ind)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = ind ~ country, data = dR)
## 
## $country
##                                  diff          lwr         upr     p adj
## Italy-Germany               0.6491806  0.458595708  0.83976548 0.0000000
## Lithuania-Germany           0.8349387  0.628401296  1.04147605 0.0000000
## Netherlands-Germany        -0.3506139 -0.553479600 -0.14774822 0.0000243
## United Kingdom-Germany      0.4975438  0.293322321  0.70176531 0.0000000
## Lithuania-Italy             0.1857581 -0.009650003  0.38116616 0.0715798
## Netherlands-Italy          -0.9997945 -1.191317659 -0.80827135 0.0000000
## United Kingdom-Italy       -0.1516368 -0.344595451  0.04132189 0.2015281
## Netherlands-Lithuania      -1.1855526 -1.392956076 -0.97814909 0.0000000
## United Kingdom-Lithuania   -0.3373949 -0.546124681 -0.12866504 0.0001025
## United Kingdom-Netherlands  0.8481577  0.643060333  1.05325511 0.0000000
#Effect sizes (η² for ANOVA)
eta_squared(aov_gov, partial = FALSE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter | Eta2 |       95% CI
## -------------------------------
## country   | 0.03 | [0.03, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_busi, partial = FALSE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter | Eta2 |       95% CI
## -------------------------------
## country   | 0.04 | [0.03, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
eta_squared(aov_ind, partial = FALSE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter | Eta2 |       95% CI
## -------------------------------
## country   | 0.06 | [0.05, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

Correlation table

For CCBs in all countries together

#Variable labels
new_labels <- c("Biospheric values", "Altruistic values", "Hedonic values", "Egoistic values",
                "Problem awareness", "Ascription of responsibility", "Self-efficacy", "Outcome efficacy", "Personal norms",
                "CCBs aimed at governments", "CCBs aimed at businesses", "CCBs aimed at other individuals")

#correlation matrix
cor_matrix <- cor(dR[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
rownames(cor_matrix) <- new_labels
colnames(cor_matrix) <- new_labels
corrplot(cor_matrix, 
         method = "color",    # Use color to represent correlation values
         type = "lower",       # Display the full matrix
         col = brewer.pal(n = 10, name = "RdYlBu"),
         addCoef.col = "black",  # Add correlation coefficients in black
         tl.col = "black",      # Label color
         tl.srt = 45,           # Angle for the text labels
         diag = TRUE)          # Optionally remove the diagonal (set to TRUE to include)

For CCBs per country

dR_UK <- subset(dR, (country == "United Kingdom"))
dR_GER <- subset(dR, (country == "Germany"))
dR_NL <- subset(dR, (country == "Netherlands"))
dR_IT <- subset(dR, (country == "Italy"))
dR_LI <- subset(dR, (country == "Lithuania"))

# Correlation matrix UK
cor_matrix_UK <- cor(dR_UK[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
corrplot(cor_matrix_UK, 
         method = "color",    # Use color to represent correlation values
         type = "lower",       # Display the full matrix
         col = brewer.pal(n = 10, name = "RdYlBu"),
         addCoef.col = "black",  # Add correlation coefficients in black
         tl.col = "black",      # Label color
         tl.srt = 45,           # Angle for the text labels
         diag = FALSE)          # Optionally remove the diagonal (set to TRUE to include)

# Correlation matrix Germany
cor_matrix_GER <- cor(dR_GER[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
corrplot(cor_matrix_GER, 
         method = "color",    # Use color to represent correlation values
         type = "lower",       # Display the full matrix
         col = brewer.pal(n = 10, name = "RdYlBu"),
         addCoef.col = "black",  # Add correlation coefficients in black
         tl.col = "black",      # Label color
         tl.srt = 45,           # Angle for the text labels
         diag = FALSE)          # Optionally remove the diagonal (set to TRUE to include)

# Correlation matrix Netherlands
cor_matrix_NL <- cor(dR_NL[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
corrplot(cor_matrix_NL, 
         method = "color",    # Use color to represent correlation values
         type = "lower",       # Display the full matrix
         col = brewer.pal(n = 10, name = "RdYlBu"),
         addCoef.col = "black",  # Add correlation coefficients in black
         tl.col = "black",      # Label color
         tl.srt = 45,           # Angle for the text labels
         diag = FALSE)          # Optionally remove the diagonal (set to TRUE to include)

# Correlation matrix Italy
cor_matrix_IT <- cor(dR_IT[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
corrplot(cor_matrix_IT, 
         method = "color",    # Use color to represent correlation values
         type = "lower",       # Display the full matrix
         col = brewer.pal(n = 10, name = "RdYlBu"),
         addCoef.col = "black",  # Add correlation coefficients in black
         tl.col = "black",      # Label color
         tl.srt = 45,           # Angle for the text labels
         diag = FALSE)          # Optionally remove the diagonal (set to TRUE to include)

# Correlation matrix Lithuania
cor_matrix_LI <- cor(dR_LI[, c("bio", "alt", "hed", "ego", "pa", "ar", "se", "oe", "pn", "gov", "busi", "ind")])
corrplot(cor_matrix_LI, 
         method = "color",    # Use color to represent correlation values
         type = "lower",       # Display the full matrix
         col = brewer.pal(n = 10, name = "RdYlBu"),
         addCoef.col = "black",  # Add correlation coefficients in black
         tl.col = "black",      # Label color
         tl.srt = 45,           # Angle for the text labels
         diag = FALSE)          # Optionally remove the diagonal (set to TRUE to include)

Path analysis

Path analysis for all countries together

library(lavaan)
library(lavaanPlot)
library(rsvg)
## Linking to librsvg 2.61.0
library(DiagrammeRsvg)

## VBN model & ego mediation
model_vbn_ego <- '
  # Regression paths
  pa ~ a1*bio + a2*alt + a3*hed + a4*ego
  ar ~ b*pa
  se ~ c1*ar + c2*ego
  oe ~ d1*ar + d2*ego
  pn ~ e1*se + e2*oe
  gov  ~ f1*pn + g1*ego
  busi ~ f2*pn + g2*ego
  ind  ~ f3*pn + g3*ego

  # Indirect effects (ego → se/oe → pn → outcomes): indirect = (ego → se → pn → ccb) + (ego → oe → pn → ccb)
  ego_gov_indirect := c2*e1*f1 + d2*e2*f1 
  ego_busi_indirect := c2*e1*f2 + d2*e2*f2
  ego_ind_indirect := c2*e1*f3 + d2*e2*f3
  
  # Total effects
  ego_gov_total := ego_gov_indirect + g1
  ego_busi_total := ego_busi_indirect + g2
  ego_ind_total := ego_ind_indirect + g3
'

#fit_vbn_ego_bootstrap <- lavaan::sem(model_vbn_ego, data = dR, cluster = "country", se = "bootstrap", bootstrap = 5000)
#summary(fit_vbn_ego_bootstrap, standardized = TRUE, fit.measures = TRUE, rsquare = TRUE, ci = TRUE)
fit_vbn_ego <- lavaan::sem(model_vbn_ego, data = dR, cluster = "country", se = "robust.sem")
## Warning: lavaan->lav_model_vcov():  
##    The variance-covariance matrix of the estimated parameters (vcov) does not 
##    appear to be positive definite! The smallest eigenvalue (= -4.430040e-16) 
##    is smaller than zero. This may be a symptom that the model is not 
##    identified.
summary(fit_vbn_ego, standardized = TRUE, fit.measures = TRUE, rsquare = TRUE, ci = TRUE)
## lavaan 0.6-20 ended normally after 39 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        36
## 
##   Number of observations                          5651
##   Number of clusters [country]                       5
## 
## Model Test User Model:
##                                               Standard      Scaled
##   Test Statistic                              4042.997    1348.023
##   Degrees of freedom                                40          40
##   P-value (Chi-square)                           0.000       0.000
##   Scaling correction factor                                  2.999
##     Yuan-Bentler correction (Mplus variant)                       
## 
## Model Test Baseline Model:
## 
##   Test statistic                             33539.080   10020.041
##   Degrees of freedom                                60          60
##   P-value                                        0.000       0.000
##   Scaling correction factor                                  3.347
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.880       0.869
##   Tucker-Lewis Index (TLI)                       0.821       0.803
##                                                                   
##   Robust Comparative Fit Index (CFI)                         0.882
##   Robust Tucker-Lewis Index (TLI)                            0.823
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -74973.887  -74973.887
##   Scaling correction factor                                 10.177
##       for the MLR correction                                      
##   Loglikelihood unrestricted model (H1)     -72952.389  -72952.389
##   Scaling correction factor                                  6.399
##       for the MLR correction                                      
##                                                                   
##   Akaike (AIC)                              150019.775  150019.775
##   Bayesian (BIC)                            150258.800  150258.800
##   Sample-size adjusted Bayesian (SABIC)     150144.403  150144.403
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.133       0.076
##   90 Percent confidence interval - lower         0.130       0.074
##   90 Percent confidence interval - upper         0.137       0.078
##   P-value H_0: RMSEA <= 0.050                    0.000       0.000
##   P-value H_0: RMSEA >= 0.080                    1.000       0.001
##                                                                   
##   Robust RMSEA                                               0.132
##   90 Percent confidence interval - lower                     0.126
##   90 Percent confidence interval - upper                     0.138
##   P-value H_0: Robust RMSEA <= 0.050                         0.000
##   P-value H_0: Robust RMSEA >= 0.080                         1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.087       0.087
## 
## Parameter Estimates:
## 
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   pa ~                                                                  
##     bio       (a1)    0.249    0.046    5.431    0.000    0.159    0.339
##     alt       (a2)    0.054    0.030    1.798    0.072   -0.005    0.114
##     hed       (a3)   -0.109    0.025   -4.418    0.000   -0.157   -0.061
##     ego       (a4)    0.036    0.020    1.733    0.083   -0.005    0.076
##   ar ~                                                                  
##     pa         (b)    0.697    0.018   37.762    0.000    0.661    0.733
##   se ~                                                                  
##     ar        (c1)    0.539    0.019   28.843    0.000    0.503    0.576
##     ego       (c2)    0.087    0.023    3.795    0.000    0.042    0.132
##   oe ~                                                                  
##     ar        (d1)    0.602    0.014   41.876    0.000    0.574    0.631
##     ego       (d2)    0.068    0.024    2.807    0.005    0.021    0.116
##   pn ~                                                                  
##     se        (e1)    0.471    0.016   30.212    0.000    0.440    0.501
##     oe        (e2)    0.448    0.023   19.670    0.000    0.404    0.493
##   gov ~                                                                 
##     pn        (f1)    0.628    0.022   28.258    0.000    0.585    0.672
##     ego       (g1)    0.030    0.013    2.269    0.023    0.004    0.055
##   busi ~                                                                
##     pn        (f2)    0.619    0.027   22.876    0.000    0.566    0.672
##     ego       (g2)    0.086    0.025    3.477    0.001    0.037    0.134
##   ind ~                                                                 
##     pn        (f3)    0.669    0.037   18.011    0.000    0.596    0.742
##     ego       (g3)    0.050    0.009    5.287    0.000    0.032    0.069
##    Std.lv  Std.all
##                   
##     0.249    0.255
##     0.054    0.056
##    -0.109   -0.112
##     0.036    0.034
##                   
##     0.697    0.699
##                   
##     0.539    0.555
##     0.087    0.086
##                   
##     0.602    0.618
##     0.068    0.067
##                   
##     0.471    0.503
##     0.448    0.480
##                   
##     0.628    0.570
##     0.030    0.028
##                   
##     0.619    0.569
##     0.086    0.082
##                   
##     0.669    0.621
##     0.050    0.049
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .gov ~~                                                                
##    .busi              1.197    0.084   14.287    0.000    1.033    1.361
##    .ind               0.871    0.091    9.573    0.000    0.693    1.050
##  .busi ~~                                                               
##    .ind               1.045    0.066   15.904    0.000    0.916    1.174
##    Std.lv  Std.all
##                   
##     1.197    0.589
##     0.871    0.452
##                   
##     1.045    0.553
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                3.283    0.080   40.925    0.000    3.126    3.440
##    .ar                0.851    0.123    6.904    0.000    0.610    1.093
##    .se                1.223    0.078   15.592    0.000    1.069    1.377
##    .oe                1.080    0.135    8.010    0.000    0.816    1.344
##    .pn                0.135    0.064    2.112    0.035    0.010    0.259
##    .gov               0.769    0.144    5.328    0.000    0.486    1.052
##    .busi              0.557    0.198    2.818    0.005    0.170    0.944
##    .ind               0.898    0.259    3.466    0.001    0.390    1.406
##    Std.lv  Std.all
##     3.283    1.866
##     0.851    0.485
##     1.223    0.717
##     1.080    0.632
##     0.135    0.084
##     0.769    0.438
##     0.557    0.320
##     0.898    0.522
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.902    0.054   54.028    0.000    2.797    3.007
##    .ar                1.575    0.093   16.972    0.000    1.393    1.757
##    .se                1.982    0.105   18.952    0.000    1.777    2.186
##    .oe                1.785    0.070   25.639    0.000    1.648    1.921
##    .pn                0.881    0.080   10.990    0.000    0.724    1.039
##    .gov               2.071    0.084   24.607    0.000    1.906    2.236
##    .busi              1.995    0.124   16.126    0.000    1.753    2.238
##    .ind               1.791    0.090   19.994    0.000    1.616    1.967
##    Std.lv  Std.all
##     2.902    0.938
##     1.575    0.512
##     1.982    0.681
##     1.785    0.610
##     0.881    0.346
##     2.071    0.671
##     1.995    0.660
##     1.791    0.606
## 
## R-Square:
##                    Estimate
##     pa                0.062
##     ar                0.488
##     se                0.319
##     oe                0.390
##     pn                0.654
##     gov               0.329
##     busi              0.340
##     ind               0.394
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##     ego_gov_indrct    0.045    0.015    3.078    0.002    0.016    0.074
##     ego_busi_ndrct    0.044    0.015    2.955    0.003    0.015    0.074
##     ego_ind_indrct    0.048    0.016    2.916    0.004    0.016    0.080
##     ego_gov_total     0.074    0.018    4.185    0.000    0.040    0.109
##     ego_busi_total    0.130    0.033    3.976    0.000    0.066    0.194
##     ego_ind_total     0.098    0.020    4.985    0.000    0.059    0.136
##    Std.lv  Std.all
##     0.045    0.043
##     0.044    0.043
##     0.048    0.047
##     0.074    0.071
##     0.130    0.125
##     0.098    0.095
#plot
lavaanPlot(
  model = fit_vbn_ego,
  graph_options = list(rankdir = "LR"),
  labels = list(
    bio = "Biospheric values", alt = "Altruistic values", hed = "Hedonic values", ego = "Egoistic values",
    pa = "Problem awareness", ar = "Ascription of responsibility", se = "Self-efficacy", oe = "Outcome efficacy",
    pn = "Personal norm", gov = "CCB aimed at governments", busi = "CCB aimed at businesses",
    ind = "CCB aimed at other citizens"
  ),
  node_options = list(shape = "box", fontname = "Helvetica"),
  edge_options = list(color = "grey"),
  coefs = TRUE,
  covs = FALSE,
  stars = c("regress")
)

Path analysis per country

model_countries <- '
  # Regression paths
  pa ~ c(a1_1, a1_2, a1_3, a1_4, a1_5)*bio +
       c(a2_1, a2_2, a2_3, a2_4, a2_5)*alt +
       c(a3_1, a3_2, a3_3, a3_4, a3_5)*hed +
       c(a4_1, a4_2, a4_3, a4_4, a4_5)*ego

  ar ~ c(b1_1, b1_2, b1_3, b1_4, b1_5)*pa

  se ~ c(c1_1, c1_2, c1_3, c1_4, c1_5)*ar +
       c(c2_1, c2_2, c2_3, c2_4, c2_5)*ego

  oe ~ c(d1_1, d1_2, d1_3, d1_4, d1_5)*ar +
       c(d2_1, d2_2, d2_3, d2_4, d2_5)*ego

  pn ~ c(e1_1, e1_2, e1_3, e1_4, e1_5)*se +
       c(e2_1, e2_2, e2_3, e2_4, e2_5)*oe 
       
  gov ~ c(f1_1, f1_2, f1_3, f1_4, f1_5)*pn +
          c(g1_1, g1_2, g1_3, g1_4, g1_5)*ego

  busi ~ c(f2_1, f2_2, f2_3, f2_4, f2_5)*pn +
          c(g2_1, g2_2, g2_3, g2_4, g2_5)*ego

  ind ~ c(f3_1, f3_2, f3_3, f3_4, f3_5)*pn +
         c(g3_1, g3_2, g3_3, g3_4, g3_5)*ego
'

#fit_model_countries_bootstrap <- lavaan::sem(model_countries, data = dR, group = "country", se = "bootstrap", bootstrap = 5000)
#summary(fit_model_countries_bootstrap, standardized = TRUE, fit.measures = TRUE, rsquare = TRUE, ci = TRUE)
fit_model_countries <- lavaan::sem(model_countries, data = dR, group = "country", se = "robust.sem")
summary(fit_model_countries, standardized = TRUE, fit.measures = TRUE, rsquare = TRUE, ci = TRUE)
## lavaan 0.6-20 ended normally after 86 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       180
## 
##   Number of observations per group:                   
##     Germany                                       1100
##     Lithuania                                     1008
##     Netherlands                                   1081
##     United Kingdom                                1053
##     Italy                                         1409
## 
## Model Test User Model:
##                                                       
##   Test statistic                              4465.219
##   Degrees of freedom                               200
##   P-value (Chi-square)                           0.000
##   Test statistic for each group:
##     Germany                                    698.620
##     Lithuania                                  797.769
##     Netherlands                                778.230
##     United Kingdom                             830.566
##     Italy                                     1360.034
## 
## Model Test Baseline Model:
## 
##   Test statistic                             34296.718
##   Degrees of freedom                               300
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.875
##   Tucker-Lewis Index (TLI)                       0.812
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -74182.726
##   Loglikelihood unrestricted model (H1)     -71950.117
##                                                       
##   Akaike (AIC)                              148725.452
##   Bayesian (BIC)                            149920.578
##   Sample-size adjusted Bayesian (SABIC)     149348.592
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.137
##   90 Percent confidence interval - lower         0.134
##   90 Percent confidence interval - upper         0.141
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.091
## 
## Parameter Estimates:
## 
##   Standard errors                           Robust.sem
##   Information                                 Expected
##   Information saturated (h1) model          Structured
## 
## 
## Group 1 [Germany]:
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   pa ~                                                                  
##     bio     (a1_1)    0.368    0.051    7.162    0.000    0.267    0.469
##     alt     (a2_1)    0.157    0.054    2.891    0.004    0.050    0.263
##     hed     (a3_1)   -0.125    0.046   -2.722    0.006   -0.216   -0.035
##     ego     (a4_1)   -0.033    0.035   -0.953    0.341   -0.102    0.035
##   ar ~                                                                  
##     pa      (b1_1)    0.723    0.020   35.567    0.000    0.683    0.763
##   se ~                                                                  
##     ar      (c1_1)    0.529    0.025   21.529    0.000    0.481    0.577
##     ego     (c2_1)    0.095    0.028    3.361    0.001    0.040    0.151
##   oe ~                                                                  
##     ar      (d1_1)    0.628    0.021   30.566    0.000    0.588    0.669
##     ego     (d2_1)    0.066    0.025    2.690    0.007    0.018    0.114
##   pn ~                                                                  
##     se      (e1_1)    0.386    0.020   18.862    0.000    0.346    0.426
##     oe      (e2_1)    0.531    0.019   27.332    0.000    0.493    0.569
##   gov ~                                                                 
##     pn      (f1_1)    0.683    0.028   24.659    0.000    0.628    0.737
##     ego     (g1_1)    0.056    0.028    2.008    0.045    0.001    0.110
##   busi ~                                                                
##     pn      (f2_1)    0.648    0.026   24.751    0.000    0.597    0.699
##     ego     (g2_1)    0.149    0.025    6.048    0.000    0.101    0.197
##   ind ~                                                                 
##     pn      (f3_1)    0.723    0.023   31.543    0.000    0.678    0.768
##     ego     (g3_1)    0.079    0.023    3.404    0.001    0.033    0.124
##    Std.lv  Std.all
##                   
##     0.368    0.267
##     0.157    0.116
##    -0.125   -0.091
##    -0.033   -0.030
##                   
##     0.723    0.715
##                   
##     0.529    0.562
##     0.095    0.089
##                   
##     0.628    0.674
##     0.066    0.062
##                   
##     0.386    0.406
##     0.531    0.553
##                   
##     0.683    0.626
##     0.056    0.050
##                   
##     0.648    0.615
##     0.149    0.139
##                   
##     0.723    0.693
##     0.079    0.074
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .gov ~~                                                                
##    .busi              0.976    0.079   12.312    0.000    0.820    1.131
##    .ind               0.666    0.069    9.719    0.000    0.532    0.801
##  .busi ~~                                                               
##    .ind               0.970    0.068   14.213    0.000    0.836    1.104
##    Std.lv  Std.all
##                   
##     0.976    0.522
##     0.666    0.389
##                   
##     0.970    0.592
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.558    0.322    7.942    0.000    1.927    3.190
##    .ar                0.659    0.086    7.694    0.000    0.491    0.827
##    .se                1.103    0.155    7.126    0.000    0.800    1.406
##    .oe                0.746    0.127    5.864    0.000    0.497    0.995
##    .pn                0.060    0.066    0.902    0.367   -0.070    0.190
##    .gov               0.477    0.146    3.272    0.001    0.191    0.763
##    .busi              0.111    0.120    0.926    0.354   -0.124    0.345
##    .ind               0.400    0.116    3.461    0.001    0.174    0.627
##    Std.lv  Std.all
##     2.558    1.404
##     0.659    0.358
##     1.103    0.636
##     0.746    0.434
##     0.060    0.036
##     0.477    0.265
##     0.111    0.064
##     0.400    0.233
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.968    0.121   24.534    0.000    2.731    3.205
##    .ar                1.660    0.099   16.785    0.000    1.466    1.854
##    .se                2.043    0.097   21.073    0.000    1.853    2.233
##    .oe                1.606    0.081   19.748    0.000    1.447    1.765
##    .pn                0.975    0.067   14.526    0.000    0.844    1.107
##    .gov               1.951    0.105   18.671    0.000    1.747    2.156
##    .busi              1.787    0.083   21.439    0.000    1.624    1.951
##    .ind               1.503    0.071   21.046    0.000    1.363    1.643
##    Std.lv  Std.all
##     2.968    0.894
##     1.660    0.489
##     2.043    0.679
##     1.606    0.544
##     0.975    0.358
##     1.951    0.603
##     1.787    0.593
##     1.503    0.508
## 
## R-Square:
##                    Estimate
##     pa                0.106
##     ar                0.511
##     se                0.321
##     oe                0.456
##     pn                0.642
##     gov               0.397
##     busi              0.407
##     ind               0.492
## 
## 
## Group 2 [Lithuania]:
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   pa ~                                                                  
##     bio     (a1_2)    0.177    0.052    3.434    0.001    0.076    0.278
##     alt     (a2_2)    0.039    0.049    0.799    0.425   -0.057    0.135
##     hed     (a3_2)   -0.041    0.041   -1.003    0.316   -0.121    0.039
##     ego     (a4_2)    0.039    0.043    0.918    0.359   -0.044    0.123
##   ar ~                                                                  
##     pa      (b1_2)    0.653    0.026   25.007    0.000    0.602    0.704
##   se ~                                                                  
##     ar      (c1_2)    0.515    0.030   17.201    0.000    0.456    0.573
##     ego     (c2_2)    0.047    0.026    1.782    0.075   -0.005    0.098
##   oe ~                                                                  
##     ar      (d1_2)    0.554    0.029   18.919    0.000    0.496    0.611
##     ego     (d2_2)    0.041    0.026    1.574    0.115   -0.010    0.093
##   pn ~                                                                  
##     se      (e1_2)    0.527    0.021   24.581    0.000    0.485    0.569
##     oe      (e2_2)    0.352    0.020   17.574    0.000    0.312    0.391
##   gov ~                                                                 
##     pn      (f1_2)    0.573    0.038   15.193    0.000    0.499    0.647
##     ego     (g1_2)    0.025    0.027    0.947    0.344   -0.027    0.077
##   busi ~                                                                
##     pn      (f2_2)    0.537    0.040   13.588    0.000    0.459    0.614
##     ego     (g2_2)    0.059    0.027    2.201    0.028    0.006    0.112
##   ind ~                                                                 
##     pn      (f3_2)    0.519    0.037   13.979    0.000    0.446    0.592
##     ego     (g3_2)    0.052    0.026    1.998    0.046    0.001    0.103
##    Std.lv  Std.all
##                   
##     0.177    0.199
##     0.039    0.045
##    -0.041   -0.042
##     0.039    0.041
##                   
##     0.653    0.659
##                   
##     0.515    0.544
##     0.047    0.052
##                   
##     0.554    0.577
##     0.041    0.045
##                   
##     0.527    0.565
##     0.352    0.382
##                   
##     0.573    0.524
##     0.025    0.027
##                   
##     0.537    0.489
##     0.059    0.064
##                   
##     0.519    0.499
##     0.052    0.059
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .gov ~~                                                                
##    .busi              1.278    0.099   12.949    0.000    1.085    1.472
##    .ind               0.985    0.094   10.498    0.000    0.801    1.169
##  .busi ~~                                                               
##    .ind               1.057    0.098   10.778    0.000    0.865    1.250
##    Std.lv  Std.all
##                   
##     1.278    0.597
##     0.985    0.489
##                   
##     1.057    0.511
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                3.456    0.177   19.535    0.000    3.109    3.803
##    .ar                1.262    0.120   10.498    0.000    1.027    1.498
##    .se                1.450    0.166    8.756    0.000    1.125    1.774
##    .oe                1.321    0.160    8.245    0.000    1.007    1.635
##    .pn                0.396    0.100    3.961    0.000    0.200    0.591
##    .gov               1.294    0.170    7.597    0.000    0.960    1.628
##    .busi              1.408    0.181    7.782    0.000    1.054    1.763
##    .ind               1.789    0.178   10.075    0.000    1.441    2.137
##    Std.lv  Std.all
##     3.456    1.942
##     1.262    0.716
##     1.450    0.869
##     1.321    0.781
##     0.396    0.254
##     1.294    0.761
##     1.408    0.823
##     1.789    1.104
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.985    0.111   26.866    0.000    2.767    3.202
##    .ar                1.759    0.114   15.485    0.000    1.537    1.982
##    .se                1.935    0.106   18.315    0.000    1.728    2.143
##    .oe                1.887    0.104   18.181    0.000    1.684    2.090
##    .pn                0.961    0.089   10.789    0.000    0.787    1.136
##    .gov               2.089    0.109   19.114    0.000    1.875    2.303
##    .busi              2.196    0.116   18.992    0.000    1.969    2.422
##    .ind               1.946    0.105   18.612    0.000    1.741    2.151
##    Std.lv  Std.all
##     2.985    0.942
##     1.759    0.566
##     1.935    0.695
##     1.887    0.659
##     0.961    0.396
##     2.089    0.721
##     2.196    0.750
##     1.946    0.741
## 
## R-Square:
##                    Estimate
##     pa                0.058
##     ar                0.434
##     se                0.305
##     oe                0.341
##     pn                0.604
##     gov               0.279
##     busi              0.250
##     ind               0.259
## 
## 
## Group 3 [Netherlands]:
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   pa ~                                                                  
##     bio     (a1_3)    0.301    0.048    6.207    0.000    0.206    0.396
##     alt     (a2_3)   -0.046    0.053   -0.879    0.379   -0.149    0.057
##     hed     (a3_3)   -0.082    0.046   -1.800    0.072   -0.172    0.007
##     ego     (a4_3)    0.034    0.034    0.994    0.320   -0.033    0.100
##   ar ~                                                                  
##     pa      (b1_3)    0.713    0.022   31.836    0.000    0.669    0.757
##   se ~                                                                  
##     ar      (c1_3)    0.559    0.027   20.461    0.000    0.506    0.613
##     ego     (c2_3)    0.057    0.028    2.071    0.038    0.003    0.111
##   oe ~                                                                  
##     ar      (d1_3)    0.638    0.025   25.192    0.000    0.589    0.688
##     ego     (d2_3)    0.035    0.026    1.339    0.181   -0.016    0.087
##   pn ~                                                                  
##     se      (e1_3)    0.568    0.020   29.015    0.000    0.530    0.607
##     oe      (e2_3)    0.320    0.020   16.193    0.000    0.282    0.359
##   gov ~                                                                 
##     pn      (f1_3)    0.596    0.031   19.169    0.000    0.535    0.657
##     ego     (g1_3)    0.009    0.025    0.371    0.711   -0.040    0.059
##   busi ~                                                                
##     pn      (f2_3)    0.619    0.029   21.226    0.000    0.562    0.676
##     ego     (g2_3)    0.045    0.024    1.860    0.063   -0.002    0.093
##   ind ~                                                                 
##     pn      (f3_3)    0.657    0.027   24.162    0.000    0.603    0.710
##     ego     (g3_3)    0.005    0.023    0.228    0.820   -0.041    0.051
##    Std.lv  Std.all
##                   
##     0.301    0.291
##    -0.046   -0.049
##    -0.082   -0.096
##     0.034    0.032
##                   
##     0.713    0.726
##                   
##     0.559    0.569
##     0.057    0.057
##                   
##     0.638    0.638
##     0.035    0.034
##                   
##     0.568    0.605
##     0.320    0.347
##                   
##     0.596    0.577
##     0.009    0.010
##                   
##     0.619    0.607
##     0.045    0.047
##                   
##     0.657    0.641
##     0.005    0.005
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .gov ~~                                                                
##    .busi              1.213    0.067   18.042    0.000    1.081    1.344
##    .ind               0.952    0.063   15.070    0.000    0.828    1.075
##  .busi ~~                                                               
##    .ind               0.969    0.062   15.530    0.000    0.846    1.091
##    Std.lv  Std.all
##                   
##     1.213    0.752
##     0.952    0.607
##                   
##     0.969    0.645
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                3.221    0.227   14.216    0.000    2.777    3.665
##    .ar                0.715    0.084    8.512    0.000    0.550    0.879
##    .se                1.169    0.143    8.201    0.000    0.889    1.448
##    .oe                1.112    0.133    8.367    0.000    0.852    1.373
##    .pn                0.084    0.066    1.266    0.206   -0.046    0.214
##    .gov               0.584    0.127    4.617    0.000    0.336    0.832
##    .busi              0.429    0.113    3.790    0.000    0.207    0.651
##    .ind               0.662    0.116    5.715    0.000    0.435    0.889
##    Std.lv  Std.all
##     3.221    1.900
##     0.715    0.429
##     1.169    0.713
##     1.112    0.668
##     0.084    0.055
##     0.584    0.368
##     0.429    0.273
##     0.662    0.420
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.735    0.101   27.207    0.000    2.538    2.932
##    .ar                1.314    0.089   14.690    0.000    1.139    1.489
##    .se                1.806    0.090   19.956    0.000    1.628    1.983
##    .oe                1.640    0.088   18.723    0.000    1.469    1.812
##    .pn                0.853    0.060   14.130    0.000    0.735    0.971
##    .gov               1.683    0.084   19.960    0.000    1.517    1.848
##    .busi              1.545    0.073   21.156    0.000    1.402    1.688
##    .ind               1.461    0.072   20.183    0.000    1.319    1.603
##    Std.lv  Std.all
##     2.735    0.951
##     1.314    0.473
##     1.806    0.672
##     1.640    0.591
##     0.853    0.360
##     1.683    0.666
##     1.545    0.627
##     1.461    0.588
## 
## R-Square:
##                    Estimate
##     pa                0.049
##     ar                0.527
##     se                0.328
##     oe                0.409
##     pn                0.640
##     gov               0.334
##     busi              0.373
##     ind               0.412
## 
## 
## Group 4 [United Kingdom]:
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   pa ~                                                                  
##     bio     (a1_4)    0.250    0.051    4.936    0.000    0.151    0.349
##     alt     (a2_4)    0.047    0.046    1.027    0.304   -0.043    0.137
##     hed     (a3_4)   -0.128    0.049   -2.615    0.009   -0.225   -0.032
##     ego     (a4_4)    0.060    0.035    1.711    0.087   -0.009    0.128
##   ar ~                                                                  
##     pa      (b1_4)    0.744    0.023   31.693    0.000    0.698    0.790
##   se ~                                                                  
##     ar      (c1_4)    0.499    0.028   17.727    0.000    0.444    0.554
##     ego     (c2_4)    0.170    0.029    5.786    0.000    0.112    0.228
##   oe ~                                                                  
##     ar      (d1_4)    0.592    0.026   23.069    0.000    0.542    0.642
##     ego     (d2_4)    0.159    0.028    5.660    0.000    0.104    0.214
##   pn ~                                                                  
##     se      (e1_4)    0.352    0.017   20.495    0.000    0.318    0.385
##     oe      (e2_4)    0.584    0.016   35.433    0.000    0.552    0.616
##   gov ~                                                                 
##     pn      (f1_4)    0.642    0.031   20.596    0.000    0.581    0.703
##     ego     (g1_4)    0.017    0.030    0.567    0.571   -0.042    0.076
##   busi ~                                                                
##     pn      (f2_4)    0.659    0.029   23.052    0.000    0.603    0.715
##     ego     (g2_4)    0.113    0.028    4.060    0.000    0.058    0.167
##   ind ~                                                                 
##     pn      (f3_4)    0.692    0.027   25.573    0.000    0.639    0.745
##     ego     (g3_4)    0.045    0.025    1.819    0.069   -0.003    0.094
##    Std.lv  Std.all
##                   
##     0.250    0.256
##     0.047    0.049
##    -0.128   -0.130
##     0.060    0.060
##                   
##     0.744    0.703
##                   
##     0.499    0.508
##     0.170    0.163
##                   
##     0.592    0.601
##     0.159    0.152
##                   
##     0.352    0.371
##     0.584    0.618
##                   
##     0.642    0.585
##     0.017    0.016
##                   
##     0.659    0.607
##     0.113    0.105
##                   
##     0.692    0.654
##     0.045    0.043
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .gov ~~                                                                
##    .busi              0.979    0.091   10.805    0.000    0.801    1.157
##    .ind               0.733    0.090    8.111    0.000    0.556    0.910
##  .busi ~~                                                               
##    .ind               1.085    0.089   12.186    0.000    0.911    1.260
##    Std.lv  Std.all
##                   
##     0.979    0.447
##     0.733    0.355
##                   
##     1.085    0.555
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                3.321    0.208   15.932    0.000    2.913    3.730
##    .ar                0.555    0.101    5.517    0.000    0.358    0.752
##    .se                1.226    0.156    7.856    0.000    0.920    1.531
##    .oe                0.805    0.134    6.011    0.000    0.542    1.067
##    .pn                0.103    0.070    1.472    0.141   -0.034    0.239
##    .gov               0.913    0.155    5.882    0.000    0.609    1.217
##    .busi              0.340    0.141    2.411    0.016    0.064    0.616
##    .ind               0.938    0.137    6.861    0.000    0.670    1.206
##    Std.lv  Std.all
##     3.321    1.909
##     0.555    0.301
##     1.226    0.678
##     0.805    0.444
##     0.103    0.060
##     0.913    0.486
##     0.340    0.182
##     0.938    0.517
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.863    0.107   26.863    0.000    2.654    3.072
##    .ar                1.715    0.105   16.311    0.000    1.509    1.922
##    .se                2.310    0.109   21.213    0.000    2.097    2.524
##    .oe                1.995    0.100   19.871    0.000    1.798    2.192
##    .pn                0.955    0.068   14.070    0.000    0.822    1.088
##    .gov               2.311    0.117   19.727    0.000    2.081    2.541
##    .busi              2.072    0.104   19.848    0.000    1.867    2.276
##    .ind               1.845    0.103   17.855    0.000    1.643    2.048
##    Std.lv  Std.all
##     2.863    0.945
##     1.715    0.506
##     2.310    0.707
##     1.995    0.606
##     0.955    0.325
##     2.311    0.654
##     2.072    0.597
##     1.845    0.560
## 
## R-Square:
##                    Estimate
##     pa                0.055
##     ar                0.494
##     se                0.293
##     oe                0.394
##     pn                0.675
##     gov               0.346
##     busi              0.403
##     ind               0.440
## 
## 
## Group 5 [Italy]:
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   pa ~                                                                  
##     bio     (a1_5)    0.151    0.041    3.693    0.000    0.071    0.232
##     alt     (a2_5)    0.107    0.044    2.451    0.014    0.021    0.192
##     hed     (a3_5)   -0.072    0.039   -1.852    0.064   -0.149    0.004
##     ego     (a4_5)    0.058    0.033    1.740    0.082   -0.007    0.122
##   ar ~                                                                  
##     pa      (b1_5)    0.657    0.021   31.962    0.000    0.617    0.698
##   se ~                                                                  
##     ar      (c1_5)    0.596    0.024   24.832    0.000    0.549    0.643
##     ego     (c2_5)    0.070    0.026    2.756    0.006    0.020    0.121
##   oe ~                                                                  
##     ar      (d1_5)    0.614    0.023   26.330    0.000    0.568    0.659
##     ego     (d2_5)    0.064    0.025    2.545    0.011    0.015    0.113
##   pn ~                                                                  
##     se      (e1_5)    0.536    0.013   42.128    0.000    0.511    0.561
##     oe      (e2_5)    0.402    0.013   30.232    0.000    0.376    0.428
##   gov ~                                                                 
##     pn      (f1_5)    0.585    0.031   18.711    0.000    0.524    0.646
##     ego     (g1_5)   -0.020    0.028   -0.705    0.481   -0.074    0.035
##   busi ~                                                                
##     pn      (f2_5)    0.564    0.031   18.296    0.000    0.504    0.625
##     ego     (g2_5)    0.005    0.028    0.164    0.870   -0.051    0.060
##   ind ~                                                                 
##     pn      (f3_5)    0.634    0.029   21.583    0.000    0.577    0.692
##     ego     (g3_5)    0.018    0.026    0.716    0.474   -0.032    0.068
##    Std.lv  Std.all
##                   
##     0.151    0.173
##     0.107    0.117
##    -0.072   -0.078
##     0.058    0.051
##                   
##     0.657    0.690
##                   
##     0.596    0.590
##     0.070    0.065
##                   
##     0.614    0.610
##     0.064    0.059
##                   
##     0.536    0.589
##     0.402    0.440
##                   
##     0.585    0.523
##    -0.020   -0.018
##                   
##     0.564    0.512
##     0.005    0.004
##                   
##     0.634    0.585
##     0.018    0.017
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .gov ~~                                                                
##    .busi              1.248    0.075   16.644    0.000    1.101    1.395
##    .ind               0.755    0.073   10.292    0.000    0.611    0.899
##  .busi ~~                                                               
##    .ind               0.861    0.074   11.671    0.000    0.717    1.006
##    Std.lv  Std.all
##                   
##     1.248    0.610
##     0.755    0.398
##                   
##     0.861    0.457
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                3.240    0.172   18.852    0.000    2.903    3.577
##    .ar                1.047    0.085   12.254    0.000    0.879    1.214
##    .se                1.135    0.130    8.708    0.000    0.880    1.391
##    .oe                1.223    0.128    9.551    0.000    0.972    1.474
##    .pn                0.185    0.068    2.714    0.007    0.051    0.319
##    .gov               1.076    0.146    7.393    0.000    0.791    1.361
##    .busi              1.022    0.146    7.022    0.000    0.737    1.307
##    .ind               1.321    0.140    9.439    0.000    1.047    1.596
##    Std.lv  Std.all
##     3.240    1.883
##     1.047    0.638
##     1.135    0.685
##     1.223    0.742
##     0.185    0.123
##     1.076    0.640
##     1.022    0.615
##     1.321    0.809
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .pa                2.806    0.089   31.437    0.000    2.632    2.981
##    .ar                1.409    0.074   19.061    0.000    1.264    1.554
##    .se                1.772    0.076   23.241    0.000    1.623    1.922
##    .oe                1.691    0.079   21.464    0.000    1.536    1.845
##    .pn                0.611    0.049   12.408    0.000    0.514    0.707
##    .gov               2.059    0.085   24.128    0.000    1.891    2.226
##    .busi              2.033    0.079   25.828    0.000    1.879    2.188
##    .ind               1.751    0.084   20.870    0.000    1.586    1.915
##    Std.lv  Std.all
##     2.806    0.948
##     1.409    0.524
##     1.772    0.646
##     1.691    0.622
##     0.611    0.269
##     2.059    0.727
##     2.033    0.738
##     1.751    0.656
## 
## R-Square:
##                    Estimate
##     pa                0.052
##     ar                0.476
##     se                0.354
##     oe                0.378
##     pn                0.731
##     gov               0.273
##     busi              0.262
##     ind               0.344
#plot betas
est <- parameterEstimates(fit_model_countries, standardized = TRUE)
# keep only regression paths
est_reg <- est %>%
  filter(op == "~") %>%
  mutate(country = group)  # group is numeric by default
est_reg$country <- factor(est_reg$country,
                          levels = 1:5,
                          labels = c("Germany", "Lithuania", "Netherlands", "UK", "Italy"))


est_reg <- est_reg %>%
  mutate(path = paste(lhs, "~", rhs))

est_reg <- est_reg %>%
  arrange(path) %>%
  mutate(path_id = as.numeric(factor(path)),
         path_spaced = path_id * 2)  # increase multiplier for more space

est_reg$country <- factor(est_reg$country)

#path order for figure
path_order <- c(
  "pa ~ bio",
  "pa ~ alt",
  "pa ~ hed",
  "pa ~ ego",
  "ar ~ pa",
  "se ~ ar",
  "oe ~ ar",
  "pn ~ se",
  "pn ~ oe",
  "gov ~ pn",
  "busi ~ pn",
  "ind ~ pn",
  "se ~ ego",
  "oe ~ ego",
  "gov ~ ego",
  "busi ~ ego",
  "ind ~ ego"
)
est_reg$path <- factor(est_reg$path,
                       levels = rev(path_order))

ggplot(est_reg,
       aes(x = std.all,
           y = path,
           color = country)) +
  geom_point(position = position_dodge(width = 0.6),size = 3) +
  geom_errorbarh(
    aes(xmin = ci.lower,
      xmax = ci.upper),
    height = 0.8,
    position = position_dodge(width = 0.6)
  ) +
  labs(x = expression(beta),
       y = "Path",
       color = "Country") +
  theme_minimal() +
  scale_color_brewer(palette = "Dark2")
## Warning: `geom_errobarh()` was deprecated in ggplot2 4.0.0.
## ℹ Please use the `orientation` argument of `geom_errorbar()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## `height` was translated to `width`.