#For continuous variables:
summary(ds[, c("Duration (in seconds)", "Age")])
## Duration (in seconds) Age
## Min. : 21.0 Min. :18.00
## 1st Qu.: 345.2 1st Qu.:34.00
## Median : 530.5 Median :49.00
## Mean : 1796.3 Mean :49.46
## 3rd Qu.: 854.8 3rd Qu.:63.75
## Max. :165109.0 Max. :87.00
sd(ds$"Duration (in seconds)")
## [1] 9922.884
sd(ds$"Age")
## [1] 18.12062
# Create age groups and count
age_distribution <- ds %>%
mutate(Age_Group = case_when(
Age >= 18 & Age <= 24 ~ "18-24",
Age >= 25 & Age <= 34 ~ "25-34",
Age >= 35 & Age <= 44 ~ "35-44",
Age >= 45 & Age <= 54 ~ "45-54",
Age >= 55 & Age <= 64 ~ "55-64",
Age >= 65 ~ "65+",
TRUE ~ "Unknown"
)) %>%
group_by(Age_Group) %>%
summarise(Count = n()) %>%
arrange(Age_Group)
print(age_distribution)
## # A tibble: 6 × 2
## Age_Group Count
## <chr> <int>
## 1 18-24 47
## 2 25-34 70
## 3 35-44 68
## 4 45-54 77
## 5 55-64 81
## 6 65+ 103
hist(ds$Age,
main="Age of participants",
xlab="Age",
ylab="Amount of people",
col="lightblue",
border="black")
hist(ds$`Duration (in seconds)`,
main="Completion time of survey",
xlab="Duration (in seconds)",
ylab="Amount of people",
col="lightblue",
border="black")
ds_test <- data.frame(
Age = c(23, 29, 40, 52, 18, 67, 30, 44, 25, NA)
)
#For categorical variables:
#gender
gender_table <- table(ds$Gender)
gender_proportions <- prop.table(table(ds$Gender))
gender_summary <- data.frame(
Count = gender_table,
Proportion = gender_proportions
)
print(gender_summary)
## Count.Var1 Count.Freq Proportion.Var1 Proportion.Freq
## 1 0 221 0 0.495515695
## 2 1 224 1 0.502242152
## 3 3 1 3 0.002242152
#education
edu_table <- table(ds$Education)
edu_proportions <- prop.table(table(ds$Education))
edu_summary <- data.frame(
Count = edu_table,
Proportion = edu_proportions
)
print(edu_summary)
## Count.Var1 Count.Freq Proportion.Var1 Proportion.Freq
## 1 1 93 1 0.2085202
## 2 2 183 2 0.4103139
## 3 3 170 3 0.3811659
#region
region_table <- table(ds$Region)
region_proportions <- prop.table(table(ds$Region))
region_summary <- data.frame(
Count = region_table,
Proportion = region_proportions
)
print(region_summary)
## Count.Var1 Count.Freq Proportion.Var1 Proportion.Freq
## 1 1 61 1 0.1367713
## 2 2 123 2 0.2757848
## 3 3 46 3 0.1031390
## 4 4 98 4 0.2197309
## 5 5 118 5 0.2645740
Gender: 0 = Male 1 = Female 2 = Non-binary 3 = prefer not to say
Region: 1 = Nielsen I 2 = Nielsen II 3 = Nielsen III 4 = Nielsen IV 5 = Nielsen V
# Perform & print reliability analysis (Cronbach's alpha) for items in the scale
print(psych::alpha(ds[, c("val_bio1", "val_bio2", "val_bio3", "val_bio4")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("val_bio1", "val_bio2", "val_bio3", "val_bio4")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.89 0.89 0.87 0.68 8.5 0.0081 4.6 1.6 0.66
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.88 0.89 0.91
## Duhachek 0.88 0.89 0.91
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## val_bio1 0.88 0.89 0.84 0.72 7.7 0.0095 0.0023 0.71
## val_bio2 0.87 0.87 0.82 0.68 6.4 0.0111 0.0061 0.64
## val_bio3 0.85 0.85 0.79 0.65 5.6 0.0123 0.0005 0.65
## val_bio4 0.86 0.86 0.80 0.67 6.0 0.0116 0.0016 0.65
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## val_bio1 429 0.83 0.84 0.75 0.71 4.8 1.7
## val_bio2 429 0.87 0.87 0.81 0.77 4.2 1.9
## val_bio3 429 0.90 0.90 0.86 0.81 4.6 1.8
## val_bio4 429 0.88 0.88 0.84 0.79 4.6 1.8
##
## Non missing response frequency for each item
## -1 0 1 2 3 4 5 6 7 miss
## val_bio1 0.00 0.00 0.02 0.06 0.20 0.11 0.19 0.22 0.19 0.04
## val_bio2 0.00 0.03 0.03 0.10 0.24 0.15 0.16 0.16 0.12 0.04
## val_bio3 0.01 0.01 0.03 0.04 0.21 0.13 0.17 0.21 0.18 0.04
## val_bio4 0.01 0.01 0.02 0.06 0.21 0.14 0.17 0.20 0.18 0.04
# Calculate the mean of the scale for each participant and save it as a new variable
ds$bio_val <- rowMeans(ds[, c("val_bio1", "val_bio2", "val_bio3", "val_bio4")], na.rm = TRUE)
summary(ds$bio_val)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## -0.50 3.50 4.75 4.55 5.75 7.00 17
sd(ds$bio_val, na.rm = TRUE)
## [1] 1.568191
# reliability analysis
print(psych::alpha(ds[, c("val_alt1", "val_alt2", "val_alt3", "val_alt4")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("val_alt1", "val_alt2", "val_alt3", "val_alt4")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.79 0.79 0.75 0.49 3.8 0.016 5.1 1.3 0.51
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.76 0.79 0.82
## Duhachek 0.76 0.79 0.82
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## val_alt1 0.72 0.72 0.65 0.46 2.6 0.023 0.00835 0.50
## val_alt2 0.76 0.76 0.68 0.51 3.1 0.020 0.00314 0.53
## val_alt3 0.71 0.71 0.62 0.44 2.4 0.024 0.00705 0.44
## val_alt4 0.77 0.77 0.69 0.53 3.3 0.019 0.00062 0.53
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## val_alt1 429 0.81 0.80 0.71 0.63 4.9 1.7
## val_alt2 429 0.75 0.76 0.64 0.57 5.7 1.5
## val_alt3 429 0.83 0.82 0.75 0.66 5.0 1.7
## val_alt4 429 0.75 0.75 0.61 0.54 4.6 1.6
##
## Non missing response frequency for each item
## -1 0 1 2 3 4 5 6 7 miss
## val_alt1 0 0.01 0.01 0.02 0.23 0.12 0.17 0.23 0.21 0.04
## val_alt2 0 0.00 0.00 0.02 0.10 0.08 0.12 0.22 0.44 0.04
## val_alt3 0 0.01 0.02 0.03 0.18 0.14 0.18 0.20 0.25 0.04
## val_alt4 0 0.01 0.01 0.06 0.19 0.19 0.20 0.21 0.14 0.04
# create scale
ds$alt_val <- rowMeans(ds[, c("val_alt1", "val_alt2", "val_alt3", "val_alt4")], na.rm = TRUE)
# Reliability analysis
print(psych::alpha(ds[, c("val_hed1", "val_hed2", "val_hed3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("val_hed1", "val_hed2", "val_hed3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.82 0.82 0.76 0.6 4.6 0.015 4.8 1.4 0.62
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.79 0.82 0.85
## Duhachek 0.79 0.82 0.85
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## val_hed1 0.77 0.78 0.63 0.63 3.5 0.021 NA 0.63
## val_hed2 0.72 0.72 0.56 0.56 2.5 0.027 NA 0.56
## val_hed3 0.76 0.76 0.62 0.62 3.2 0.022 NA 0.62
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## val_hed1 429 0.84 0.85 0.72 0.65 4.7 1.6
## val_hed2 429 0.88 0.88 0.78 0.71 5.0 1.7
## val_hed3 429 0.85 0.85 0.73 0.67 4.6 1.6
##
## Non missing response frequency for each item
## -1 0 1 2 3 4 5 6 7 miss
## val_hed1 0 0.01 0.01 0.04 0.24 0.14 0.20 0.21 0.15 0.04
## val_hed2 0 0.01 0.01 0.04 0.17 0.09 0.17 0.28 0.22 0.04
## val_hed3 0 0.01 0.02 0.06 0.21 0.13 0.23 0.23 0.12 0.04
# Calculate the mean of the scale for each participant and save it as a new variable
ds$hed_val <- rowMeans(ds[, c("val_hed1", "val_hed2", "val_hed3")], na.rm = TRUE)
print(psych::alpha(ds[, c("val_ego1", "val_ego2", "val_ego3", "val_ego4", "val_ego5")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("val_ego1", "val_ego2", "val_ego3", "val_ego4",
## "val_ego5")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.87 0.87 0.85 0.57 6.6 0.0098 2.4 1.6 0.57
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.85 0.87 0.89
## Duhachek 0.85 0.87 0.89
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## val_ego1 0.83 0.83 0.80 0.56 5.0 0.0130 0.0085 0.54
## val_ego2 0.85 0.85 0.82 0.58 5.5 0.0119 0.0125 0.59
## val_ego3 0.83 0.83 0.79 0.55 4.9 0.0133 0.0067 0.56
## val_ego4 0.82 0.82 0.78 0.53 4.6 0.0139 0.0075 0.51
## val_ego5 0.87 0.87 0.84 0.63 6.8 0.0098 0.0032 0.63
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## val_ego1 429 0.83 0.83 0.78 0.72 1.3 2.1
## val_ego2 429 0.79 0.79 0.71 0.67 2.9 1.9
## val_ego3 429 0.84 0.84 0.80 0.74 2.3 2.0
## val_ego4 429 0.86 0.86 0.83 0.77 2.3 2.0
## val_ego5 429 0.72 0.72 0.60 0.56 3.3 2.1
##
## Non missing response frequency for each item
## -1 0 1 2 3 4 5 6 7 miss
## val_ego1 0.18 0.32 0.11 0.14 0.07 0.06 0.06 0.03 0.02 0.04
## val_ego2 0.03 0.10 0.10 0.18 0.24 0.14 0.11 0.06 0.04 0.04
## val_ego3 0.09 0.14 0.11 0.21 0.20 0.11 0.07 0.04 0.03 0.04
## val_ego4 0.06 0.18 0.10 0.20 0.19 0.11 0.08 0.03 0.04 0.04
## val_ego5 0.03 0.08 0.09 0.12 0.26 0.12 0.12 0.11 0.07 0.04
ds$ego_val <- rowMeans(ds[, c("val_ego1", "val_ego2", "val_ego3", "val_ego4", "val_ego5")], na.rm = TRUE)
print(psych::alpha(ds[, c("PA1","PA2","PA3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("PA1", "PA2", "PA3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.91 0.91 0.87 0.77 9.9 0.0077 5.2 1.3 0.77
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.89 0.91 0.92
## Duhachek 0.89 0.91 0.92
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## PA1 0.84 0.84 0.72 0.72 5.1 0.0154 NA 0.72
## PA2 0.90 0.90 0.81 0.81 8.6 0.0099 NA 0.81
## PA3 0.87 0.87 0.77 0.77 6.7 0.0123 NA 0.77
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## PA1 426 0.93 0.94 0.90 0.85 5.2 1.3
## PA2 426 0.91 0.90 0.82 0.78 5.1 1.4
## PA3 426 0.92 0.92 0.86 0.81 5.2 1.4
##
## Non missing response frequency for each item
## 1 2 3 4 5 6 7 miss
## PA1 0.02 0.02 0.04 0.16 0.30 0.32 0.15 0.04
## PA2 0.04 0.03 0.06 0.15 0.28 0.31 0.14 0.04
## PA3 0.03 0.02 0.06 0.14 0.29 0.33 0.14 0.04
ds$PA <- rowMeans(ds[, c("PA1","PA2","PA3")], na.rm = TRUE)
print(psych::alpha(ds[, c("AR1","AR2","AR3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("AR1", "AR2", "AR3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.88 0.88 0.84 0.71 7.5 0.0096 4.8 1.3 0.68
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.86 0.88 0.9
## Duhachek 0.86 0.88 0.9
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## AR1 0.80 0.80 0.66 0.66 3.9 0.019 NA 0.66
## AR2 0.89 0.89 0.80 0.80 8.1 0.010 NA 0.80
## AR3 0.81 0.81 0.68 0.68 4.3 0.018 NA 0.68
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## AR1 426 0.92 0.92 0.87 0.82 4.7 1.4
## AR2 426 0.86 0.87 0.74 0.71 5.1 1.4
## AR3 426 0.92 0.91 0.86 0.80 4.7 1.5
##
## Non missing response frequency for each item
## 1 2 3 4 5 6 7 miss
## AR1 0.04 0.06 0.09 0.17 0.36 0.20 0.07 0.04
## AR2 0.03 0.03 0.06 0.16 0.28 0.33 0.11 0.04
## AR3 0.04 0.06 0.06 0.19 0.32 0.25 0.08 0.04
ds$AR <- rowMeans(ds[, c("AR1","AR2","AR3")], na.rm = TRUE)
print(psych::alpha(ds[, c("SE1","SE2","SE3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("SE1", "SE2", "SE3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.75 0.75 0.71 0.5 3 0.021 4.5 1.3 0.41
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.71 0.75 0.79
## Duhachek 0.71 0.75 0.79
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## SE1 0.53 0.53 0.36 0.36 1.1 0.045 NA 0.36
## SE2 0.59 0.59 0.41 0.41 1.4 0.039 NA 0.41
## SE3 0.84 0.84 0.72 0.72 5.1 0.015 NA 0.72
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## SE1 411 0.87 0.87 0.82 0.69 4.2 1.6
## SE2 411 0.86 0.85 0.78 0.64 4.1 1.6
## SE3 411 0.72 0.72 0.46 0.42 5.0 1.5
##
## Non missing response frequency for each item
## 1 2 3 4 5 6 7 miss
## SE1 0.07 0.10 0.07 0.27 0.29 0.14 0.06 0.08
## SE2 0.09 0.11 0.09 0.24 0.27 0.14 0.05 0.08
## SE3 0.03 0.05 0.07 0.16 0.21 0.33 0.14 0.08
ds$SE <- rowMeans(ds[, c("SE1","SE2","SE3")], na.rm = TRUE)
print(psych::alpha(ds[, c("OE1","OE2","OE3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("OE1", "OE2", "OE3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.9 0.9 0.86 0.75 9.2 0.0081 4.4 1.4 0.74
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.88 0.9 0.92
## Duhachek 0.89 0.9 0.92
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## OE1 0.85 0.85 0.74 0.74 5.7 0.014 NA 0.74
## OE2 0.89 0.89 0.80 0.80 8.1 0.010 NA 0.80
## OE3 0.84 0.84 0.72 0.72 5.1 0.016 NA 0.72
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## OE1 411 0.92 0.92 0.86 0.81 4.2 1.6
## OE2 411 0.90 0.90 0.81 0.77 4.6 1.6
## OE3 411 0.93 0.93 0.88 0.83 4.3 1.6
##
## Non missing response frequency for each item
## 1 2 3 4 5 6 7 miss
## OE1 0.09 0.09 0.10 0.25 0.29 0.14 0.04 0.08
## OE2 0.06 0.06 0.09 0.21 0.26 0.23 0.09 0.08
## OE3 0.07 0.08 0.09 0.24 0.30 0.17 0.06 0.08
ds$OE <- rowMeans(ds[, c("OE1","OE2","OE3")], na.rm = TRUE)
print(psych::alpha(ds[, c("PN1","PN2","PN3", "PN4", "PN5")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("PN1", "PN2", "PN3", "PN4", "PN5")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.96 0.96 0.95 0.82 23 0.0032 3.9 1.6 0.83
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.95 0.96 0.96
## Duhachek 0.95 0.96 0.96
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## PN1 0.95 0.95 0.93 0.81 17 0.0042 0.00190 0.81
## PN2 0.94 0.94 0.93 0.81 17 0.0044 0.00104 0.81
## PN3 0.96 0.96 0.94 0.84 21 0.0034 0.00026 0.84
## PN4 0.95 0.95 0.93 0.81 17 0.0042 0.00090 0.81
## PN5 0.95 0.95 0.93 0.81 18 0.0042 0.00163 0.81
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## PN1 410 0.93 0.93 0.91 0.89 3.9 1.8
## PN2 410 0.94 0.94 0.92 0.90 3.9 1.8
## PN3 410 0.89 0.89 0.85 0.83 4.2 1.7
## PN4 410 0.93 0.93 0.91 0.89 3.9 1.8
## PN5 410 0.93 0.93 0.91 0.89 3.8 1.8
##
## Non missing response frequency for each item
## 1 2 3 4 5 6 7 miss
## PN1 0.14 0.12 0.09 0.20 0.25 0.14 0.06 0.08
## PN2 0.15 0.11 0.11 0.21 0.22 0.16 0.04 0.08
## PN3 0.12 0.09 0.08 0.21 0.28 0.16 0.06 0.08
## PN4 0.15 0.13 0.09 0.19 0.26 0.14 0.04 0.08
## PN5 0.16 0.11 0.10 0.25 0.19 0.14 0.05 0.08
ds$PN <- rowMeans(ds[, c("PN1","PN2","PN3", "PN4", "PN5")], na.rm = TRUE)
describe(ds[, c("CCB_mix1", "CCB_mix2", "CCB_mix3", "CCB_gov1", "CCB_gov2", "CCB_gov3", "CCB_gov4", "CCB_gov5", "CCB_busi1", "CCB_busi2", "CCB_busi3", "CCB_ind1", "CCB_ind2", "CCB_ind3", "CCB_ind4", "CCB_ind5", "CCB_ind6", "CCB_ind7", "CCB_ind8", "CCB_ind9")])
## vars n mean sd median trimmed mad min max range skew kurtosis
## CCB_mix1 1 420 1.34 1.56 1 1.13 1.48 0 5 5 0.76 -0.77
## CCB_mix2 2 420 1.90 1.60 2 1.82 2.97 0 5 5 0.17 -1.29
## CCB_mix3 3 420 1.78 1.59 2 1.68 2.97 0 5 5 0.24 -1.29
## CCB_gov1 4 418 0.76 1.29 0 0.49 0.00 0 5 5 1.50 0.96
## CCB_gov2 5 418 1.89 1.66 2 1.77 1.48 0 5 5 0.31 -1.17
## CCB_gov3 6 418 0.83 1.35 0 0.55 0.00 0 5 5 1.42 0.65
## CCB_gov4 7 418 2.77 1.73 3 2.84 1.48 0 5 5 -0.35 -1.11
## CCB_gov5 8 418 1.03 1.45 0 0.79 0.00 0 5 5 1.08 -0.22
## CCB_busi1 9 414 1.43 1.58 1 1.25 1.48 0 5 5 0.59 -1.05
## CCB_busi2 10 414 1.22 1.51 0 1.00 0.00 0 5 5 0.83 -0.66
## CCB_busi3 11 414 1.53 1.50 1 1.39 1.48 0 5 5 0.44 -1.09
## CCB_ind1 12 412 3.21 1.43 4 3.38 1.48 0 5 5 -0.89 0.07
## CCB_ind2 13 412 1.94 1.55 2 1.88 1.48 0 5 5 0.08 -1.27
## CCB_ind3 14 412 1.94 1.57 2 1.87 1.48 0 5 5 0.12 -1.22
## CCB_ind4 15 412 2.24 1.56 3 2.25 1.48 0 5 5 -0.22 -1.21
## CCB_ind5 16 412 1.87 1.59 2 1.78 1.48 0 5 5 0.19 -1.25
## CCB_ind6 17 412 2.33 1.55 3 2.33 1.48 0 5 5 -0.23 -1.04
## CCB_ind7 18 412 2.09 1.54 2 2.05 1.48 0 5 5 0.00 -1.16
## CCB_ind8 19 412 1.86 1.54 2 1.78 1.48 0 5 5 0.14 -1.24
## CCB_ind9 20 412 1.28 1.57 0 1.05 0.00 0 5 5 0.83 -0.69
## se
## CCB_mix1 0.08
## CCB_mix2 0.08
## CCB_mix3 0.08
## CCB_gov1 0.06
## CCB_gov2 0.08
## CCB_gov3 0.07
## CCB_gov4 0.08
## CCB_gov5 0.07
## CCB_busi1 0.08
## CCB_busi2 0.07
## CCB_busi3 0.07
## CCB_ind1 0.07
## CCB_ind2 0.08
## CCB_ind3 0.08
## CCB_ind4 0.08
## CCB_ind5 0.08
## CCB_ind6 0.08
## CCB_ind7 0.08
## CCB_ind8 0.08
## CCB_ind9 0.08
#Correlations between CCBs
CCB_spec <- ds[, c("CCB_mix1", "CCB_mix2", "CCB_mix3",
"CCB_gov1", "CCB_gov2", "CCB_gov3", "CCB_gov4", "CCB_gov5",
"CCB_busi1", "CCB_busi2", "CCB_busi3",
"CCB_ind1", "CCB_ind2", "CCB_ind3", "CCB_ind4", "CCB_ind5", "CCB_ind6", "CCB_ind7", "CCB_ind8", "CCB_ind9")]
# Calculate the correlation matrix
cor_matrix_CCB <- cor(CCB_spec, use = "complete.obs")
print(cor_matrix_CCB)
## CCB_mix1 CCB_mix2 CCB_mix3 CCB_gov1 CCB_gov2 CCB_gov3 CCB_gov4
## CCB_mix1 1.0000000 0.5720616 0.6057514 0.5564438 0.4145664 0.6255236 0.2345673
## CCB_mix2 0.5720616 1.0000000 0.4556980 0.4604458 0.5115177 0.4537967 0.4319843
## CCB_mix3 0.6057514 0.4556980 1.0000000 0.4594064 0.4597195 0.4554682 0.2968904
## CCB_gov1 0.5564438 0.4604458 0.4594064 1.0000000 0.4737257 0.8135960 0.2432086
## CCB_gov2 0.4145664 0.5115177 0.4597195 0.4737257 1.0000000 0.5136664 0.5058714
## CCB_gov3 0.6255236 0.4537967 0.4554682 0.8135960 0.5136664 1.0000000 0.2695323
## CCB_gov4 0.2345673 0.4319843 0.2968904 0.2432086 0.5058714 0.2695323 1.0000000
## CCB_gov5 0.5722379 0.4840369 0.5020573 0.7594525 0.4793542 0.7408906 0.2934833
## CCB_busi1 0.4951238 0.4252040 0.5047336 0.5550637 0.4632683 0.5556867 0.2537190
## CCB_busi2 0.5606001 0.4892594 0.4285542 0.6319465 0.4578543 0.6248231 0.2804543
## CCB_busi3 0.4635442 0.5290759 0.4122688 0.5542064 0.5823807 0.5566919 0.4300468
## CCB_ind1 0.2729891 0.4319399 0.2298832 0.1232120 0.3667370 0.1528994 0.3944170
## CCB_ind2 0.5339711 0.5572663 0.4528787 0.5047567 0.5165156 0.4959130 0.3661929
## CCB_ind3 0.5244121 0.5591097 0.4746677 0.4949141 0.4978314 0.4679155 0.3398526
## CCB_ind4 0.4735666 0.5059303 0.4905088 0.4591215 0.5424343 0.4432111 0.3936814
## CCB_ind5 0.5162392 0.5184814 0.4833951 0.5208035 0.5285889 0.4846703 0.3064189
## CCB_ind6 0.4454967 0.5085483 0.4653725 0.3592318 0.5284693 0.3686282 0.4162544
## CCB_ind7 0.4699267 0.5013439 0.4571272 0.4256156 0.5116103 0.4283186 0.3341511
## CCB_ind8 0.5084795 0.5414205 0.4935626 0.5257115 0.4819176 0.4906807 0.3396226
## CCB_ind9 0.5810837 0.4832448 0.4530587 0.6247691 0.4658483 0.6172011 0.2475511
## CCB_gov5 CCB_busi1 CCB_busi2 CCB_busi3 CCB_ind1 CCB_ind2 CCB_ind3
## CCB_mix1 0.5722379 0.4951238 0.5606001 0.4635442 0.2729891 0.5339711 0.5244121
## CCB_mix2 0.4840369 0.4252040 0.4892594 0.5290759 0.4319399 0.5572663 0.5591097
## CCB_mix3 0.5020573 0.5047336 0.4285542 0.4122688 0.2298832 0.4528787 0.4746677
## CCB_gov1 0.7594525 0.5550637 0.6319465 0.5542064 0.1232120 0.5047567 0.4949141
## CCB_gov2 0.4793542 0.4632683 0.4578543 0.5823807 0.3667370 0.5165156 0.4978314
## CCB_gov3 0.7408906 0.5556867 0.6248231 0.5566919 0.1528994 0.4959130 0.4679155
## CCB_gov4 0.2934833 0.2537190 0.2804543 0.4300468 0.3944170 0.3661929 0.3398526
## CCB_gov5 1.0000000 0.5712348 0.6238251 0.5278595 0.1778582 0.4982157 0.4808490
## CCB_busi1 0.5712348 1.0000000 0.6125631 0.5622968 0.2543563 0.5109607 0.5269893
## CCB_busi2 0.6238251 0.6125631 1.0000000 0.5968630 0.2482566 0.5221019 0.4952378
## CCB_busi3 0.5278595 0.5622968 0.5968630 1.0000000 0.3337540 0.5455956 0.5363620
## CCB_ind1 0.1778582 0.2543563 0.2482566 0.3337540 1.0000000 0.4667446 0.4447602
## CCB_ind2 0.4982157 0.5109607 0.5221019 0.5455956 0.4667446 1.0000000 0.7925313
## CCB_ind3 0.4808490 0.5269893 0.4952378 0.5363620 0.4447602 0.7925313 1.0000000
## CCB_ind4 0.4594036 0.4932706 0.4821544 0.5579790 0.5640424 0.7516865 0.7418770
## CCB_ind5 0.4997541 0.5236248 0.5260558 0.5267787 0.4699479 0.7245113 0.7323054
## CCB_ind6 0.4110468 0.4310311 0.4655849 0.5349480 0.5528530 0.7050541 0.7518626
## CCB_ind7 0.4435578 0.4537861 0.4587261 0.5239009 0.4873568 0.6963397 0.7095932
## CCB_ind8 0.5560784 0.5390539 0.5295991 0.5290883 0.4098385 0.7131132 0.7367051
## CCB_ind9 0.5915620 0.5495181 0.5942827 0.5051637 0.2830098 0.6517087 0.6676165
## CCB_ind4 CCB_ind5 CCB_ind6 CCB_ind7 CCB_ind8 CCB_ind9
## CCB_mix1 0.4735666 0.5162392 0.4454967 0.4699267 0.5084795 0.5810837
## CCB_mix2 0.5059303 0.5184814 0.5085483 0.5013439 0.5414205 0.4832448
## CCB_mix3 0.4905088 0.4833951 0.4653725 0.4571272 0.4935626 0.4530587
## CCB_gov1 0.4591215 0.5208035 0.3592318 0.4256156 0.5257115 0.6247691
## CCB_gov2 0.5424343 0.5285889 0.5284693 0.5116103 0.4819176 0.4658483
## CCB_gov3 0.4432111 0.4846703 0.3686282 0.4283186 0.4906807 0.6172011
## CCB_gov4 0.3936814 0.3064189 0.4162544 0.3341511 0.3396226 0.2475511
## CCB_gov5 0.4594036 0.4997541 0.4110468 0.4435578 0.5560784 0.5915620
## CCB_busi1 0.4932706 0.5236248 0.4310311 0.4537861 0.5390539 0.5495181
## CCB_busi2 0.4821544 0.5260558 0.4655849 0.4587261 0.5295991 0.5942827
## CCB_busi3 0.5579790 0.5267787 0.5349480 0.5239009 0.5290883 0.5051637
## CCB_ind1 0.5640424 0.4699479 0.5528530 0.4873568 0.4098385 0.2830098
## CCB_ind2 0.7516865 0.7245113 0.7050541 0.6963397 0.7131132 0.6517087
## CCB_ind3 0.7418770 0.7323054 0.7518626 0.7095932 0.7367051 0.6676165
## CCB_ind4 1.0000000 0.7763664 0.7759890 0.7834364 0.7303614 0.6261047
## CCB_ind5 0.7763664 1.0000000 0.7249143 0.7272486 0.7256459 0.6719801
## CCB_ind6 0.7759890 0.7249143 1.0000000 0.7432137 0.6903182 0.5495848
## CCB_ind7 0.7834364 0.7272486 0.7432137 1.0000000 0.6716876 0.5971245
## CCB_ind8 0.7303614 0.7256459 0.6903182 0.6716876 1.0000000 0.6774448
## CCB_ind9 0.6261047 0.6719801 0.5495848 0.5971245 0.6774448 1.0000000
corrplot(cor_matrix_CCB,
method = "color", # Use color to represent correlation values
type = "lower", # Display the full matrix
col = brewer.pal(n = 10, name = "RdYlBu"),, # Color palette from red (negative) to blue (positive)
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)
# Perform & print reliability analysis (Cronbach's alpha) for items in the scale
print(psych::alpha(ds[, c("CCB_gov1", "CCB_gov2", "CCB_gov3", "CCB_gov4", "CCB_gov5")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("CCB_gov1", "CCB_gov2", "CCB_gov3", "CCB_gov4",
## "CCB_gov5")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.83 0.84 0.85 0.51 5.2 0.014 1.5 1.2 0.49
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.8 0.83 0.85
## Duhachek 0.8 0.83 0.85
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## CCB_gov1 0.77 0.78 0.77 0.47 3.5 0.018 0.029 0.49
## CCB_gov2 0.79 0.82 0.82 0.52 4.4 0.017 0.075 0.52
## CCB_gov3 0.76 0.77 0.77 0.46 3.4 0.019 0.032 0.48
## CCB_gov4 0.86 0.87 0.86 0.63 6.8 0.011 0.025 0.63
## CCB_gov5 0.77 0.78 0.80 0.47 3.6 0.019 0.041 0.49
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## CCB_gov1 418 0.82 0.85 0.84 0.72 0.76 1.3
## CCB_gov2 418 0.78 0.76 0.66 0.62 1.89 1.7
## CCB_gov3 418 0.83 0.86 0.85 0.73 0.83 1.4
## CCB_gov4 418 0.64 0.60 0.44 0.41 2.77 1.7
## CCB_gov5 418 0.82 0.84 0.81 0.71 1.03 1.5
##
## Non missing response frequency for each item
## 0 1 2 3 4 5 miss
## CCB_gov1 0.69 0.07 0.10 0.08 0.06 0.01 0.06
## CCB_gov2 0.31 0.16 0.12 0.23 0.10 0.08 0.06
## CCB_gov3 0.67 0.08 0.10 0.07 0.07 0.01 0.06
## CCB_gov4 0.18 0.07 0.12 0.23 0.19 0.20 0.06
## CCB_gov5 0.60 0.09 0.10 0.12 0.07 0.02 0.06
# Calculate the mean of the scale for each participant and save it as a new variable
ds$CCB_gov <- rowMeans(ds[, c("CCB_gov1", "CCB_gov2", "CCB_gov3", "CCB_gov4", "CCB_gov5")], na.rm = TRUE)
summary(ds$CCB_gov)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.000 0.600 1.200 1.457 2.200 4.800 28
hist(ds$CCB_gov,
main="Engagement in circular citizenship behaviours to influence the government",
xlab="Frequency of engagement to influence the government",
ylab="Amount of people",
col = brewer.pal(n = 10, name = "RdYlBu"),
border="black")
# Perform & print reliability analysis (Cronbach's alpha) for items in the scale
print(psych::alpha(ds[, c("CCB_busi1", "CCB_busi2", "CCB_busi3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("CCB_busi1", "CCB_busi2", "CCB_busi3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.81 0.81 0.74 0.59 4.3 0.015 1.4 1.3 0.6
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.78 0.81 0.84
## Duhachek 0.78 0.81 0.84
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## CCB_busi1 0.75 0.75 0.60 0.60 3.0 0.024 NA 0.60
## CCB_busi2 0.72 0.72 0.56 0.56 2.5 0.027 NA 0.56
## CCB_busi3 0.76 0.76 0.61 0.61 3.1 0.023 NA 0.61
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## CCB_busi1 414 0.85 0.85 0.73 0.65 1.4 1.6
## CCB_busi2 414 0.86 0.86 0.76 0.68 1.2 1.5
## CCB_busi3 414 0.84 0.84 0.72 0.65 1.5 1.5
##
## Non missing response frequency for each item
## 0 1 2 3 4 5 miss
## CCB_busi1 0.47 0.09 0.12 0.19 0.09 0.03 0.07
## CCB_busi2 0.53 0.09 0.14 0.13 0.08 0.02 0.07
## CCB_busi3 0.39 0.14 0.16 0.21 0.09 0.02 0.07
# Calculate the mean of the scale for each participant and save it as a new variable
ds$CCB_busi <- rowMeans(ds[, c("CCB_busi1", "CCB_busi2", "CCB_busi3")], na.rm = TRUE)
summary(ds$CCB_busi)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.000 0.000 1.000 1.395 2.333 5.000 32
hist(ds$CCB_busi,
main="Engagement in circular citizenship behaviours to influence businesses",
xlab="Frequency of engagement to influence businesses",
ylab="Amount of people",
col = brewer.pal(n = 10, name = "RdYlBu"),
border="black")
# Perform & print reliability analysis (Cronbach's alpha) for items in the scale
print(psych::alpha(ds[, c("CCB_ind1", "CCB_ind2", "CCB_ind3", "CCB_ind4", "CCB_ind5", "CCB_ind6", "CCB_ind7", "CCB_ind8", "CCB_ind9")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("CCB_ind1", "CCB_ind2", "CCB_ind3", "CCB_ind4",
## "CCB_ind5", "CCB_ind6", "CCB_ind7", "CCB_ind8", "CCB_ind9")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.95 0.94 0.95 0.65 17 0.0038 2.1 1.3 0.7
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.94 0.95 0.95
## Duhachek 0.94 0.95 0.95
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## CCB_ind1 0.95 0.95 0.95 0.71 19 0.0035 0.0031 0.72
## CCB_ind2 0.94 0.94 0.94 0.64 14 0.0045 0.0165 0.68
## CCB_ind3 0.94 0.93 0.93 0.64 14 0.0046 0.0157 0.68
## CCB_ind4 0.93 0.93 0.93 0.63 14 0.0047 0.0161 0.68
## CCB_ind5 0.94 0.93 0.94 0.64 14 0.0046 0.0165 0.68
## CCB_ind6 0.94 0.94 0.94 0.64 14 0.0045 0.0170 0.69
## CCB_ind7 0.94 0.94 0.94 0.65 15 0.0044 0.0169 0.70
## CCB_ind8 0.94 0.94 0.94 0.65 15 0.0044 0.0163 0.70
## CCB_ind9 0.94 0.94 0.94 0.67 16 0.0040 0.0134 0.72
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## CCB_ind1 412 0.62 0.62 0.56 0.53 3.2 1.4
## CCB_ind2 412 0.87 0.87 0.85 0.83 1.9 1.5
## CCB_ind3 412 0.88 0.88 0.87 0.84 1.9 1.6
## CCB_ind4 412 0.90 0.90 0.90 0.87 2.2 1.6
## CCB_ind5 412 0.88 0.88 0.86 0.84 1.9 1.6
## CCB_ind6 412 0.87 0.87 0.85 0.83 2.3 1.5
## CCB_ind7 412 0.86 0.86 0.84 0.81 2.1 1.5
## CCB_ind8 412 0.85 0.85 0.83 0.81 1.9 1.5
## CCB_ind9 412 0.77 0.76 0.73 0.70 1.3 1.6
##
## Non missing response frequency for each item
## 0 1 2 3 4 5 miss
## CCB_ind1 0.09 0.05 0.08 0.27 0.34 0.16 0.08
## CCB_ind2 0.29 0.14 0.13 0.28 0.13 0.04 0.08
## CCB_ind3 0.29 0.12 0.15 0.27 0.12 0.05 0.08
## CCB_ind4 0.24 0.10 0.12 0.32 0.18 0.04 0.08
## CCB_ind5 0.32 0.12 0.14 0.25 0.12 0.05 0.08
## CCB_ind6 0.21 0.09 0.14 0.34 0.16 0.07 0.08
## CCB_ind7 0.24 0.13 0.16 0.28 0.14 0.05 0.08
## CCB_ind8 0.31 0.12 0.15 0.26 0.12 0.03 0.08
## CCB_ind9 0.52 0.10 0.12 0.13 0.09 0.03 0.08
# Calculate the mean of the scale for each participant and save it as a new variable
ds$CCB_ind <- rowMeans(ds[, c("CCB_ind1", "CCB_ind2", "CCB_ind3", "CCB_ind4", "CCB_ind5", "CCB_ind6", "CCB_ind7", "CCB_ind8", "CCB_ind9")], na.rm = TRUE)
summary(ds$CCB_ind)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.0000 0.8889 2.2222 2.0847 3.0000 5.0000 34
hist(ds$CCB_ind,
main="Engagement in circular citizenship behaviours to influence other citizens",
xlab="Frequency of engagement to influence other citizens",
ylab="Amount of people",
col = brewer.pal(n = 10, name = "RdYlBu"),
border="black")
# Perform & print reliability analysis (Cronbach's alpha) for items in the scale
print(psych::alpha(ds[, c("CCB_mix1", "CCB_mix2", "CCB_mix3")]))
##
## Reliability analysis
## Call: psych::alpha(x = ds[, c("CCB_mix1", "CCB_mix2", "CCB_mix3")])
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.78 0.78 0.72 0.55 3.6 0.018 1.7 1.3 0.57
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.75 0.78 0.82
## Duhachek 0.75 0.78 0.82
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## CCB_mix1 0.63 0.63 0.46 0.46 1.7 0.035 NA 0.46
## CCB_mix2 0.76 0.76 0.61 0.61 3.2 0.023 NA 0.61
## CCB_mix3 0.73 0.73 0.57 0.57 2.7 0.026 NA 0.57
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## CCB_mix1 420 0.87 0.87 0.79 0.69 1.3 1.6
## CCB_mix2 420 0.81 0.81 0.65 0.57 1.9 1.6
## CCB_mix3 420 0.83 0.83 0.69 0.60 1.8 1.6
##
## Non missing response frequency for each item
## 0 1 2 3 4 5 miss
## CCB_mix1 0.49 0.11 0.14 0.13 0.10 0.03 0.06
## CCB_mix2 0.31 0.12 0.16 0.22 0.15 0.04 0.06
## CCB_mix3 0.35 0.12 0.13 0.24 0.13 0.04 0.06
# Calculate the mean of the scale for each participant and save it as a new variable
ds$CCB_mix <- rowMeans(ds[, c("CCB_mix1", "CCB_mix2", "CCB_mix3")], na.rm = TRUE)
summary(ds$CCB_mix)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.0000 0.3333 1.3333 1.6722 2.6667 5.0000 26
hist(ds$CCB_mix,
main="Engagement in circular citizenship behaviours to influence various actors",
xlab="Frequency of engagement to influence various actors",
ylab="Amount of people",
col = brewer.pal(n = 10, name = "RdYlBu"),
border="black")
#### Comparison of CCB means
#t.test(ds$CCB_busi, ds$CCB_gov, paired = FALSE)
#t.test(ds$CCB_busi, ds$CCB_ind, paired = FALSE) #sig
#t.test(ds$CCB_busi, ds$CCB_mix, paired = FALSE) #sig
#t.test(ds$CCB_ind, ds$CCB_gov, paired = FALSE) #sig
#t.test(ds$CCB_mix, ds$CCB_gov, paired = FALSE) #sig
#t.test(ccb_busi, ccb_ind, paired = TRUE)
#t.test(ccb_gov, ccb_ind, paired = TRUE)
library(apaTables)
#apa table
apa.cor.table(ds[, c("bio_val", "alt_val","hed_val", "ego_val", "PA", "AR", "SE", "OE", "PN", "CCB_gov", "CCB_busi", "CCB_ind", "CCB_mix" )], filename = "Correlation table VBN & CCB.doc")
##
##
## Means, standard deviations, and correlations with confidence intervals
##
##
## Variable M SD 1 2 3 4
## 1. bio_val 4.55 1.57
##
## 2. alt_val 5.06 1.28 .70**
## [.65, .74]
##
## 3. hed_val 4.77 1.42 .25** .35**
## [.16, .33] [.27, .43]
##
## 4. ego_val 2.43 1.65 .17** .08 .29**
## [.07, .26] [-.01, .18] [.20, .38]
##
## 5. PA 5.17 1.25 .65** .48** .18** .07
## [.59, .70] [.40, .55] [.09, .27] [-.02, .17]
##
## 6. AR 4.83 1.28 .61** .47** .11* .17**
## [.54, .66] [.39, .54] [.01, .20] [.07, .26]
##
## 7. SE 4.46 1.28 .45** .34** .19** .32**
## [.37, .53] [.25, .42] [.10, .28] [.23, .41]
##
## 8. OE 4.36 1.43 .50** .37** .14** .28**
## [.43, .57] [.28, .45] [.04, .23] [.18, .36]
##
## 9. PN 3.93 1.63 .47** .32** .03 .36**
## [.39, .54] [.23, .40] [-.07, .13] [.28, .44]
##
## 10. CCB_gov 1.46 1.15 .33** .19** .05 .45**
## [.24, .41] [.09, .28] [-.04, .15] [.37, .52]
##
## 11. CCB_busi 1.39 1.30 .31** .15** .00 .47**
## [.22, .39] [.05, .24] [-.10, .10] [.39, .54]
##
## 12. CCB_ind 2.08 1.29 .48** .33** .08 .37**
## [.40, .55] [.24, .41] [-.02, .18] [.28, .45]
##
## 13. CCB_mix 1.67 1.32 .35** .22** .03 .42**
## [.27, .44] [.12, .31] [-.07, .12] [.34, .49]
##
## 5 6 7 8 9 10 11
##
##
##
##
##
##
##
##
##
##
##
##
##
##
## .78**
## [.74, .81]
##
## .45** .48**
## [.37, .53] [.40, .55]
##
## .54** .58** .67**
## [.47, .60] [.51, .64] [.61, .72]
##
## .46** .54** .61** .75**
## [.38, .53] [.47, .61] [.54, .67] [.71, .79]
##
## .25** .34** .43** .46** .57**
## [.16, .34] [.25, .42] [.35, .51] [.38, .53] [.50, .63]
##
## .23** .33** .43** .49** .57** .76**
## [.13, .32] [.24, .42] [.35, .51] [.42, .56] [.50, .63] [.72, .80]
##
## .41** .50** .55** .66** .75** .68** .69**
## [.33, .49] [.42, .57] [.48, .61] [.60, .71] [.71, .79] [.62, .73] [.64, .74]
##
## .28** .35** .40** .50** .56** .70** .67**
## [.19, .36] [.26, .43] [.31, .47] [.42, .57] [.49, .63] [.65, .75] [.62, .72]
##
## 12
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
## .69**
## [.64, .74]
##
##
## Note. M and SD are used to represent mean and standard deviation, respectively.
## Values in square brackets indicate the 95% confidence interval.
## The confidence interval is a plausible range of population correlations
## that could have caused the sample correlation (Cumming, 2014).
## * indicates p < .05. ** indicates p < .01.
##
#coloured correlation figure
vbn_ccb <- ds[, c("bio_val", "alt_val","hed_val", "ego_val", "PA", "AR", "SE", "OE", "PN", "CCB_gov", "CCB_busi", "CCB_ind", "CCB_mix" )]
cor_matrix <- cor(vbn_ccb, use = "complete.obs")
rounded_cor_matrix_spec <- round(cor_matrix, 2)
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 = FALSE) # Optionally remove the diagonal (set to TRUE to include)
# Assumption checks
model_val_PA <- lm(PA ~ bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
#1. Linearity
plot(model_val_PA$fitted.values, model_val_PA$residuals, abline(h = 0, col = "red"))
#2. Independence of errors
dwtest(model_val_PA)
##
## Durbin-Watson test
##
## data: model_val_PA
## DW = 1.8247, p-value = 0.03489
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity
plot(model_val_PA$fitted.values, model_val_PA$residuals, abline(h = 0, col = "red"))
bptest(model_val_PA)
##
## studentized Breusch-Pagan test
##
## data: model_val_PA
## BP = 9.9986, df = 4, p-value = 0.04045
# --> A significant p-value indicates heteroscedasticity.: here p = 0.04 -> not fully constant
#4. Normality of residuals
hist(model_val_PA$residuals)
# Q-Q plot
qqnorm(model_val_PA$residuals)
#Shapiro Wilk Test to test normality
shapiro.test(model_val_PA$residuals)
##
## Shapiro-Wilk normality test
##
## data: model_val_PA$residuals
## W = 0.94648, p-value = 2.796e-11
#--> significant, suggests normality is not given
#5. Multicollinearity
car::vif(model_val_PA)
## bio_val_z alt_val_z hed_val_z ego_val_z
## 2.022330 2.138771 1.239184 1.123356
#Regression model
summary(lm(PA_z ~ bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds))
##
## Call:
## lm(formula = PA_z ~ bio_val_z + alt_val_z + hed_val_z + ego_val_z,
## data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.00649 -0.36435 0.08667 0.45565 2.19907
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0006748 0.0369611 0.018 0.985
## bio_val_z 0.6206474 0.0524952 11.823 <2e-16 ***
## alt_val_z 0.0387649 0.0539656 0.718 0.473
## hed_val_z 0.0255630 0.0411392 0.621 0.535
## ego_val_z -0.0435288 0.0392287 -1.110 0.268
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7629 on 421 degrees of freedom
## (20 observations deleted due to missingness)
## Multiple R-squared: 0.4235, Adjusted R-squared: 0.418
## F-statistic: 77.33 on 4 and 421 DF, p-value: < 2.2e-16
confint(lm(PA_z ~ bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds))
## 2.5 % 97.5 %
## (Intercept) -0.07197654 0.07332608
## bio_val_z 0.51746209 0.72383262
## alt_val_z -0.06731073 0.14484046
## hed_val_z -0.05530088 0.10642683
## ego_val_z -0.12063735 0.03357968
model_PA_AR <- lm(AR_z ~ PA_z, data = ds)
# Assumption checks
#1. Linearity
plot(model_PA_AR$fitted.values, model_PA_AR$residuals, abline(h = 0, col = "red"))
#2. Independence of errors -> fine
dwtest(model_PA_AR)
##
## Durbin-Watson test
##
## data: model_PA_AR
## DW = 2.0567, p-value = 0.7201
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity
plot(model_PA_AR$fitted.values, model_PA_AR$residuals, abline(h = 0, col = "red"))
bptest(model_PA_AR) # --> A significant p-value indicates heteroscedasticity.: here p = 0.006 -> not fully constant
##
## studentized Breusch-Pagan test
##
## data: model_PA_AR
## BP = 7.5114, df = 1, p-value = 0.006131
#4. Normality of residuals
hist(model_PA_AR$residuals)
qqnorm(model_PA_AR$residuals)
shapiro.test(model_PA_AR$residuals) #--> significant, suggests normality is not given, due to sample size?
##
## Shapiro-Wilk normality test
##
## data: model_PA_AR$residuals
## W = 0.97315, p-value = 4.597e-07
#regression model 1
summary(model_PA_AR)
##
## Call:
## lm(formula = AR_z ~ PA_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.04585 -0.38020 0.08662 0.39958 2.00694
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.584e-16 3.059e-02 0.00 1
## PA_z 7.761e-01 3.063e-02 25.34 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6314 on 424 degrees of freedom
## (20 observations deleted due to missingness)
## Multiple R-squared: 0.6023, Adjusted R-squared: 0.6014
## F-statistic: 642.2 on 1 and 424 DF, p-value: < 2.2e-16
confint(model_PA_AR)
## 2.5 % 97.5 %
## (Intercept) -0.06012652 0.06012652
## PA_z 0.71589211 0.83628655
# model 2: Controlling for variables before
model2_PA_AR<- lm(AR_z ~ PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_PA_AR)
##
## Call:
## lm(formula = AR_z ~ PA_z + bio_val_z + alt_val_z + hed_val_z +
## ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.07535 -0.30662 0.07292 0.38224 1.92255
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0006812 0.0292447 0.023 0.981427
## PA_z 0.6686111 0.0385622 17.339 < 2e-16 ***
## bio_val_z 0.1105571 0.0479378 2.306 0.021582 *
## alt_val_z 0.0972740 0.0427253 2.277 0.023305 *
## hed_val_z -0.1110718 0.0325655 -3.411 0.000711 ***
## ego_val_z 0.1223437 0.0310843 3.936 9.7e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6036 on 420 degrees of freedom
## (20 observations deleted due to missingness)
## Multiple R-squared: 0.64, Adjusted R-squared: 0.6357
## F-statistic: 149.3 on 5 and 420 DF, p-value: < 2.2e-16
confint(model2_PA_AR)
## 2.5 % 97.5 %
## (Intercept) -0.05680305 0.05816550
## PA_z 0.59281217 0.74440993
## bio_val_z 0.01632930 0.20478493
## alt_val_z 0.01329188 0.18125614
## hed_val_z -0.17508342 -0.04706014
## ego_val_z 0.06124360 0.18344380
#model comparison
anova(model_PA_AR, model2_PA_AR)
## Analysis of Variance Table
##
## Model 1: AR_z ~ PA_z
## Model 2: AR_z ~ PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 424 169.02
## 2 420 153.02 4 15.999 10.978 1.78e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_AR_SE <- lm(SE_z ~ AR_z, data = ds)
# Assumption checks
#1. Linearity -> fine
plot(model_AR_SE$fitted.values, model_AR_SE$residuals, abline(h = 0, col = "red"))
#2. Independence of errors -> fine
dwtest(model_AR_SE)
##
## Durbin-Watson test
##
## data: model_AR_SE
## DW = 1.8563, p-value = 0.07225
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity (Constant Variance of Errors) --> fine
plot(model_AR_SE$fitted.values, model_AR_SE$residuals, abline(h = 0, col = "red"))
bptest(model_AR_SE) # --> not sig
##
## studentized Breusch-Pagan test
##
## data: model_AR_SE
## BP = 0.81016, df = 1, p-value = 0.3681
#4. Normality of residuals -> fine
hist(model_AR_SE$residuals)
qqnorm(model_AR_SE$residuals)
shapiro.test(model_AR_SE$residuals) #--> significant, suggests normality is not given, due to sample size?
##
## Shapiro-Wilk normality test
##
## data: model_AR_SE$residuals
## W = 0.97332, p-value = 7.597e-07
summary(lm(SE_z ~ AR_z, data = ds))
##
## Call:
## lm(formula = SE_z ~ AR_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.89883 -0.42859 0.09266 0.59680 2.41548
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.006886 0.043271 0.159 0.874
## AR_z 0.479406 0.043070 11.131 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8771 on 409 degrees of freedom
## (35 observations deleted due to missingness)
## Multiple R-squared: 0.2325, Adjusted R-squared: 0.2306
## F-statistic: 123.9 on 1 and 409 DF, p-value: < 2.2e-16
confint(lm(SE_z ~ AR_z, data = ds))
## 2.5 % 97.5 %
## (Intercept) -0.07817492 0.09194664
## AR_z 0.39473993 0.56407241
# Controlling for variables before
model2_AR_SE <- lm(SE_z ~ AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_AR_SE)
##
## Call:
## lm(formula = SE_z ~ AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z +
## ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.3308 -0.4212 0.1099 0.5091 2.0324
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.007093 0.040565 0.175 0.86129
## AR_z 0.214309 0.066887 3.204 0.00146 **
## PA_z 0.148408 0.069338 2.140 0.03292 *
## bio_val_z 0.148598 0.066643 2.230 0.02631 *
## alt_val_z 0.041590 0.059277 0.702 0.48332
## hed_val_z 0.017699 0.046015 0.385 0.70071
## ego_val_z 0.241225 0.044120 5.468 8.01e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8223 on 404 degrees of freedom
## (35 observations deleted due to missingness)
## Multiple R-squared: 0.3338, Adjusted R-squared: 0.3239
## F-statistic: 33.73 on 6 and 404 DF, p-value: < 2.2e-16
confint(model2_AR_SE)
## 2.5 % 97.5 %
## (Intercept) -0.07265297 0.08683856
## AR_z 0.08281862 0.34579981
## PA_z 0.01209959 0.28471637
## bio_val_z 0.01758788 0.27960857
## alt_val_z -0.07493963 0.15811868
## hed_val_z -0.07275983 0.10815851
## ego_val_z 0.15449200 0.32795804
#comparison of models
anova(model_AR_SE, model2_AR_SE)
## Analysis of Variance Table
##
## Model 1: SE_z ~ AR_z
## Model 2: SE_z ~ AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 409 314.68
## 2 404 273.15 5 41.528 12.284 4.208e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_AR_OE <- lm(OE_z ~ AR_z, data = ds)
# Assumption checks
#1. Linearity -> fine
plot(model_AR_OE$fitted.values, model_AR_OE$residuals, abline(h = 0, col = "red"))
#2. Independence of errors -> fine
dwtest(model_AR_OE)
##
## Durbin-Watson test
##
## data: model_AR_OE
## DW = 1.8969, p-value = 0.1476
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity (Constant Variance of Errors) --> fine
plot(model_AR_OE$fitted.values, model_AR_OE$residuals, abline(h = 0, col = "red"))
bptest(model_AR_OE) # --> not sig
##
## studentized Breusch-Pagan test
##
## data: model_AR_OE
## BP = 0.19793, df = 1, p-value = 0.6564
#4. Normality of residuals -> fine
hist(model_AR_OE$residuals)
qqnorm(model_AR_OE$residuals)
shapiro.test(model_AR_OE$residuals) #--> significant, suggests normality is not given, due to sample size?
##
## Shapiro-Wilk normality test
##
## data: model_AR_OE$residuals
## W = 0.96193, p-value = 7.783e-09
summary(lm(OE_z ~ AR_z, data = ds))
##
## Call:
## lm(formula = OE_z ~ AR_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.1850 -0.4182 0.1157 0.5284 1.9359
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.008314 0.040157 0.207 0.836
## AR_z 0.578858 0.039971 14.482 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.814 on 409 degrees of freedom
## (35 observations deleted due to missingness)
## Multiple R-squared: 0.339, Adjusted R-squared: 0.3373
## F-statistic: 209.7 on 1 and 409 DF, p-value: < 2.2e-16
confint(lm(OE_z ~ AR_z, data = ds))
## 2.5 % 97.5 %
## (Intercept) -0.07062653 0.08725517
## AR_z 0.50028380 0.65743320
# Controlling for previous variables
model2_AR_OE <- lm(OE_z ~ AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_AR_OE)
##
## Call:
## lm(formula = OE_z ~ AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z +
## ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.0484 -0.3521 0.1149 0.4742 1.7462
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.008424 0.038096 0.221 0.82510
## AR_z 0.310755 0.062816 4.947 1.11e-06 ***
## PA_z 0.173696 0.065118 2.667 0.00795 **
## bio_val_z 0.156965 0.062587 2.508 0.01253 *
## alt_val_z 0.025352 0.055669 0.455 0.64906
## hed_val_z -0.035357 0.043215 -0.818 0.41374
## ego_val_z 0.192701 0.041434 4.651 4.49e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7722 on 404 degrees of freedom
## (35 observations deleted due to missingness)
## Multiple R-squared: 0.4124, Adjusted R-squared: 0.4037
## F-statistic: 47.26 on 6 and 404 DF, p-value: < 2.2e-16
confint(model2_AR_OE)
## 2.5 % 97.5 %
## (Intercept) -0.06646781 0.08331642
## AR_z 0.18726786 0.43424295
## PA_z 0.04568400 0.30170822
## bio_val_z 0.03392819 0.28000124
## alt_val_z -0.08408429 0.13478914
## hed_val_z -0.12031035 0.04959657
## ego_val_z 0.11124712 0.27415532
#model comparison
anova(model_AR_OE, model2_AR_OE)
## Analysis of Variance Table
##
## Model 1: OE_z ~ AR_z
## Model 2: OE_z ~ AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 409 271.02
## 2 404 240.91 5 30.114 10.1 3.977e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_PN_SE_OE <- lm(PN_z ~ SE_z + OE_z, data = ds)
# Assumption checks
#1. Linearity -> fine
plot(model_PN_SE_OE$fitted.values, model_PN_SE_OE$residuals, abline(h = 0, col = "red"))
#2. Independence of errors -> fine
dwtest(model_PN_SE_OE)
##
## Durbin-Watson test
##
## data: model_PN_SE_OE
## DW = 1.9081, p-value = 0.1746
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity (Constant Variance of Errors) --> fine
plot(model_PN_SE_OE$fitted.values, model_PN_SE_OE$residuals, abline(h = 0, col = "red"))
bptest(model_PN_SE_OE) # --> not sig
##
## studentized Breusch-Pagan test
##
## data: model_PN_SE_OE
## BP = 3.821, df = 2, p-value = 0.148
#4. Normality of residuals -> fine
hist(model_PN_SE_OE$residuals)
qqnorm(model_PN_SE_OE$residuals)
shapiro.test(model_PN_SE_OE$residuals) #--> significant, suggests normality is not given, due to sample size?
##
## Shapiro-Wilk normality test
##
## data: model_PN_SE_OE$residuals
## W = 0.97687, p-value = 4.055e-06
summary(lm(PN_z ~ SE_z + OE_z, data = ds))
##
## Call:
## lm(formula = PN_z ~ SE_z + OE_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.43303 -0.34770 0.09933 0.36442 2.07479
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0002815 0.0318775 0.009 0.993
## SE_z 0.1934818 0.0428485 4.515 8.28e-06 ***
## OE_z 0.6212548 0.0428505 14.498 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6455 on 407 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.5854, Adjusted R-squared: 0.5834
## F-statistic: 287.3 on 2 and 407 DF, p-value: < 2.2e-16
confint(lm(PN_z ~ SE_z + OE_z, data = ds))
## 2.5 % 97.5 %
## (Intercept) -0.06238357 0.06294658
## SE_z 0.10924977 0.27771388
## OE_z 0.53701895 0.70549073
# Controlling for previous variables
model2_PN_SE_OE <- lm(PN_z ~ SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_PN_SE_OE)
##
## Call:
## lm(formula = PN_z ~ SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z +
## hed_val_z + ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.08185 -0.35759 0.05402 0.36697 2.03922
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.002864 0.029915 0.096 0.923776
## SE_z 0.140258 0.041910 3.347 0.000895 ***
## OE_z 0.523473 0.044630 11.729 < 2e-16 ***
## AR_z 0.115288 0.050817 2.269 0.023818 *
## PA_z -0.025814 0.051694 -0.499 0.617795
## bio_val_z 0.088012 0.049585 1.775 0.076663 .
## alt_val_z 0.018135 0.043694 0.415 0.678335
## hed_val_z -0.162631 0.034090 -4.771 2.58e-06 ***
## ego_val_z 0.185889 0.033917 5.481 7.50e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6056 on 401 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.6404, Adjusted R-squared: 0.6332
## F-statistic: 89.27 on 8 and 401 DF, p-value: < 2.2e-16
confint(model2_PN_SE_OE)
## 2.5 % 97.5 %
## (Intercept) -0.055946252 0.06167433
## SE_z 0.057867128 0.22264984
## OE_z 0.435735659 0.61121061
## AR_z 0.015387297 0.21518905
## PA_z -0.127438161 0.07581008
## bio_val_z -0.009467674 0.18549111
## alt_val_z -0.067762764 0.10403196
## hed_val_z -0.229647573 -0.09561427
## ego_val_z 0.119211790 0.25256566
#model comparison
anova(model_PN_SE_OE, model2_PN_SE_OE)
## Analysis of Variance Table
##
## Model 1: PN_z ~ SE_z + OE_z
## Model 2: PN_z ~ SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z +
## ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 407 169.57
## 2 401 147.07 6 22.496 10.223 1.548e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_gov <- lm(CCB_gov_z ~ PN_z, data = ds)
# Assumption checks
#1. Linearity
plot(model_gov$fitted.values, model_gov$residuals, abline(h = 0, col = "red"))
#2. Independence of errors
dwtest(model_gov)
##
## Durbin-Watson test
##
## data: model_gov
## DW = 2.0891, p-value = 0.8165
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity
plot(model_gov$fitted.values, model_gov$residuals, abline(h = 0, col = "red"))
bptest(model_gov)
##
## studentized Breusch-Pagan test
##
## data: model_gov
## BP = 43.327, df = 1, p-value = 4.631e-11
#4. Normality of residuals
hist(model_gov$residuals)
qqnorm(model_gov$residuals)
shapiro.test(model_gov$residuals)
##
## Shapiro-Wilk normality test
##
## data: model_gov$residuals
## W = 0.97808, p-value = 7.31e-06
# regression results model 1
summary(model_gov)
##
## Call:
## lm(formula = CCB_gov_z ~ PN_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.6381 -0.5958 -0.1280 0.6529 2.1698
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.004349 0.040630 0.107 0.915
## PN_z 0.569366 0.040680 13.996 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8227 on 408 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.3244, Adjusted R-squared: 0.3227
## F-statistic: 195.9 on 1 and 408 DF, p-value: < 2.2e-16
confint(model_gov)
## 2.5 % 97.5 %
## (Intercept) -0.07552142 0.08421998
## PN_z 0.48939728 0.64933385
## model 2: Controlling for previous variables
model2_gov <- lm(CCB_gov_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_gov)
##
## Call:
## lm(formula = CCB_gov_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z +
## alt_val_z + hed_val_z + ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.72115 -0.53286 -0.06705 0.60284 1.85916
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.006804 0.038281 0.178 0.8590
## PN_z 0.345251 0.063902 5.403 1.13e-07 ***
## SE_z 0.092420 0.054373 1.700 0.0900 .
## OE_z 0.018864 0.066185 0.285 0.7758
## AR_z 0.062768 0.065443 0.959 0.3381
## PA_z -0.072207 0.066169 -1.091 0.2758
## bio_val_z 0.134570 0.063699 2.113 0.0353 *
## alt_val_z -0.038607 0.055924 -0.690 0.4904
## hed_val_z -0.096186 0.044843 -2.145 0.0326 *
## ego_val_z 0.287770 0.044997 6.395 4.48e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.775 on 400 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.4123, Adjusted R-squared: 0.3991
## F-statistic: 31.18 on 9 and 400 DF, p-value: < 2.2e-16
confint(model2_gov)
## 2.5 % 97.5 %
## (Intercept) -0.068452266 0.08206119
## PN_z 0.219626218 0.47087601
## SE_z -0.014473485 0.19931311
## OE_z -0.111250095 0.14897740
## AR_z -0.065886567 0.19142289
## PA_z -0.202289590 0.05787539
## bio_val_z 0.009342858 0.25979758
## alt_val_z -0.148548613 0.07133361
## hed_val_z -0.184342680 -0.00802848
## ego_val_z 0.199309304 0.37622992
anova(model_gov, model2_gov)
## Analysis of Variance Table
##
## Model 1: CCB_gov_z ~ PN_z
## Model 2: CCB_gov_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z +
## hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 408 276.15
## 2 400 240.22 8 35.925 7.4773 2.626e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_busi <- lm(CCB_busi_z ~ PN_z, data = ds)
# Assumption checks
#1. Linearity
plot(model_busi$fitted.values, model_busi$residuals, abline(h = 0, col = "red"))
#2. Independence of errors
dwtest(model_busi)
##
## Durbin-Watson test
##
## data: model_busi
## DW = 2.0925, p-value = 0.8256
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity
plot(model_busi$fitted.values, model_busi$residuals, abline(h = 0, col = "red"))
bptest(model_busi)
##
## studentized Breusch-Pagan test
##
## data: model_busi
## BP = 54.506, df = 1, p-value = 1.55e-13
#4. Normality of residuals
hist(model_busi$residuals)
qqnorm(model_busi$residuals)
shapiro.test(model_busi$residuals)
##
## Shapiro-Wilk normality test
##
## data: model_busi$residuals
## W = 0.98421, p-value = 0.0001903
# regression model 1
summary(model_busi)
##
## Call:
## lm(formula = CCB_busi_z ~ PN_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.78743 -0.67446 -0.04957 0.69181 2.20894
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.001414 0.040840 -0.035 0.972
## PN_z 0.567880 0.040890 13.888 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8269 on 408 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.321, Adjusted R-squared: 0.3193
## F-statistic: 192.9 on 1 and 408 DF, p-value: < 2.2e-16
confint(model_busi)
## 2.5 % 97.5 %
## (Intercept) -0.08169665 0.07886868
## PN_z 0.48749942 0.64826092
## model 2: Controlling for previous variables
model2_busi <- lm(CCB_busi_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_busi)
##
## Call:
## lm(formula = CCB_busi_z ~ PN_z + SE_z + OE_z + AR_z + PA_z +
## bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.23481 -0.57620 0.00359 0.58445 1.95374
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.0007141 0.0375928 0.019 0.98485
## PN_z 0.2743019 0.0627531 4.371 1.58e-05 ***
## SE_z 0.0746940 0.0533961 1.399 0.16263
## OE_z 0.1554345 0.0649954 2.391 0.01724 *
## AR_z 0.0593074 0.0642666 0.923 0.35665
## PA_z -0.1090231 0.0649798 -1.678 0.09417 .
## bio_val_z 0.1248233 0.0625545 1.995 0.04667 *
## alt_val_z -0.0697135 0.0549186 -1.269 0.20504
## hed_val_z -0.1291261 0.0440369 -2.932 0.00356 **
## ego_val_z 0.3209806 0.0441883 7.264 1.98e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.761 on 400 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.4362, Adjusted R-squared: 0.4235
## F-statistic: 34.39 on 9 and 400 DF, p-value: < 2.2e-16
confint(model2_busi)
## 2.5 % 97.5 %
## (Intercept) -0.073190082 0.07461821
## PN_z 0.150934877 0.39766898
## SE_z -0.030278096 0.17966613
## OE_z 0.027659309 0.28320975
## AR_z -0.067034987 0.18564987
## PA_z -0.236767649 0.01872140
## bio_val_z 0.001846614 0.24779993
## alt_val_z -0.177678606 0.03825170
## hed_val_z -0.215698784 -0.04255346
## ego_val_z 0.234110131 0.40785097
#model comparison
anova(model_busi, model2_busi)
## Analysis of Variance Table
##
## Model 1: CCB_busi_z ~ PN_z
## Model 2: CCB_busi_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z +
## hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 408 279.00
## 2 400 231.67 8 47.338 10.217 5.118e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_ind <- lm(CCB_ind_z ~ PN_z, data = ds)
# Assumption checks
#1. Linearity
plot(model_ind$fitted.values, model_ind$residuals, abline(h = 0, col = "red"))
#2. Independence of errors
dwtest(model_ind)
##
## Durbin-Watson test
##
## data: model_ind
## DW = 2.0901, p-value = 0.8194
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity
plot(model_ind$fitted.values, model_ind$residuals, abline(h = 0, col = "red"))
bptest(model_ind)
##
## studentized Breusch-Pagan test
##
## data: model_ind
## BP = 6.9711, df = 1, p-value = 0.008284
#4. Normality of residuals
hist(model_ind$residuals)
qqnorm(model_ind$residuals)
shapiro.test(model_ind$residuals)
##
## Shapiro-Wilk normality test
##
## data: model_ind$residuals
## W = 0.97401, p-value = 1.067e-06
#regression model 1
summary(model_ind)
##
## Call:
## lm(formula = CCB_ind_z ~ PN_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.22930 -0.29861 0.07489 0.44098 1.84092
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.002426 0.032620 0.074 0.941
## PN_z 0.753369 0.032660 23.067 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6605 on 408 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.566, Adjusted R-squared: 0.5649
## F-statistic: 532.1 on 1 and 408 DF, p-value: < 2.2e-16
confint(model_ind)
## 2.5 % 97.5 %
## (Intercept) -0.06169878 0.06654978
## PN_z 0.68916621 0.81757145
## model 2: Controlling for previous variables
model2_ind <- lm(CCB_ind_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_ind)
##
## Call:
## lm(formula = CCB_ind_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z +
## alt_val_z + hed_val_z + ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.95833 -0.27633 0.08821 0.38063 1.75783
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.004219 0.031083 0.136 0.89209
## PN_z 0.494899 0.051886 9.538 < 2e-16 ***
## SE_z 0.043709 0.044149 0.990 0.32276
## OE_z 0.162528 0.053740 3.024 0.00265 **
## AR_z 0.081281 0.053137 1.530 0.12690
## PA_z -0.076800 0.053727 -1.429 0.15366
## bio_val_z 0.128252 0.051722 2.480 0.01356 *
## alt_val_z 0.004517 0.045408 0.099 0.92081
## hed_val_z -0.020980 0.036411 -0.576 0.56480
## ego_val_z 0.107919 0.036536 2.954 0.00332 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6292 on 400 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.6138, Adjusted R-squared: 0.6051
## F-statistic: 70.65 on 9 and 400 DF, p-value: < 2.2e-16
confint(model2_ind)
## 2.5 % 97.5 %
## (Intercept) -0.05688668 0.06532545
## PN_z 0.39289606 0.59690287
## SE_z -0.04308456 0.13050333
## OE_z 0.05687978 0.26817620
## AR_z -0.02318226 0.18574481
## PA_z -0.18242267 0.02882299
## bio_val_z 0.02657146 0.22993270
## alt_val_z -0.08475145 0.09378591
## hed_val_z -0.09256085 0.05060065
## ego_val_z 0.03609196 0.17974586
anova(model_ind, model2_ind)
## Analysis of Variance Table
##
## Model 1: CCB_ind_z ~ PN_z
## Model 2: CCB_ind_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z +
## hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 408 178.00
## 2 400 158.38 8 19.619 6.1938 1.494e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_mix <- lm(CCB_mix_z ~ PN_z, data = ds)
# Assumption checks
#1. Linearity
plot(model_mix$fitted.values, model_mix$residuals, abline(h = 0, col = "red"))
#2. Independence of errors
dwtest(model_mix)
##
## Durbin-Watson test
##
## data: model_mix
## DW = 2.0934, p-value = 0.8279
## alternative hypothesis: true autocorrelation is greater than 0
#3. Homoscedasticity
plot(model_mix$fitted.values, model_mix$residuals, abline(h = 0, col = "red"))
bptest(model_mix)
##
## studentized Breusch-Pagan test
##
## data: model_mix
## BP = 33.861, df = 1, p-value = 5.92e-09
#4. Normality of residuals
hist(model_mix$residuals)
qqnorm(model_mix$residuals)
shapiro.test(model_mix$residuals)
##
## Shapiro-Wilk normality test
##
## data: model_mix$residuals
## W = 0.98937, p-value = 0.004531
#regression model 1
summary(model_mix)
##
## Call:
## lm(formula = CCB_mix_z ~ PN_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.3085 -0.6148 -0.0780 0.6452 1.9722
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.007273 0.040657 -0.179 0.858
## PN_z 0.560295 0.040707 13.764 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8232 on 408 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.3171, Adjusted R-squared: 0.3154
## F-statistic: 189.5 on 1 and 408 DF, p-value: < 2.2e-16
confint(model_mix)
## 2.5 % 97.5 %
## (Intercept) -0.0871957 0.07265032
## PN_z 0.4802739 0.64031524
## model 2: Controlling for previous variables
model2_mix <- lm(CCB_mix_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z + hed_val_z + ego_val_z, data = ds)
summary(model2_mix)
##
## Call:
## lm(formula = CCB_mix_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z +
## alt_val_z + hed_val_z + ego_val_z, data = ds)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.3477 -0.5814 0.0390 0.5804 1.8433
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.005388 0.038547 -0.140 0.88890
## PN_z 0.291569 0.064345 4.531 7.75e-06 ***
## SE_z -0.008313 0.054751 -0.152 0.87939
## OE_z 0.172262 0.066644 2.585 0.01010 *
## AR_z 0.009716 0.065897 0.147 0.88286
## PA_z -0.051912 0.066628 -0.779 0.43637
## bio_val_z 0.149375 0.064142 2.329 0.02037 *
## alt_val_z -0.005470 0.056312 -0.097 0.92267
## hed_val_z -0.122310 0.045154 -2.709 0.00704 **
## ego_val_z 0.269440 0.045309 5.947 5.97e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7803 on 400 degrees of freedom
## (36 observations deleted due to missingness)
## Multiple R-squared: 0.3985, Adjusted R-squared: 0.3849
## F-statistic: 29.44 on 9 and 400 DF, p-value: < 2.2e-16
confint(model2_mix)
## 2.5 % 97.5 %
## (Intercept) -0.08116725 0.07039102
## PN_z 0.16507157 0.41806544
## SE_z -0.11594842 0.09932220
## OE_z 0.04124459 0.30327849
## AR_z -0.11983217 0.13926344
## PA_z -0.18289748 0.07907347
## bio_val_z 0.02327794 0.27547122
## alt_val_z -0.11617412 0.10523445
## hed_val_z -0.21107902 -0.03354091
## ego_val_z 0.18036518 0.35851391
#model comparison
anova(model_mix, model2_mix)
## Analysis of Variance Table
##
## Model 1: CCB_mix_z ~ PN_z
## Model 2: CCB_mix_z ~ PN_z + SE_z + OE_z + AR_z + PA_z + bio_val_z + alt_val_z +
## hed_val_z + ego_val_z
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 408 276.51
## 2 400 243.57 8 32.94 6.7619 2.496e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
modelVBN_paths <- '
#equations where left is predicted by right
PA_z ~ a1*bio_val_z + a2*alt_val_z + a3*hed_val_z + a4*ego_val_z
AR_z ~ b*PA_z
SE_z ~ c1*AR_z
OE_z ~ c2*AR_z
PN_z ~ d1*SE_z + d2*OE_z
CCB_gov_z ~ e1*PN_z
CCB_busi_z ~ e2*PN_z
CCB_ind_z ~ e3*PN_z
CCB_mix_z ~ e4*PN_z
#indirect effect
bio_gov := a1*b*c1*d1*e1 + a1*b*c2*d2*e1
bio_busi := a1*b*c1*d1*e2 + a1*b*c2*d2*e2
bio_ind := a1*b*c1*d1*e3 + a1*b*c2*d2*e3
bio_mix := a1*b*c1*d1*e4 + a1*b*c2*d2*e4
alt_gov := a2*b*c1*d1*e1 + a2*b*c2*d2*e1
alt_busi := a2*b*c1*d1*e2 + a2*b*c2*d2*e2
alt_ind := a2*b*c1*d1*e3 + a2*b*c2*d2*e3
alt_mix := a2*b*c1*d1*e4 + a2*b*c2*d2*e4
hed_gov := a3*b*c1*d1*e1 + a3*b*c2*d2*e1
hed_busi := a3*b*c1*d1*e2 + a3*b*c2*d2*e2
hed_ind := a3*b*c1*d1*e3 + a3*b*c2*d2*e3
hed_mix := a3*b*c1*d1*e4 + a3*b*c2*d2*e4
ego_gov := a4*b*c1*d1*e1 + a4*b*c2*d2*e1
ego_busi := a4*b*c1*d1*e2 + a4*b*c2*d2*e2
ego_ind := a4*b*c1*d1*e3 + a4*b*c2*d2*e3
ego_mix := a4*b*c1*d1*e4 + a4*b*c2*d2*e4
'
fit_modelVBN_paths <- lavaan::sem(modelVBN_paths, data = ds, missing = "ML") #, se = "bootstrap", bootstrap = 1000) to run with bootstrap for SE: leave # out
## Warning: lavaan->lav_data_full():
## 17 cases were deleted due to missing values in exogenous variable(s),
## while fixed.x = TRUE.
summary(fit_modelVBN_paths, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
## lavaan 0.6-20 ended normally after 28 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 37
##
## Used Total
## Number of observations 429 446
## Number of missing patterns 8
##
## Model Test User Model:
##
## Test statistic 451.471
## Degrees of freedom 53
## P-value (Chi-square) 0.000
##
## Model Test Baseline Model:
##
## Test statistic 3112.581
## Degrees of freedom 72
## P-value 0.000
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.869
## Tucker-Lewis Index (TLI) 0.822
##
## Robust Comparative Fit Index (CFI) 0.869
## Robust Tucker-Lewis Index (TLI) 0.822
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -3983.121
## Loglikelihood unrestricted model (H1) -3757.386
##
## Akaike (AIC) 8040.242
## Bayesian (BIC) 8190.516
## Sample-size adjusted Bayesian (SABIC) 8073.100
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.132
## 90 Percent confidence interval - lower 0.121
## 90 Percent confidence interval - upper 0.144
## P-value H_0: RMSEA <= 0.050 0.000
## P-value H_0: RMSEA >= 0.080 1.000
##
## Robust RMSEA 0.134
## 90 Percent confidence interval - lower 0.123
## 90 Percent confidence interval - upper 0.146
## 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.142
##
## Parameter Estimates:
##
## Standard errors Standard
## Information Observed
## Observed information based on Hessian
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## PA_z ~
## bio_val_z (a1) 0.621 0.052 11.893 0.000 0.621 0.621
## alt_val_z (a2) 0.039 0.054 0.723 0.470 0.039 0.039
## hed_val_z (a3) 0.026 0.041 0.625 0.532 0.026 0.026
## ego_val_z (a4) -0.044 0.039 -1.116 0.264 -0.044 -0.044
## AR_z ~
## PA_z (b) 0.776 0.031 25.401 0.000 0.776 0.776
## SE_z ~
## AR_z (c1) 0.480 0.043 11.171 0.000 0.480 0.480
## OE_z ~
## AR_z (c2) 0.580 0.040 14.563 0.000 0.580 0.581
## PN_z ~
## SE_z (d1) 0.194 0.043 4.539 0.000 0.194 0.204
## OE_z (d2) 0.622 0.043 14.560 0.000 0.622 0.653
## CCB_gov_z ~
## PN_z (e1) 0.570 0.041 13.983 0.000 0.570 0.549
## CCB_busi_z ~
## PN_z (e2) 0.571 0.041 14.020 0.000 0.571 0.549
## CCB_ind_z ~
## PN_z (e3) 0.755 0.033 23.181 0.000 0.755 0.736
## CCB_mix_z ~
## PN_z (e4) 0.565 0.041 13.935 0.000 0.565 0.546
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .CCB_gov_z ~~
## .CCB_busi_z 0.441 0.040 11.019 0.000 0.441 0.648
## .CCB_ind_z 0.253 0.030 8.524 0.000 0.253 0.465
## .CCB_mix_z 0.386 0.039 10.031 0.000 0.386 0.568
## .CCB_busi_z ~~
## .CCB_ind_z 0.266 0.030 8.897 0.000 0.266 0.488
## .CCB_mix_z 0.355 0.038 9.395 0.000 0.355 0.522
## .CCB_ind_z ~~
## .CCB_mix_z 0.269 0.030 8.982 0.000 0.269 0.494
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .PA_z 0.001 0.037 0.018 0.985 0.001 0.001
## .AR_z 0.000 0.031 0.000 1.000 0.000 0.000
## .SE_z 0.007 0.043 0.163 0.870 0.007 0.007
## .OE_z 0.009 0.040 0.220 0.826 0.009 0.009
## .PN_z -0.000 0.032 -0.008 0.993 -0.000 -0.000
## .CCB_gov_z 0.005 0.040 0.125 0.901 0.005 0.005
## .CCB_busi_z 0.003 0.041 0.069 0.945 0.003 0.003
## .CCB_ind_z 0.001 0.032 0.028 0.977 0.001 0.001
## .CCB_mix_z -0.001 0.040 -0.037 0.971 -0.001 -0.002
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .PA_z 0.575 0.039 14.595 0.000 0.575 0.578
## .AR_z 0.397 0.027 14.595 0.000 0.397 0.398
## .SE_z 0.766 0.053 14.335 0.000 0.766 0.769
## .OE_z 0.660 0.046 14.331 0.000 0.660 0.663
## .PN_z 0.414 0.029 14.314 0.000 0.414 0.458
## .CCB_gov_z 0.681 0.047 14.350 0.000 0.681 0.699
## .CCB_busi_z 0.681 0.048 14.338 0.000 0.681 0.699
## .CCB_ind_z 0.435 0.030 14.319 0.000 0.435 0.458
## .CCB_mix_z 0.680 0.047 14.400 0.000 0.680 0.702
##
## R-Square:
## Estimate
## PA_z 0.422
## AR_z 0.602
## SE_z 0.231
## OE_z 0.337
## PN_z 0.542
## CCB_gov_z 0.301
## CCB_busi_z 0.301
## CCB_ind_z 0.542
## CCB_mix_z 0.298
##
## Defined Parameters:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## bio_gov 0.125 0.017 7.307 0.000 0.125 0.126
## bio_busi 0.125 0.017 7.303 0.000 0.125 0.126
## bio_ind 0.165 0.021 8.029 0.000 0.165 0.169
## bio_mix 0.124 0.017 7.290 0.000 0.124 0.125
## alt_gov 0.008 0.011 0.720 0.471 0.008 0.008
## alt_busi 0.008 0.011 0.720 0.471 0.008 0.008
## alt_ind 0.010 0.014 0.721 0.471 0.010 0.011
## alt_mix 0.008 0.011 0.720 0.471 0.008 0.008
## hed_gov 0.005 0.008 0.624 0.533 0.005 0.005
## hed_busi 0.005 0.008 0.624 0.533 0.005 0.005
## hed_ind 0.007 0.011 0.624 0.533 0.007 0.007
## hed_mix 0.005 0.008 0.624 0.533 0.005 0.005
## ego_gov -0.009 0.008 -1.108 0.268 -0.009 -0.009
## ego_busi -0.009 0.008 -1.108 0.268 -0.009 -0.009
## ego_ind -0.012 0.010 -1.110 0.267 -0.012 -0.012
## ego_mix -0.009 0.008 -1.108 0.268 -0.009 -0.009
# Creating path diagram
library(lavaanPlot)
lavaanPlot(model = fit_modelVBN_paths, graph_options = list(rankdir = "LR"), labels = list(bio_val_z = "Biospheric values", alt_val_z = "Altruistic values", hed_val_z = "Hedonic values", ego_val_z = "Egoistic values", PA_z = "Problem awareness", AR_z = "Ascription of responsibility", SE_z = "Self-efficacy", OE_z = "Outcome efficacy", PN_z = "Personal norm", CCB_gov_z = "CCB aimed at governments", CCB_busi_z = "CCB aimed at businesses", CCB_ind_z = "CCB aimed at other citizens", CCB_mix_z = "CCB aimed at various actors"), node_options = list(shape = "box", fontname = "Helvetica"), edge_options = list(color = "lightblue4"), coefs = TRUE, covs = FALSE, stars = c("regress"))
VBN_CCBgov <- ds[, c("bio_val", "alt_val","hed_val", "ego_val", "PA", "AR", "SE", "OE", "PN", "CCB_gov")]
cor_matrix_CCBgov <- cor(VBN_CCBgov, use = "complete.obs")
qgraph(cor_matrix_CCBgov,
layout = "spring", # Layout algorithm
vsize = 10, # Size of the nodes
esize = 30, # Edge size scaling
minimum = 0.2, # Show edges only if correlation > 0.3
cut = 0.5, # Threshold for line width
labels = colnames(vars), # Use variable names as labels
color = "#74ADD1",
edge.color = "#313695",
edge.labels = TRUE
)
VBN_CCBbusi <- ds[, c("bio_val", "alt_val","hed_val", "ego_val", "PA", "AR", "SE", "OE", "PN", "CCB_busi")]
cor_matrix_CCBbusi <- cor(VBN_CCBbusi, use = "complete.obs")
qgraph(cor_matrix_CCBbusi,
layout = "spring", # Layout algorithm
vsize = 10, # Size of the nodes
esize = 30, # Edge size scaling
minimum = 0.2, # Show edges only if correlation > 0.3
cut = 0.5, # Threshold for line width
labels = colnames(vars), # Use variable names as labels
color = "#74ADD1",
edge.color = "#313695",
edge.labels = TRUE
)
VBN_CCBind <- ds[, c("bio_val", "alt_val","hed_val", "ego_val", "PA", "AR", "SE", "OE", "PN", "CCB_ind")]
cor_matrix_CCBind <- cor(VBN_CCBind, use = "complete.obs")
qgraph(cor_matrix_CCBind,
layout = "spring", # Layout algorithm
vsize = 10, # Size of the nodes
esize = 30, # Edge size scaling
minimum = 0.2, # Show edges only if correlation > 0.3
cut = 0.5, # Threshold for line width
labels = colnames(vars), # Use variable names as labels
color = "#74ADD1",
edge.color = "#313695",
edge.labels = TRUE
)
VBN_CCBmix <- ds[, c("bio_val", "alt_val","hed_val", "ego_val", "PA", "AR", "SE", "OE", "PN", "CCB_mix")]
cor_matrix_CCBmix <- cor(VBN_CCBmix, use = "complete.obs")
qgraph(cor_matrix_CCBmix,
layout = "spring", # Layout algorithm
vsize = 10, # Size of the nodes
esize = 30, # Edge size scaling
minimum = 0.2, # Show edges only if correlation > 0.3
cut = 0.5, # Threshold for line width
labels = colnames(vars), # Use variable names as labels
color = "#74ADD1",
edge.color = "#313695",
edge.labels = TRUE
)