This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Cmd+Shift+Enter.
```r
plot(cars)
<!-- rnb-source-end -->
<!-- rnb-chunk-end -->
<!-- rnb-text-begin -->
Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Cmd+Option+I*.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Cmd+Shift+K* to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.
<!-- rnb-text-end -->
<!-- rnb-chunk-begin -->
<!-- rnb-source-begin eyJkYXRhIjoiYGBgclxubGlicmFyeShsYXZhYW4pXG5saWJyYXJ5KHNlbVBsb3QpXG5saWJyYXJ5KGhhdmVuKVxubGlicmFyeShkcGx5cilcbmBgYCJ9 -->
```r
library(lavaan)
library(semPlot)
library(haven)
library(dplyr)
library(caTools) # For Linear regression
library(car) # To check multicollinearity
library(quantmod)
library(MASS)
library(haven)
@September 5, 2024 Data Analysis with the most recent version (checking cognitive learning, which is Ng_KU + Ng_EC)
#NgKU and NgEC are both in the "cognitive learning" subdomain of the literacy scale.
# Create a new variable by calculating the mean of var1 and var2
data_new$Lit_Ng_CL <- rowMeans(data_new[, c("Ng_AI_Lit_5", "Ng_AI_Lit_6", "Ng_AI_Lit_7", "Ng_AI_Lit_8", "Ng_AI_Lit_9", "Ng_AI_Lit_10")], na.rm = TRUE)
print(data_new)
#filtered_data = duration over 600 (10 minutes)
filtered_data$Lit_Ng_CL <- rowMeans(filtered_data[, c("Ng_AI_Lit_5", "Ng_AI_Lit_6", "Ng_AI_Lit_7", "Ng_AI_Lit_8", "Ng_AI_Lit_9", "Ng_AI_Lit_10")], na.rm = TRUE)
print(filtered_data)
NA
# Specify mediation model that has only credible2 as the second level mediator, and using Lit_Ng_CL (Cognitive learning composite variable)
model_6<-
'
# Direct effects of IVs on DV
factcheck_A ~ c1*Lit_Pin_TK + c2*Lit_Pin_SK + c3*Lit_Ng_SE + c4*Lit_Ng_CL
# Direct effects of IVs on first-level mediators
MH_expert ~ a3_1*Lit_Pin_TK + a3_2*Lit_Pin_SK + a3_3*Lit_Ng_SE + a3_4*Lit_Ng_CL
MH_objective ~ a4_1*Lit_Pin_TK + a4_2*Lit_Pin_SK + a4_3*Lit_Ng_SE + a4_4*Lit_Ng_CL
MH_accurate ~ a5_1*Lit_Pin_TK + a5_2*Lit_Pin_SK + a5_3*Lit_Ng_SE + a5_4*Lit_Ng_CL
# Direct effects of first-level mediators on second-level mediators
credible2 ~ b1_3*MH_expert + b1_4*MH_objective + b1_5*MH_accurate
credible2 ~ b1_6*Lit_Pin_TK + b1_7*Lit_Pin_SK + b1_8*Lit_Ng_SE + b1_9*Lit_Ng_CL
# Direct effects of first and second-level mediators on DV
factcheck_A ~ d1*credible2
# Indirect effects via first and second-level mediators
SE_expert_credible2 := a3_3*b1_3*d1
SE_obj_credible2 := a4_3*b1_4*d1
SE_acc_credible2 := a5_3*b1_5*d1
CL_expert_credible2 := a3_4*b1_3*d1
CL_object_credible2 := a4_4*b1_4*d1
CL_acc_credible2 := a5_4*b1_5*d1
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_CL~~Lit_Ng_CL
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_CL
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_CL
Lit_Ng_SE~~Lit_Ng_CL
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible2~~credible2
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
'
# Add bootstrapping to the lavaan function call
result.model_6 <- lavaan(model_6, data = filtered_data, se = "boot", bootstrap = 1000)
# Display the results with the specified options
summary(result.model_6, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
lavaan 0.6-18 ended normally after 39 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 42
Used Total
Number of observations 284 287
Model Test User Model:
Test statistic 3.710
Degrees of freedom 3
P-value (Chi-square) 0.295
Model Test Baseline Model:
Test statistic 1268.839
Degrees of freedom 36
P-value 0.000
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.999
Tucker-Lewis Index (TLI) 0.993
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -3592.297
Loglikelihood unrestricted model (H1) -3590.442
Akaike (AIC) 7268.593
Bayesian (BIC) 7421.850
Sample-size adjusted Bayesian (SABIC) 7288.667
Root Mean Square Error of Approximation:
RMSEA 0.029
90 Percent confidence interval - lower 0.000
90 Percent confidence interval - upper 0.108
P-value H_0: RMSEA <= 0.050 0.565
P-value H_0: RMSEA >= 0.080 0.184
Standardized Root Mean Square Residual:
SRMR 0.014
Parameter Estimates:
Standard errors Bootstrap
Number of requested bootstrap draws 1000
Number of successful bootstrap draws 1000
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
factcheck_A ~
Lt_P_TK (c1) -0.094 0.105 -0.890 0.374 -0.094 -0.097
Lt_P_SK (c2) 0.232 0.098 2.355 0.019 0.232 0.239
Lt_N_SE (c3) 0.124 0.082 1.511 0.131 0.124 0.111
Lt_N_CL (c4) 0.104 0.110 0.943 0.345 0.104 0.079
MH_expert ~
Lt_P_TK (a3_1) -0.142 0.104 -1.367 0.172 -0.142 -0.138
Lt_P_SK (a3_2) 0.054 0.101 0.533 0.594 0.054 0.052
Lt_N_SE (a3_3) 0.235 0.096 2.445 0.014 0.235 0.198
Lt_N_CL (a3_4) 0.284 0.118 2.401 0.016 0.284 0.205
MH_objective ~
Lt_P_TK (a4_1) -0.108 0.131 -0.823 0.410 -0.108 -0.092
Lt_P_SK (a4_2) 0.034 0.131 0.262 0.793 0.034 0.029
Lt_N_SE (a4_3) 0.221 0.111 1.984 0.047 0.221 0.163
Lt_N_CL (a4_4) 0.367 0.133 2.762 0.006 0.367 0.231
MH_accurate ~
Lt_P_TK (a5_1) -0.188 0.116 -1.619 0.105 -0.188 -0.179
Lt_P_SK (a5_2) 0.061 0.117 0.521 0.603 0.061 0.058
Lt_N_SE (a5_3) 0.250 0.102 2.462 0.014 0.250 0.206
Lt_N_CL (a5_4) 0.374 0.122 3.077 0.002 0.374 0.263
credible2 ~
MH_xprt (b1_3) 0.353 0.051 6.965 0.000 0.353 0.381
MH_bjct (b1_4) 0.097 0.045 2.128 0.033 0.097 0.119
MH_ccrt (b1_5) 0.285 0.052 5.452 0.000 0.285 0.315
Lt_P_TK (b1_6) 0.020 0.066 0.307 0.759 0.020 0.021
Lt_P_SK (b1_7) -0.034 0.059 -0.574 0.566 -0.034 -0.036
Lt_N_SE (b1_8) 0.088 0.060 1.460 0.144 0.088 0.080
Lt_N_CL (b1_9) 0.017 0.086 0.201 0.841 0.017 0.013
factcheck_A ~
credbl2 (d1) -0.302 0.070 -4.318 0.000 -0.302 -0.296
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
Lit_Pin_TK ~~
Lit_Pin_SK 1.404 0.117 12.014 0.000 1.404 0.824
Lit_Ng_SE 0.702 0.098 7.169 0.000 0.702 0.476
Lit_Ng_CL 0.783 0.085 9.192 0.000 0.783 0.621
Lit_Pin_SK ~~
Lit_Ng_SE 0.615 0.093 6.613 0.000 0.615 0.418
Lit_Ng_CL 0.714 0.075 9.483 0.000 0.714 0.567
Lit_Ng_SE ~~
Lit_Ng_CL 0.686 0.077 8.916 0.000 0.686 0.629
.MH_expert ~~
.MH_objective 0.971 0.148 6.570 0.000 0.971 0.527
.MH_accurate 0.996 0.138 7.227 0.000 0.996 0.613
.MH_objective ~~
.MH_accurate 1.095 0.132 8.277 0.000 1.095 0.590
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
Lit_Pin_TK 1.707 0.133 12.841 0.000 1.707 1.000
Lit_Pin_SK 1.701 0.120 14.181 0.000 1.701 1.000
Lit_Ng_SE 1.276 0.125 10.171 0.000 1.276 1.000
Lit_Ng_CL 0.931 0.066 14.109 0.000 0.931 1.000
.MH_expert 1.614 0.183 8.817 0.000 1.614 0.898
.MH_objective 2.105 0.162 12.989 0.000 2.105 0.897
.MH_accurate 1.637 0.140 11.684 0.000 1.637 0.868
.credible2 0.668 0.104 6.411 0.000 0.668 0.434
.factcheck_A 1.402 0.112 12.485 0.000 1.402 0.877
R-Square:
Estimate
MH_expert 0.102
MH_objective 0.103
MH_accurate 0.132
credible2 0.566
factcheck_A 0.123
Defined Parameters:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
SE_xprt_crdbl2 -0.025 0.013 -2.001 0.045 -0.025 -0.022
SE_obj_credbl2 -0.006 0.005 -1.354 0.176 -0.006 -0.006
SE_acc_credbl2 -0.022 0.010 -2.060 0.039 -0.022 -0.019
CL_xprt_crdbl2 -0.030 0.016 -1.906 0.057 -0.030 -0.023
CL_bjct_crdbl2 -0.011 0.007 -1.448 0.148 -0.011 -0.008
CL_acc_credbl2 -0.032 0.015 -2.115 0.034 -0.032 -0.025
@August 27, 2024 Data Analysis with the most recent version (additional responses).
data_new <- read_sav("/Users/mj/Library/CloudStorage/Dropbox/@Chat GPT and User Adaptation/ChatGPT Survey data/ChatGPT_cleaned_08272024.sav")
data_new
colnames(data_new)
range(data_new$Duration__in_seconds_, na.rm = TRUE)
[1] 350 570640
#trying to run the model_5_new with responses with duration over 600 seconds.
filtered_data <- subset(data_new, Duration__in_seconds_ > 600)
filtered_data
#will run model_5 with "data_new", model_5 has credible2 as the sole second level mediator, and had a better model fit.
model_5_new<-
'
# Direct effects of IVs on DV
factcheck_A ~ c1*Lit_Pin_TK + c2*Lit_Pin_SK + c3*Lit_Ng_SE + c4*Lit_Ng_KU + c5*Lit_Ng_EC
# Direct effects of IVs on first-level mediators
MH_expert ~ a3_1*Lit_Pin_TK + a3_2*Lit_Pin_SK + a3_3*Lit_Ng_SE + a3_4*Lit_Ng_KU + a3_5*Lit_Ng_EC
MH_objective ~ a4_1*Lit_Pin_TK + a4_2*Lit_Pin_SK + a4_3*Lit_Ng_SE + a4_4*Lit_Ng_KU + a4_5*Lit_Ng_EC
MH_accurate ~ a5_1*Lit_Pin_TK + a5_2*Lit_Pin_SK + a5_3*Lit_Ng_SE + a5_4*Lit_Ng_KU + a5_5*Lit_Ng_EC
# Direct effects of first-level mediators on second-level mediators
credible2 ~ b1_3*MH_expert + b1_4*MH_objective + b1_5*MH_accurate
# Direct effects of first and second-level mediators on DV
factcheck_A ~ d1*credible2
# Indirect effects via first and second-level mediators
SE_expert_credible2 := a3_3*b1_3*d1
SE_obj_credible2 := a4_3*b1_4*d1
SE_acc_credible2 := a5_3*b1_5*d1
EC_expert_credible2 := a3_5*b1_3*d1
EC_obj_credible2 := a4_5*b1_3*d1
EC_acc_credible2 := a5_5*b1_3*d1
KU_expert_credible2 := a3_4*b1_3*d1
KU_object_credible2 := a4_4*b1_4*d1
KU_acc_credible2 := a5_4*b1_5*d1
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_KU~~Lit_Ng_KU
Lit_Ng_EC~~Lit_Ng_EC
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_KU
Lit_Pin_TK~~Lit_Ng_EC
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_KU
Lit_Pin_SK~~Lit_Ng_EC
Lit_Ng_SE~~Lit_Ng_KU
Lit_Ng_SE~~Lit_Ng_EC
Lit_Ng_KU~~Lit_Ng_EC
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible2~~credible2
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
'
# Add bootstrapping to the lavaan function call
result.model_5_new <- lavaan(model_5_new, data = filtered_data, se = "boot", bootstrap = 5000)
# Display the results with the specified options
summary(result.model_5_new, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
lavaan 0.6-18 ended normally after 40 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 47
Used Total
Number of observations 284 287
Model Test User Model:
Test statistic 10.886
Degrees of freedom 8
P-value (Chi-square) 0.208
Model Test Baseline Model:
Test statistic 1460.990
Degrees of freedom 45
P-value 0.000
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.998
Tucker-Lewis Index (TLI) 0.989
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -3939.277
Loglikelihood unrestricted model (H1) -3933.834
Akaike (AIC) 7972.554
Bayesian (BIC) 8144.056
Sample-size adjusted Bayesian (SABIC) 7995.018
Root Mean Square Error of Approximation:
RMSEA 0.036
90 Percent confidence interval - lower 0.000
90 Percent confidence interval - upper 0.083
P-value H_0: RMSEA <= 0.050 0.631
P-value H_0: RMSEA >= 0.080 0.065
Standardized Root Mean Square Residual:
SRMR 0.020
Parameter Estimates:
Standard errors Bootstrap
Number of requested bootstrap draws 5000
Number of successful bootstrap draws 5000
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
factcheck_A ~
Lt_P_TK (c1) -0.095 0.102 -0.928 0.353 -0.095 -0.098
Lt_P_SK (c2) 0.234 0.095 2.471 0.013 0.234 0.241
Lt_N_SE (c3) 0.125 0.084 1.481 0.139 0.125 0.111
Lt_N_KU (c4) 0.007 0.106 0.069 0.945 0.007 0.005
Lt_N_EC (c5) 0.086 0.098 0.879 0.379 0.086 0.081
MH_expert ~
Lt_P_TK (a3_1) -0.145 0.104 -1.399 0.162 -0.145 -0.142
Lt_P_SK (a3_2) 0.076 0.097 0.789 0.430 0.076 0.074
Lt_N_SE (a3_3) 0.231 0.091 2.546 0.011 0.231 0.195
Lt_N_KU (a3_4) -0.274 0.113 -2.434 0.015 -0.274 -0.189
Lt_N_EC (a3_5) 0.438 0.102 4.296 0.000 0.438 0.389
MH_objective ~
Lt_P_TK (a4_1) -0.111 0.127 -0.874 0.382 -0.111 -0.095
Lt_P_SK (a4_2) 0.057 0.127 0.449 0.654 0.057 0.049
Lt_N_SE (a4_3) 0.218 0.107 2.036 0.042 0.218 0.160
Lt_N_KU (a4_4) -0.230 0.130 -1.771 0.077 -0.230 -0.139
Lt_N_EC (a4_5) 0.477 0.116 4.103 0.000 0.477 0.370
MH_accurate ~
Lt_P_TK (a5_1) -0.192 0.115 -1.672 0.094 -0.192 -0.183
Lt_P_SK (a5_2) 0.085 0.111 0.769 0.442 0.085 0.081
Lt_N_SE (a5_3) 0.247 0.100 2.463 0.014 0.247 0.203
Lt_N_KU (a5_4) -0.255 0.116 -2.191 0.028 -0.255 -0.171
Lt_N_EC (a5_5) 0.501 0.102 4.925 0.000 0.501 0.434
credible2 ~
MH_xprt (b1_3) 0.361 0.052 6.940 0.000 0.361 0.390
MH_bjct (b1_4) 0.104 0.045 2.337 0.019 0.104 0.129
MH_ccrt (b1_5) 0.298 0.050 5.997 0.000 0.298 0.330
factcheck_A ~
credbl2 (d1) -0.310 0.074 -4.196 0.000 -0.310 -0.303
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
Lit_Pin_TK ~~
Lit_Pin_SK 1.404 0.120 11.664 0.000 1.404 0.824
Lit_Ng_SE 0.702 0.104 6.779 0.000 0.702 0.476
Lit_Ng_KU 0.685 0.081 8.507 0.000 0.685 0.569
Lit_Ng_EC 0.883 0.112 7.896 0.000 0.883 0.568
Lit_Pin_SK ~~
Lit_Ng_SE 0.615 0.097 6.364 0.000 0.615 0.418
Lit_Ng_KU 0.639 0.071 9.011 0.000 0.639 0.531
Lit_Ng_EC 0.791 0.101 7.846 0.000 0.791 0.509
Lit_Ng_SE ~~
Lit_Ng_KU 0.579 0.063 9.215 0.000 0.579 0.556
Lit_Ng_EC 0.791 0.111 7.146 0.000 0.791 0.589
Lit_Ng_KU ~~
Lit_Ng_EC 0.728 0.068 10.640 0.000 0.728 0.664
.MH_expert ~~
.MH_objective 0.880 0.136 6.456 0.000 0.880 0.503
.MH_accurate 0.900 0.128 7.034 0.000 0.900 0.588
.MH_objective ~~
.MH_accurate 0.999 0.122 8.195 0.000 0.999 0.568
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
Lit_Pin_TK 1.707 0.135 12.614 0.000 1.707 1.000
Lit_Pin_SK 1.701 0.126 13.507 0.000 1.701 1.000
Lit_Ng_SE 1.276 0.127 10.027 0.000 1.276 1.000
Lit_Ng_KU 0.850 0.060 14.206 0.000 0.850 1.000
Lit_Ng_EC 1.416 0.119 11.889 0.000 1.416 1.000
.MH_expert 1.523 0.169 8.989 0.000 1.523 0.848
.MH_objective 2.015 0.157 12.863 0.000 2.015 0.859
.MH_accurate 1.535 0.137 11.226 0.000 1.535 0.814
.credible2 0.679 0.104 6.499 0.000 0.679 0.441
.factcheck_A 1.401 0.112 12.459 0.000 1.401 0.868
R-Square:
Estimate
MH_expert 0.152
MH_objective 0.141
MH_accurate 0.186
credible2 0.559
factcheck_A 0.132
Defined Parameters:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
SE_xprt_crdbl2 -0.026 0.013 -1.976 0.048 -0.026 -0.023
SE_obj_credbl2 -0.007 0.005 -1.400 0.161 -0.007 -0.006
SE_acc_credbl2 -0.023 0.011 -1.995 0.046 -0.023 -0.020
EC_xprt_crdbl2 -0.049 0.019 -2.513 0.012 -0.049 -0.046
EC_obj_credbl2 -0.053 0.020 -2.622 0.009 -0.053 -0.044
EC_acc_credbl2 -0.056 0.020 -2.830 0.005 -0.056 -0.051
KU_xprt_crdbl2 0.031 0.016 1.861 0.063 0.031 0.022
KU_bjct_crdbl2 0.007 0.006 1.318 0.187 0.007 0.005
KU_acc_credbl2 0.024 0.013 1.774 0.076 0.024 0.017
========== The following analysis is before data_new(without including all participants)
data <- read_sav("/Users/mj/Library/CloudStorage/Dropbox/@Chat GPT and User Adaptation/ChatGPT Survey data/ChatGPT_cleaned.sav")
data
colnames(data)
Checking whether education, STEM, and other demographic factors predict literacy levels
#checking response options in education variable (Q48 column)
unique(data$Q48)
table(data$Q48)
summary(data$Q48)
#Recoding education variable: 1 is less than high school, 2 is high school or professional degree, 3 is college/bachelor's degree, 4 is mater's degree or higher
data <- data %>%
mutate(Edu= case_when(
Q48 == "Some high school, no diploma" ~ 1,
Q48 == "Trade/technical/vocational training" ~ 1,
Q48 == "Some college credit, no degree" ~ 2,
Q48 == "Professional degree" ~ 2,
Q48 == "high school graduate, diploma or the equivalent (for example: GED)" ~ 2,
Q48 == "Associate degree" ~ 3,
Q48 == "Bachelor’s degree" ~ 3,
Q48 == "Master’s degree" ~ 4
))
unique(data$Edu)
table(data$Edu)
summary(data$Edu)
#Recoding gender string to gender numeric
data <- data %>%
mutate(Gen_num= case_when(
Gender == "Male" ~ 1,
Gender == "Female" ~ 0,
))
table(data$Gen_num)
summary(data$Gen_num)
unique_values <- lapply(data[, c("Q50")], unique)
print(unique_values)
#Recoding gender string to gender numeric
data <- data %>%
mutate(stem= case_when(
Q50 == "Yes" ~ 1,
Q50 == "No" ~ 0,
Q50 == "Not sure" ~ 0,
Q50 == "" ~ 0
))
table(data$stem)
summary(data$stem)
Running linear regression where demographic factors predict the literacy variables
# Fit the multivariate linear regression model
model_reg <- lm(cbind(Lit_Pin_TK, Lit_Pin_SK, Lit_Ng_SE, Lit_Ng_KU, Lit_Ng_EC) ~ Age + Gen_num + Edu + stem, data = data)
summary(model_reg)
#Found an issue with credibility meausre ("accurate" is replicated in MH_accurate), to address this, create credible2 variable by only adding credible(1), reliable(3),expert(4), and trusworthy(5)
# Create a new variable by calculating the mean of var1 and var2
data$credible2 <- rowMeans(data[, c("Credible_1", "Credible_3","Credible_4","Credible_5")], na.rm = TRUE)
# Specify mediation model that has only credible2 as the second level mediator
model_5<-
'
# Direct effects of IVs on DV
factcheck_A ~ c1*Lit_Pin_TK + c2*Lit_Pin_SK + c3*Lit_Ng_SE + c4*Lit_Ng_KU + c5*Lit_Ng_EC
# Direct effects of IVs on first-level mediators
MH_expert ~ a3_1*Lit_Pin_TK + a3_2*Lit_Pin_SK + a3_3*Lit_Ng_SE + a3_4*Lit_Ng_KU + a3_5*Lit_Ng_EC
MH_objective ~ a4_1*Lit_Pin_TK + a4_2*Lit_Pin_SK + a4_3*Lit_Ng_SE + a4_4*Lit_Ng_KU + a4_5*Lit_Ng_EC
MH_accurate ~ a5_1*Lit_Pin_TK + a5_2*Lit_Pin_SK + a5_3*Lit_Ng_SE + a5_4*Lit_Ng_KU + a5_5*Lit_Ng_EC
# Direct effects of first-level mediators on second-level mediators
credible2 ~ b1_3*MH_expert + b1_4*MH_objective + b1_5*MH_accurate
# Direct effects of first and second-level mediators on DV
factcheck_A ~ d1*credible2
# Indirect effects via first and second-level mediators
SE_expert_credible2 := a3_3*b1_3*d1
SE_obj_credible2 := a4_3*b1_4*d1
SE_acc_credible2 := a5_3*b1_5*d1
EC_expert_credible2 := a3_5*b1_3*d1
EC_obj_credible2 := a4_5*b1_3*d1
EC_acc_credible2 := a5_5*b1_3*d1
KU_expert_credible2 := a3_4*b1_3*d1
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_KU~~Lit_Ng_KU
Lit_Ng_EC~~Lit_Ng_EC
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_KU
Lit_Pin_TK~~Lit_Ng_EC
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_KU
Lit_Pin_SK~~Lit_Ng_EC
Lit_Ng_SE~~Lit_Ng_KU
Lit_Ng_SE~~Lit_Ng_EC
Lit_Ng_KU~~Lit_Ng_EC
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible2~~credible2
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
'
# Add bootstrapping to the lavaan function call
result.model_5 <- lavaan(model_5, data = data, se = "boot", bootstrap = 5000)
# Display the results with the specified options
summary(result.model_5, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
lavaan 0.6-18 ended normally after 41 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 47
Used Total
Number of observations 223 225
Model Test User Model:
Test statistic 8.121
Degrees of freedom 8
P-value (Chi-square) 0.422
Model Test Baseline Model:
Test statistic 1165.597
Degrees of freedom 45
P-value 0.000
User Model versus Baseline Model:
Comparative Fit Index (CFI) 1.000
Tucker-Lewis Index (TLI) 0.999
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -3138.692
Loglikelihood unrestricted model (H1) -3134.632
Akaike (AIC) 6371.385
Bayesian (BIC) 6531.522
Sample-size adjusted Bayesian (SABIC) 6382.573
Root Mean Square Error of Approximation:
RMSEA 0.008
90 Percent confidence interval - lower 0.000
90 Percent confidence interval - upper 0.079
P-value H_0: RMSEA <= 0.050 0.755
P-value H_0: RMSEA >= 0.080 0.047
Standardized Root Mean Square Residual:
SRMR 0.021
Parameter Estimates:
Standard errors Bootstrap
Number of requested bootstrap draws 5000
Number of successful bootstrap draws 5000
Regressions:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
factcheck_A ~
Lt_P_TK (c1) -0.128 0.108 -1.185 0.236 -0.128 -0.133
Lt_P_SK (c2) 0.266 0.098 2.716 0.007 0.266 0.273
Lt_N_SE (c3) 0.108 0.091 1.186 0.236 0.108 0.098
Lt_N_KU (c4) 0.035 0.116 0.303 0.762 0.035 0.025
Lt_N_EC (c5) 0.038 0.107 0.358 0.720 0.038 0.037
MH_expert ~
Lt_P_TK (a3_1) -0.088 0.117 -0.751 0.453 -0.088 -0.085
Lt_P_SK (a3_2) 0.016 0.113 0.141 0.888 0.016 0.015
Lt_N_SE (a3_3) 0.250 0.102 2.453 0.014 0.250 0.209
Lt_N_KU (a3_4) -0.373 0.133 -2.810 0.005 -0.373 -0.246
Lt_N_EC (a3_5) 0.438 0.107 4.093 0.000 0.438 0.390
MH_objective ~
Lt_P_TK (a4_1) -0.072 0.145 -0.497 0.619 -0.072 -0.061
Lt_P_SK (a4_2) -0.084 0.146 -0.578 0.563 -0.084 -0.070
Lt_N_SE (a4_3) 0.272 0.117 2.326 0.020 0.272 0.197
Lt_N_KU (a4_4) -0.209 0.159 -1.318 0.188 -0.209 -0.120
Lt_N_EC (a4_5) 0.429 0.126 3.409 0.001 0.429 0.331
MH_accurate ~
Lt_P_TK (a5_1) -0.162 0.126 -1.284 0.199 -0.162 -0.153
Lt_P_SK (a5_2) -0.048 0.127 -0.376 0.707 -0.048 -0.045
Lt_N_SE (a5_3) 0.265 0.109 2.446 0.014 0.265 0.216
Lt_N_KU (a5_4) -0.241 0.136 -1.775 0.076 -0.241 -0.155
Lt_N_EC (a5_5) 0.482 0.108 4.463 0.000 0.482 0.418
credible2 ~
MH_xprt (b1_3) 0.390 0.053 7.355 0.000 0.390 0.438
MH_bjct (b1_4) 0.066 0.044 1.503 0.133 0.066 0.086
MH_ccrt (b1_5) 0.326 0.053 6.168 0.000 0.326 0.375
factcheck_A ~
credbl2 (d1) -0.361 0.084 -4.281 0.000 -0.361 -0.347
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
Lit_Pin_TK ~~
Lit_Pin_SK 1.468 0.139 10.563 0.000 1.468 0.820
Lit_Ng_SE 0.719 0.123 5.833 0.000 0.719 0.458
Lit_Ng_KU 0.721 0.097 7.461 0.000 0.721 0.583
Lit_Ng_EC 0.912 0.133 6.834 0.000 0.912 0.547
Lit_Pin_SK ~~
Lit_Ng_SE 0.625 0.113 5.524 0.000 0.625 0.405
Lit_Ng_KU 0.653 0.084 7.782 0.000 0.653 0.536
Lit_Ng_EC 0.782 0.122 6.412 0.000 0.782 0.477
Lit_Ng_SE ~~
Lit_Ng_KU 0.565 0.075 7.560 0.000 0.565 0.529
Lit_Ng_EC 0.816 0.133 6.139 0.000 0.816 0.567
Lit_Ng_KU ~~
Lit_Ng_EC 0.745 0.080 9.289 0.000 0.745 0.656
.MH_expert ~~
.MH_objective 0.961 0.158 6.076 0.000 0.961 0.501
.MH_accurate 0.978 0.153 6.372 0.000 0.978 0.588
.MH_objective ~~
.MH_accurate 1.089 0.139 7.843 0.000 1.089 0.561
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
Lit_Pin_TK 1.818 0.158 11.515 0.000 1.818 1.000
Lit_Pin_SK 1.761 0.139 12.679 0.000 1.761 1.000
Lit_Ng_SE 1.354 0.151 8.978 0.000 1.354 1.000
Lit_Ng_KU 0.843 0.071 11.899 0.000 0.843 1.000
Lit_Ng_EC 1.529 0.136 11.230 0.000 1.529 1.000
.MH_expert 1.644 0.188 8.765 0.000 1.644 0.851
.MH_objective 2.242 0.183 12.263 0.000 2.242 0.873
.MH_accurate 1.683 0.161 10.440 0.000 1.683 0.827
.credible2 0.559 0.061 9.180 0.000 0.559 0.364
.factcheck_A 1.398 0.125 11.217 0.000 1.398 0.840
R-Square:
Estimate
MH_expert 0.149
MH_objective 0.127
MH_accurate 0.173
credible2 0.636
factcheck_A 0.160
Defined Parameters:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
SE_xprt_crdbl2 -0.035 0.018 -1.995 0.046 -0.035 -0.032
SE_obj_credbl2 -0.007 0.006 -1.139 0.255 -0.007 -0.006
SE_acc_credbl2 -0.031 0.015 -2.020 0.043 -0.031 -0.028
EC_xprt_crdbl2 -0.062 0.023 -2.630 0.009 -0.062 -0.059
EC_obj_credbl2 -0.061 0.024 -2.572 0.010 -0.061 -0.050
EC_acc_credbl2 -0.068 0.023 -3.011 0.003 -0.068 -0.063
KU_xprt_crdbl2 0.053 0.023 2.255 0.024 0.053 0.037
# Specify mediation model with credible2, Model3+credible2
model_4<-
'
# Direct effects of IVs on DV
factcheck_A ~ c1*Lit_Pin_TK + c2*Lit_Pin_SK + c3*Lit_Ng_SE + c4*Lit_Ng_KU + c5*Lit_Ng_EC
# Direct effects of IVs on first-level mediators
MH_expert ~ a3_1*Lit_Pin_TK + a3_2*Lit_Pin_SK + a3_3*Lit_Ng_SE + a3_4*Lit_Ng_KU + a3_5*Lit_Ng_EC
MH_objective ~ a4_1*Lit_Pin_TK + a4_2*Lit_Pin_SK + a4_3*Lit_Ng_SE + a4_4*Lit_Ng_KU + a4_5*Lit_Ng_EC
MH_accurate ~ a5_1*Lit_Pin_TK + a5_2*Lit_Pin_SK + a5_3*Lit_Ng_SE + a5_4*Lit_Ng_KU + a5_5*Lit_Ng_EC
# Direct effects of first-level mediators on second-level mediators
credible2 ~ b1_3*MH_expert + b1_4*MH_objective + b1_5*MH_accurate
trust ~ b2_3*MH_expert + b2_4*MH_objective + b2_5*MH_accurate
# Direct effects of first and second-level mediators on DV
factcheck_A ~ d1*credible2 + d2*trust
# Indirect effects via first and second-level mediators
SE_expert_credible2 := a3_3*b1_3*d1
SE_obj_credible2 := a4_3*b1_4*d1
SE_acc_credible2 := a5_3*b1_5*d1
EC_expert_credible2 := a3_5*b1_3*d1
EC_obj_credible2 := a4_5*b1_3*d1
EC_acc_credible2 := a5_5*b1_3*d1
KU_expert_credible2 := a3_4*b1_3*d1
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_KU~~Lit_Ng_KU
Lit_Ng_EC~~Lit_Ng_EC
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_KU
Lit_Pin_TK~~Lit_Ng_EC
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_KU
Lit_Pin_SK~~Lit_Ng_EC
Lit_Ng_SE~~Lit_Ng_KU
Lit_Ng_SE~~Lit_Ng_EC
Lit_Ng_KU~~Lit_Ng_EC
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible2~~credible2
trust~~trust
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
credible2~~trust
'
# Add bootstrapping to the lavaan function call
result.model_4 <- lavaan(model_4, data = data, se = "boot", bootstrap = 5000)
# Display the results with the specified options
summary(result.model_4, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
# Specify mediation model with MH expert, objective, accurate only
model_3<-
'
# Direct effects of IVs on DV
factcheck_A ~ c1*Lit_Pin_TK + c2*Lit_Pin_SK + c3*Lit_Ng_SE + c4*Lit_Ng_KU + c5*Lit_Ng_EC
# Direct effects of IVs on first-level mediators
MH_expert ~ a3_1*Lit_Pin_TK + a3_2*Lit_Pin_SK + a3_3*Lit_Ng_SE + a3_4*Lit_Ng_KU + a3_5*Lit_Ng_EC
MH_objective ~ a4_1*Lit_Pin_TK + a4_2*Lit_Pin_SK + a4_3*Lit_Ng_SE + a4_4*Lit_Ng_KU + a4_5*Lit_Ng_EC
MH_accurate ~ a5_1*Lit_Pin_TK + a5_2*Lit_Pin_SK + a5_3*Lit_Ng_SE + a5_4*Lit_Ng_KU + a5_5*Lit_Ng_EC
# Direct effects of first-level mediators on second-level mediators
credible ~ b1_3*MH_expert + b1_4*MH_objective + b1_5*MH_accurate
trust ~ b2_3*MH_expert + b2_4*MH_objective + b2_5*MH_accurate
# Direct effects of second-level mediators on DV
factcheck_A ~ d1*credible + d2*trust
# Indirect effects via first and second-level mediators
SE_expert_credible := a3_3*b1_3*d1
SE_obj_credible := a4_3*b1_4*d1
SE_acc_credible := a5_3*b1_5*d1
EC_expert_credible := a3_5*b1_3*d1
EC_obj_credible := a4_5*b1_3*d1
EC_acc_credible := a5_5*b1_3*d1
KU_expert_credible := a3_4*b1_3*d1
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_KU~~Lit_Ng_KU
Lit_Ng_EC~~Lit_Ng_EC
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_KU
Lit_Pin_TK~~Lit_Ng_EC
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_KU
Lit_Pin_SK~~Lit_Ng_EC
Lit_Ng_SE~~Lit_Ng_KU
Lit_Ng_SE~~Lit_Ng_EC
Lit_Ng_KU~~Lit_Ng_EC
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible~~credible
trust~~trust
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
credible~~trust
'
# Add bootstrapping to the lavaan function call
result.model_3 <- lavaan(model_3, data = data, se = "boot", bootstrap = 5000)
# Display the results with the specified options
summary(result.model_3, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
#Correlation between the literacy variables
# Select the five variables
selected_vars <- data[, c("Lit_Pin_TK", "Lit_Pin_SK", "Lit_Ng_SE", "Lit_Ng_KU", "Lit_Ng_EC")]
# Calculate the Pearson correlation matrix
correlation_matrix <- cor(selected_vars, use = "pairwise.complete.obs", method = "pearson")
# View the correlation matrix
print(correlation_matrix)
# Specify mediation model with all five MH (efficient, useful, expert, objective, and accurate)
model_2<-
'
# Direct effects of IVs on DV
factcheck_A ~ c1*Lit_Pin_TK + c2*Lit_Pin_SK + c3*Lit_Ng_SE + c4*Lit_Ng_KU + c5*Lit_Ng_EC
# Direct effects of IVs on first-level mediators
MH_efficient ~ a1_1*Lit_Pin_TK + a1_2*Lit_Pin_SK + a1_3*Lit_Ng_SE + a1_4*Lit_Ng_KU + a1_5*Lit_Ng_EC
MH_useful ~ a2_1*Lit_Pin_TK + a2_2*Lit_Pin_SK + a2_3*Lit_Ng_SE + a2_4*Lit_Ng_KU + a2_5*Lit_Ng_EC
MH_expert ~ a3_1*Lit_Pin_TK + a3_2*Lit_Pin_SK + a3_3*Lit_Ng_SE + a3_4*Lit_Ng_KU + a3_5*Lit_Ng_EC
MH_objective ~ a4_1*Lit_Pin_TK + a4_2*Lit_Pin_SK + a4_3*Lit_Ng_SE + a4_4*Lit_Ng_KU + a4_5*Lit_Ng_EC
MH_accurate ~ a5_1*Lit_Pin_TK + a5_2*Lit_Pin_SK + a5_3*Lit_Ng_SE + a5_4*Lit_Ng_KU + a5_5*Lit_Ng_EC
# Direct effects of first-level mediators on second-level mediators
credible ~ b1_1*MH_efficient + b1_2*MH_useful + b1_3*MH_expert + b1_4*MH_objective + b1_5*MH_accurate
trust ~ b2_1*MH_efficient + b2_2*MH_useful + b2_3*MH_expert + b2_4*MH_objective + b2_5*MH_accurate
# Direct effects of second-level mediators on DV
factcheck_A ~ d1*credible + d2*trust
# Indirect effects via first and second-level mediators
SE_expert_credible := a3_3*b1_3*d1
SE_obj_credible := a4_3*b1_4*d1
SE_acc_credible := a5_3*b1_5*d1
EC_expert_credible := a3_5*b1_3*d1
EC_obj_credible := a4_5*b1_3*d1
EC_acc_credible := a5_5*b1_3*d1
KU_expert_credible := a3_4*b1_3*d1
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_KU~~Lit_Ng_KU
Lit_Ng_EC~~Lit_Ng_EC
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_KU
Lit_Pin_TK~~Lit_Ng_EC
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_KU
Lit_Pin_SK~~Lit_Ng_EC
Lit_Ng_SE~~Lit_Ng_KU
Lit_Ng_SE~~Lit_Ng_EC
Lit_Ng_KU~~Lit_Ng_EC
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_efficient~~MH_efficient
MH_useful~~MH_useful
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible~~credible
trust~~trust
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_efficient~~MH_useful
MH_efficient~~MH_expert
MH_efficient~~MH_objective
MH_efficient~~MH_accurate
MH_useful~~MH_expert
MH_useful~~MH_objective
MH_useful~~MH_accurate
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
credible~~trust
'
# Add bootstrapping to the lavaan function call
result.model_2 <- lavaan(model_2, data = data, se = "boot", bootstrap = 5000)
# Display the results with the specified options
summary(result.model_2, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
# Specify mediation model
model <-
'
#direct effect
factcheck_A ~ Lit_Pin_TK + Lit_Pin_SK + Lit_Ng_SE + Lit_Ng_KU + Lit_Ng_EC
#indirect effects a-> b
MH_efficient ~ a1*Lit_Pin_TK + a2*Lit_Pin_SK + a3*Lit_Ng_SE + a4*Lit_Ng_KU + a5*Lit_Ng_EC
MH_useful ~ a6*Lit_Pin_TK + a7*Lit_Pin_SK + a8*Lit_Ng_SE + a9*Lit_Ng_KU + a10*Lit_Ng_EC
MH_expert ~ a11*Lit_Pin_TK + a12*Lit_Pin_SK + a13*Lit_Ng_SE + a14*Lit_Ng_KU + a15*Lit_Ng_EC
MH_objective ~ a16*Lit_Pin_TK + Lit_Pin_SK + Lit_Ng_SE + Lit_Ng_KU + Lit_Ng_EC
MH_accurate ~ a21*Lit_Pin_TK + Lit_Pin_SK + Lit_Ng_SE + Lit_Ng_KU + Lit_Ng_EC
# indirect effects a -> c
credible ~ Lit_Pin_TK + Lit_Pin_SK + Lit_Ng_SE + Lit_Ng_KU + Lit_Ng_EC
trust ~ Lit_Pin_TK + Lit_Pin_SK + Lit_Ng_SE + Lit_Ng_KU + Lit_Ng_EC
# indirect effects b -> c
credible ~ MH_efficient + MH_useful + MH_expert + MH_objective + MH_accurate
trust ~ MH_efficient + MH_useful + MH_expert + MH_objective + MH_accurate
# indirect effects c -> d
factcheck_A ~ credible + trust
#Estimating covariance and residuals
#Estimating variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_TK
Lit_Pin_SK~~Lit_Pin_SK
Lit_Ng_SE~~Lit_Ng_SE
Lit_Ng_KU~~Lit_Ng_KU
Lit_Ng_EC~~Lit_Ng_EC
#Estimating co-variances of exogenous variables (Xs)
Lit_Pin_TK~~Lit_Pin_SK
Lit_Pin_TK~~Lit_Ng_SE
Lit_Pin_TK~~Lit_Ng_KU
Lit_Pin_TK~~Lit_Ng_EC
Lit_Pin_SK~~Lit_Ng_SE
Lit_Pin_SK~~Lit_Ng_KU
Lit_Pin_SK~~Lit_Ng_EC
Lit_Ng_SE~~Lit_Ng_KU
Lit_Ng_SE~~Lit_Ng_EC
Lit_Ng_KU~~Lit_Ng_EC
#Estimating the residual variances (e1,…) for endogenous variables (Ms and Ys)
MH_efficient~~MH_efficient
MH_useful~~MH_useful
MH_expert~~MH_expert
MH_objective~~MH_objective
MH_accurate~~MH_accurate
credible~~credible
trust~~trust
factcheck_A~~factcheck_A
#Estimating the covariances of residuals for Ms
MH_efficient~~MH_useful
MH_efficient~~MH_expert
MH_efficient~~MH_objective
MH_efficient~~MH_accurate
MH_useful~~MH_expert
MH_useful~~MH_objective
MH_useful~~MH_accurate
MH_expert~~MH_objective
MH_expert~~MH_accurate
MH_objective~~MH_accurate
credible~~trust'
result.model <- lavaan(model, data=data)
result.model
summary (result.model, fit.measure=TRUE, standardized = TRUE, rsquare = TRUE, modindices = TRUE)
colnames(data)
library(psych)
tbl_df(data)
data %>%
dplyr::select(Expectancyviolation_1:Expectancyviolation_4) %>%
psych::alpha(,title = "EV")