diff --git a/study_data/.DS_Store b/study_data/.DS_Store index 0617ec5..d9c530f 100644 Binary files a/study_data/.DS_Store and b/study_data/.DS_Store differ diff --git a/study_data/full_Study/complexity_chartType_interaction.pdf b/study_data/full_Study/complexity_chartType_interaction.pdf new file mode 100644 index 0000000..ef334a1 Binary files /dev/null and b/study_data/full_Study/complexity_chartType_interaction.pdf differ diff --git a/study_data/full_Study/complexity_dataType_interaction.pdf b/study_data/full_Study/complexity_dataType_interaction.pdf index 22da269..3ec1fb2 100644 Binary files a/study_data/full_Study/complexity_dataType_interaction.pdf and b/study_data/full_Study/complexity_dataType_interaction.pdf differ diff --git a/study_data/full_Study/complexity_datatrust_4_chartTypeInteraction.pdf b/study_data/full_Study/complexity_datatrust_4_chartTypeInteraction.pdf new file mode 100644 index 0000000..f078eea Binary files /dev/null and b/study_data/full_Study/complexity_datatrust_4_chartTypeInteraction.pdf differ diff --git a/study_data/full_Study/complexity_datatrust_4_interaction.pdf b/study_data/full_Study/complexity_datatrust_4_interaction.pdf new file mode 100644 index 0000000..52eff1b Binary files /dev/null and b/study_data/full_Study/complexity_datatrust_4_interaction.pdf differ diff --git a/study_data/full_Study/complexity_datatrust_5_interaction.pdf b/study_data/full_Study/complexity_datatrust_5_interaction.pdf new file mode 100644 index 0000000..bd8a8df Binary files /dev/null and b/study_data/full_Study/complexity_datatrust_5_interaction.pdf differ diff --git a/study_data/full_Study/trustFullAnalysis_6.12.2023.Rmd b/study_data/full_Study/trustFullAnalysis_6.12.2023.Rmd index 5b4eb4a..79688fc 100644 --- a/study_data/full_Study/trustFullAnalysis_6.12.2023.Rmd +++ b/study_data/full_Study/trustFullAnalysis_6.12.2023.Rmd @@ -16,6 +16,7 @@ library(patchwork) library(rstatix) library(effectsize) library(GPArotation) +library(MASS) # environment to include the ss_psych450_rws3 platform load("ss_psych450_rws3") ``` @@ -93,11 +94,63 @@ results %>% -ggsave(paste("complexity_dataType_interaction.pdf", sep="")) +#ggsave(paste("complexity_dataType_interaction.pdf", sep="")) ``` +```{r} + +MinMeanSEMMax <- function(x) { + v <- c(min(x), mean(x) - sd(x)/sqrt(length(x)), mean(x), mean(x) + sd(x)/sqrt(length(x)), max(x)) + names(v) <- c("ymin", "lower", "middle", "upper", "ymax") + v +} + +results %>% + # group_by(complexity, isCovidData) %>% + ggplot(aes( x = vis.trust_6, y = 0, cex=1.5, colour = chartType)) + + scale_color_manual(values = c("purple", "orange")) + + ylim(-0.5, 0.5) + + geom_jitter(data = results, width = 0.3, height = 0.2, color = "light gray", alpha = 0.5) + + #stat_summary(fun.data=MinMeanSEMMax, geom="boxplot", colour="red") + + + geom_boxplot(lwd = 1, fatten = NULL, width = 0.25, alpha = 0.5) + + + geom_segment(data = results %>% + group_by(complexity, chartType) %>% + summarize(n = n(), + mean = mean(vis.trust_6), + se = sd(vis.trust_6)/sqrt(n)), + aes(x = mean, xend = mean, y = -.25, yend = .25, colour = chartType), size = 1) + + # stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 0.5, position = position_nudge(x=0.25, y=0), alpha=0.5) + + + geom_text( data = results %>% + group_by(complexity, chartType) %>% + summarize(n = n(), + mean = round(mean(vis.trust_6),digits=2), + se = round(sd(data.trust_6)/sqrt(n),digits=2), + vis.trust_6 = mean(vis.trust_6)), + # aes(label = paste(mean, "[",mean-se,",",mean+se,"]"), x = 6.2, y = 0.43, fontface = 3), size=3, colour = "black")+ + aes(label = paste(mean), x = mean, y = .35, fontface = 3), size=4, colour = "black")+ + + facet_grid(complexity ~ chartType) + + xlab("Trust in Visualization") + + theme_minimal() + + theme(panel.spacing = unit(2, "lines"), + legend.position = "none", + axis.text.y = element_blank(), + axis.title.y = element_blank(), + axis.ticks.y = element_blank()) + + + +ggsave(paste("complexity_chartType_interaction.pdf", sep="")) + +``` + + + ```{r} results %>% group_by(complexity, isCovidData) %>% @@ -148,7 +201,7 @@ results %>% axis.title.y = element_blank(), axis.ticks.y = element_blank()) -ggsave(paste("complexity_interaction.pdf", sep="")) +#ggsave(paste("complexity_interaction.pdf", sep="")) ``` @@ -164,9 +217,8 @@ results %>% ``` ```{r} -model <- lm(formula = vis.trust_6 ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , - data = results%>%filter(isCovidData == 1) - filter(isCovidData ==1 )) +model <- lm(formula = vis.trust_6 ~ complexity * as.factor(isCovidData) * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , + data = results) anova(model) ``` ```{r} @@ -196,15 +248,32 @@ anova(model) ``` ```{r} -# can change the predictor to bar.vis -model<- manova(cbind(vis.trust_6, - vis.trust_5, - vis.trust_4, - vis.trust_3, - vis.trust_2, - vis.trust_1) ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , - data = results %>%filter(isCovidData == 1)) + +model<- manova( cbind(vis.trust_6,vis.trust_1,vis.trust_2,vis.trust_3,vis.trust_4,vis.trust_5,affect.science_1,affect.clarity_1,affect.aesthetic_1) ~ complexity * as.factor(isCovidData) * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , + data = results) + +summary(model) +eta_squared(model) + +summary.aov(model) + + + +``` + + +```{r} + +model<- manova( cbind(data.trust_6,data.trust_1,data.trust_2,data.trust_3,data.trust_4,data.trust_5) ~ complexity * as.factor(isCovidData) * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , + data = results) + +anova(model) +eta_squared(model) + summary.aov(model) + + + ``` ```{r} @@ -479,7 +548,7 @@ results %>% How does performance on VLAT questions predict trust? ```{r} -model <- lm(formula = vis.trust_6 ~ assigned_vlat * +model <- lm(formula = vis.trust_6 ~ assigned_vlat + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1, diff --git a/study_data/full_Study/trustFullAnalysis_6.12.2023.nb.html b/study_data/full_Study/trustFullAnalysis_6.12.2023.nb.html new file mode 100644 index 0000000..2f08aab --- /dev/null +++ b/study_data/full_Study/trustFullAnalysis_6.12.2023.nb.html @@ -0,0 +1,3690 @@ + + + + + + + + + + + + + +Trust in Science Analysis Notebook + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +

+Attaching package: ‘MASS’
+
+The following object is masked from ‘package:rstatix’:
+
+    select
+
+The following object is masked from ‘package:patchwork’:
+
+    area
+
+The following object is masked from ‘package:dplyr’:
+
+    select
+
+Warning: namespace ‘ez’ is not available and has been replaced
+by .GlobalEnv when processing object ‘anova_result’
+ + + +

Load Data

+ + + +
results <- read.csv("data_clean_june30.csv")
+
+# trust in data is the column: bar-data_6
+# trust in vis is the column: bar-vis_6
+ + + +

Converting covariates to factors

+ + + +
results$Gender <- as.factor(results$Gender)
+results$Education <- as.factor(results$Education)
+results$Parents_education <- as.factor(results$Parents_education)
+results$Language <- as.factor(results$Language)
+results$Ethnicity <- as.factor(results$Ethnicity)
+results$Income <- as.factor(results$Income)
+results$Religion <- as.factor(results$Religion)
+ + + +

Trust in Vis

+ + + +
# results$isCovidData <- factor(results$isCovidData, levels = c(0, 1),
+#                   labels = c("Crop Data", "Covid Data"))
+ + + + + + +

+MinMeanSEMMax <- function(x) {
+  v <- c(min(x), mean(x) - sd(x)/sqrt(length(x)), mean(x), mean(x) + sd(x)/sqrt(length(x)), max(x))
+  names(v) <- c("ymin", "lower", "middle", "upper", "ymax")
+  v
+}
+
+results %>%
+  # group_by(complexity, isCovidData) %>%
+  ggplot(aes( x = vis.trust_6, y = 0, cex=1.5, colour = as.factor(isCovidData))) +
+  scale_color_manual(values = c("purple", "orange")) +
+  ylim(-0.5, 0.5) +
+  geom_jitter(data = results, width = 0.3, height = 0.2, color = "light gray", alpha = 0.5) +
+  #stat_summary(fun.data=MinMeanSEMMax, geom="boxplot", colour="red") +
+
+  geom_boxplot(lwd = 1, fatten = NULL, width = 0.25, alpha = 0.5) +
+
+  geom_segment(data = results %>% 
+                group_by(complexity, isCovidData) %>%
+                summarize(n = n(), 
+                           mean = mean(vis.trust_6),
+            se = sd(vis.trust_6)/sqrt(n)), 
+              aes(x = mean, xend = mean, y = -.25, yend = .25,  colour = as.factor(isCovidData)), size = 1) +
+        # stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 0.5, position = position_nudge(x=0.25, y=0), alpha=0.5) +
+
+  geom_text( data = results %>% 
+                group_by(complexity, isCovidData) %>%
+                summarize(n = n(), 
+                           mean = round(mean(vis.trust_6),digits=2),
+            se = round(sd(data.trust_6)/sqrt(n),digits=2),
+                          vis.trust_6 = mean(vis.trust_6)),
+            # aes(label = paste(mean, "[",mean-se,",",mean+se,"]"), x = 6.2, y = 0.43, fontface = 3), size=3, colour = "black")+
+              aes(label = paste(mean), x = mean, y = .35, fontface = 3), size=4, colour = "black")+
+
+  facet_grid(complexity ~ isCovidData) +
+  xlab("Trust in Visualization") +
+  theme_minimal() + 
+  theme(panel.spacing = unit(2, "lines"),
+        legend.position = "none",
+        axis.text.y = element_blank(),
+        axis.title.y = element_blank(),
+        axis.ticks.y = element_blank())
+ + +
`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.
+ + +

+ + +
#ggsave(paste("complexity_dataType_interaction.pdf", sep=""))
+
+ + + + + + +

+MinMeanSEMMax <- function(x) {
+  v <- c(min(x), mean(x) - sd(x)/sqrt(length(x)), mean(x), mean(x) + sd(x)/sqrt(length(x)), max(x))
+  names(v) <- c("ymin", "lower", "middle", "upper", "ymax")
+  v
+}
+
+results %>%
+  # group_by(complexity, isCovidData) %>%
+  ggplot(aes( x = vis.trust_6, y = 0, cex=1.5, colour = chartType)) +
+  scale_color_manual(values = c("purple", "orange")) +
+  ylim(-0.5, 0.5) +
+  geom_jitter(data = results, width = 0.3, height = 0.2, color = "light gray", alpha = 0.5) +
+  #stat_summary(fun.data=MinMeanSEMMax, geom="boxplot", colour="red") +
+
+  geom_boxplot(lwd = 1, fatten = NULL, width = 0.25, alpha = 0.5) +
+
+  geom_segment(data = results %>% 
+                group_by(complexity, chartType) %>%
+                summarize(n = n(), 
+                           mean = mean(vis.trust_6),
+            se = sd(vis.trust_6)/sqrt(n)), 
+              aes(x = mean, xend = mean, y = -.25, yend = .25,  colour = chartType), size = 1) +
+        # stat_summary(fun.data = "mean_cl_boot", colour = "red", size = 0.5, position = position_nudge(x=0.25, y=0), alpha=0.5) +
+
+  geom_text( data = results %>% 
+                group_by(complexity, chartType) %>%
+                summarize(n = n(), 
+                           mean = round(mean(vis.trust_6),digits=2),
+            se = round(sd(data.trust_6)/sqrt(n),digits=2),
+                          vis.trust_6 = mean(vis.trust_6)),
+            # aes(label = paste(mean, "[",mean-se,",",mean+se,"]"), x = 6.2, y = 0.43, fontface = 3), size=3, colour = "black")+
+              aes(label = paste(mean), x = mean, y = .35, fontface = 3), size=4, colour = "black")+
+
+  facet_grid(complexity ~ chartType) +
+  xlab("Trust in Visualization") +
+  theme_minimal() + 
+  theme(panel.spacing = unit(2, "lines"),
+        legend.position = "none",
+        axis.text.y = element_blank(),
+        axis.title.y = element_blank(),
+        axis.ticks.y = element_blank())
+ + +
`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.
+ + +
ggsave(paste("complexity_chartType_interaction.pdf", sep=""))
+ + +
Saving 7.29 x 4.51 in image
+ + +

+ + + + + + +
results %>%
+  group_by(complexity, isCovidData) %>%
+  summarize(n = n(),
+            mean = mean(vis.trust_6),
+            se = sd(vis.trust_6)/sqrt(n),
+            n = n)
+ + + + + + +
# results$isCovidData <- factor(results$isCovidData, levels = c(0, 1),
+#                   labels = c("Crop Data", "Covid Data"))
+
+results %>%
+  ggplot(aes(x = data.trust_6, y = 0)) +
+  # scale_color_manual(values = c("purple", "orange")) +
+  ylim(-0.5, 0.5) +
+  geom_jitter(data = results, width = 0.25, height = 0.2, color = "light gray", alpha = 0.5) +
+  geom_boxplot(lwd = 1, fatten = NULL, width = 0.25, alpha = 0.5, color = "salmon") +
+  # labs(title = "Trust in data") + 
+
+  
+   geom_segment(data = results %>% 
+                group_by(complexity) %>%
+                summarize(n = n(), 
+                           mean = mean(data.trust_6),
+            se = sd(data.trust_6)/sqrt(n)), 
+              aes(x = mean, xend = mean, y = -.25, yend = .25,  colour ="salmon"), size = 1) +
+
+  
+  geom_text( data = results %>% 
+                group_by(complexity) %>%
+                summarize(n = n(), 
+                           mean = round(mean(data.trust_6),digits=2),
+            se = round(sd(data.trust_6)/sqrt(n),digits=2),
+                          dadta.trust_6 = mean(data.trust_6)),
+            # aes(label = paste(mean, "[",mean-se,",",mean+se,"]"), x = 6.2, y = 0.43, fontface = 3), size=3, colour = "black")+
+              aes(label = paste(mean), x = mean, y = .35, fontface = 3), size=4, colour = "black")+
+  
+
+  
+  facet_grid(rows = vars(complexity)) +
+  xlab("Trust in Data") +
+  theme_minimal() + 
+  theme(panel.spacing = unit(2, "lines"),
+        legend.position = "none",
+        axis.text.y = element_blank(),
+        axis.title.y = element_blank(),
+        axis.ticks.y = element_blank())
+
+#ggsave(paste("complexity_interaction.pdf", sep=""))
+
+ + + + + + +
results %>%
+ filter(isCovidData ==0 ) %>%
+  group_by(complexity) %>%
+  summarize(n = n(),
+            mean = mean(vis.trust_6),
+            se = sd(vis.trust_6)/sqrt(n),
+            n = n)
+ + + + + + +
model <- lm(formula = vis.trust_6 ~ complexity  * as.factor(isCovidData) * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + +
Analysis of Variance Table
+
+Response: vis.trust_6
+                                             Df Sum Sq Mean Sq  F value    Pr(>F)    
+complexity                                    2   4.45   2.226   1.7237  0.179624    
+as.factor(isCovidData)                        1   2.74   2.736   2.1181  0.146282    
+chartType                                     1   0.02   0.020   0.0153  0.901530    
+Age                                           1   9.31   9.308   7.2072  0.007537 ** 
+Gender                                        3   7.63   2.544   1.9699  0.117759    
+State_1                                      46 127.87   2.780   2.1523 4.266e-05 ***
+Education                                     9  33.27   3.697   2.8621  0.002729 ** 
+Parents_education                             2   1.57   0.787   0.6095  0.544099    
+Language                                      3   3.04   1.013   0.7841  0.503252    
+Ethnicity                                     8  16.99   2.124   1.6446  0.110101    
+Income                                       18  29.11   1.617   1.2521  0.215752    
+Religion                                      4  14.44   3.610   2.7951  0.025844 *  
+trust.in.science_7                            1 138.52 138.515 107.2476 < 2.2e-16 ***
+need_for_cognition                            1   6.54   6.541   5.0644  0.024919 *  
+interpersonal.trust_1                         1   6.90   6.900   5.3428  0.021273 *  
+complexity:as.factor(isCovidData)             2   3.13   1.564   1.2108  0.298943    
+complexity:chartType                          2   3.36   1.680   1.3006  0.273429    
+as.factor(isCovidData):chartType              1   0.64   0.639   0.4945  0.482305    
+complexity:as.factor(isCovidData):chartType   2   0.35   0.175   0.1353  0.873503    
+Residuals                                   437 564.41   1.292                       
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + + + +
model <- lm(formula = vis.trust_6 ~ complexity  * as.factor(isCovidData) + chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results%>% filter(complexity !='moderatex'))
+anova(model)
+
+ + + + + + +
model <- lm(formula = vis.trust_6 ~ complexity * as.factor(isCovidData) + chartType + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+
+ + + +

Linear Regression Model for trust in vis as a function of

+ + + +
model <- lm(formula = vis.trust_6 ~ complexity * as.factor(isCovidData) * chartType  + Age + Gender + State_1 + Income + Education + Parents_education + Language + Ethnicity  + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + +
Analysis of Variance Table
+
+Response: vis.trust_6
+                                             Df Sum Sq Mean Sq  F value    Pr(>F)    
+complexity                                    2   4.45   2.226   1.7237  0.179624    
+as.factor(isCovidData)                        1   2.74   2.736   2.1181  0.146282    
+chartType                                     1   0.02   0.020   0.0153  0.901530    
+Age                                           1   9.31   9.308   7.2072  0.007537 ** 
+Gender                                        3   7.63   2.544   1.9699  0.117759    
+State_1                                      46 127.87   2.780   2.1523 4.266e-05 ***
+Income                                       18  36.70   2.039   1.5788  0.061567 .  
+Education                                     9  27.94   3.105   2.4040  0.011443 *  
+Parents_education                             2   0.91   0.455   0.3526  0.703060    
+Language                                      3   2.25   0.749   0.5797  0.628627    
+Ethnicity                                     8  16.18   2.022   1.5659  0.132820    
+Religion                                      4  14.44   3.610   2.7951  0.025844 *  
+trust.in.science_7                            1 138.52 138.515 107.2476 < 2.2e-16 ***
+need_for_cognition                            1   6.54   6.541   5.0644  0.024919 *  
+interpersonal.trust_1                         1   6.90   6.900   5.3428  0.021273 *  
+complexity:as.factor(isCovidData)             2   3.13   1.564   1.2108  0.298943    
+complexity:chartType                          2   3.36   1.680   1.3006  0.273429    
+as.factor(isCovidData):chartType              1   0.64   0.639   0.4945  0.482305    
+complexity:as.factor(isCovidData):chartType   2   0.35   0.175   0.1353  0.873503    
+Residuals                                   437 564.41   1.292                       
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + + + +

+model<- manova( cbind(vis.trust_6,vis.trust_1,vis.trust_2,vis.trust_3,vis.trust_4,vis.trust_5,affect.science_1,affect.clarity_1,affect.aesthetic_1) ~ complexity  * as.factor(isCovidData) * chartType  + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+               data = results)
+
+summary(model)
+ + +
                                             Df  Pillai approx F num Df den Df    Pr(>F)    
+complexity                                    2 0.15735   4.0798     18    860 2.919e-08 ***
+as.factor(isCovidData)                        1 0.14918   8.3574      9    429 1.621e-11 ***
+chartType                                     1 0.03225   1.5884      9    429  0.116163    
+Age                                           1 0.03849   1.9079      9    429  0.049143 *  
+Gender                                        3 0.05602   0.9113     27   1293  0.596349    
+State_1                                      46 0.97283   1.1513    414   3933  0.023586 *  
+Education                                     9 0.23390   1.2956     81   3933  0.039962 *  
+Parents_education                             2 0.03526   0.8574     18    860  0.631723    
+Language                                      3 0.04049   0.6553     27   1293  0.911225    
+Ethnicity                                     8 0.15874   0.9807     72   3488  0.524493    
+Income                                       18 0.37955   1.0689    162   3933  0.264814    
+Religion                                      4 0.10146   1.2492     36   1728  0.148400    
+trust.in.science_7                            1 0.21604  13.1355      9    429 < 2.2e-16 ***
+need_for_cognition                            1 0.05685   2.8732      9    429  0.002644 ** 
+interpersonal.trust_1                         1 0.04369   2.1778      9    429  0.022599 *  
+complexity:as.factor(isCovidData)             2 0.03055   0.7410     18    860  0.769808    
+complexity:chartType                          2 0.07113   1.7620     18    860  0.025638 *  
+as.factor(isCovidData):chartType              1 0.01981   0.9633      9    429  0.469901    
+complexity:as.factor(isCovidData):chartType   2 0.02939   0.7127     18    860  0.800338    
+Residuals                                   437                                             
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + +
eta_squared(model)
+ + +
# Effect Size for ANOVA (Type I)
+
+Parameter                                   | Eta2 (partial) |       95% CI
+---------------------------------------------------------------------------
+complexity                                  |           0.08 | [0.04, 1.00]
+as.factor(isCovidData)                      |           0.15 | [0.09, 1.00]
+chartType                                   |           0.03 | [0.00, 1.00]
+Age                                         |           0.04 | [0.00, 1.00]
+Gender                                      |           0.02 | [0.00, 1.00]
+State_1                                     |           0.11 | [0.12, 1.00]
+Education                                   |           0.03 | [0.00, 1.00]
+Parents_education                           |           0.02 | [0.00, 1.00]
+Language                                    |           0.01 | [0.00, 1.00]
+Ethnicity                                   |           0.02 | [0.00, 1.00]
+Income                                      |           0.04 | [0.00, 1.00]
+Religion                                    |           0.03 | [0.00, 1.00]
+trust.in.science_7                          |           0.22 | [0.15, 1.00]
+need_for_cognition                          |           0.06 | [0.01, 1.00]
+interpersonal.trust_1                       |           0.04 | [0.00, 1.00]
+complexity:as.factor(isCovidData)           |           0.02 | [0.00, 1.00]
+complexity:chartType                        |           0.04 | [0.00, 1.00]
+as.factor(isCovidData):chartType            |           0.02 | [0.00, 1.00]
+complexity:as.factor(isCovidData):chartType |           0.01 | [0.00, 1.00]
+
+- One-sided CIs: upper bound fixed at [1.00].
+ + +
summary.aov(model)
+ + +
 Response vis.trust_6 :
+                                             Df Sum Sq Mean Sq  F value    Pr(>F)    
+complexity                                    2   4.45   2.226   1.7237  0.179624    
+as.factor(isCovidData)                        1   2.74   2.736   2.1181  0.146282    
+chartType                                     1   0.02   0.020   0.0153  0.901530    
+Age                                           1   9.31   9.308   7.2072  0.007537 ** 
+Gender                                        3   7.63   2.544   1.9699  0.117759    
+State_1                                      46 127.87   2.780   2.1523 4.266e-05 ***
+Education                                     9  33.27   3.697   2.8621  0.002729 ** 
+Parents_education                             2   1.57   0.787   0.6095  0.544099    
+Language                                      3   3.04   1.013   0.7841  0.503252    
+Ethnicity                                     8  16.99   2.124   1.6446  0.110101    
+Income                                       18  29.11   1.617   1.2521  0.215752    
+Religion                                      4  14.44   3.610   2.7951  0.025844 *  
+trust.in.science_7                            1 138.52 138.515 107.2476 < 2.2e-16 ***
+need_for_cognition                            1   6.54   6.541   5.0644  0.024919 *  
+interpersonal.trust_1                         1   6.90   6.900   5.3428  0.021273 *  
+complexity:as.factor(isCovidData)             2   3.13   1.564   1.2108  0.298943    
+complexity:chartType                          2   3.36   1.680   1.3006  0.273429    
+as.factor(isCovidData):chartType              1   0.64   0.639   0.4945  0.482305    
+complexity:as.factor(isCovidData):chartType   2   0.35   0.175   0.1353  0.873503    
+Residuals                                   437 564.41   1.292                       
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response vis.trust_1 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2   3.28   1.639  0.9045  0.405508    
+as.factor(isCovidData)                        1   6.62   6.616  3.6503  0.056715 .  
+chartType                                     1   0.43   0.425  0.2346  0.628354    
+Age                                           1   7.62   7.623  4.2062  0.040873 *  
+Gender                                        3   3.43   1.142  0.6302  0.595862    
+State_1                                      46 124.61   2.709  1.4946  0.023238 *  
+Education                                     9   4.70   0.522  0.2879  0.977939    
+Parents_education                             2   3.90   1.949  1.0755  0.342034    
+Language                                      3   4.53   1.509  0.8327  0.476399    
+Ethnicity                                     8  15.84   1.980  1.0922  0.367304    
+Income                                       18  26.77   1.487  0.8206  0.676327    
+Religion                                      4   5.83   1.458  0.8047  0.522603    
+trust.in.science_7                            1  54.39  54.386 30.0075 7.279e-08 ***
+need_for_cognition                            1  15.99  15.991  8.8228  0.003139 ** 
+interpersonal.trust_1                         1   6.91   6.906  3.8107  0.051566 .  
+complexity:as.factor(isCovidData)             2   1.32   0.658  0.3632  0.695639    
+complexity:chartType                          2   4.70   2.348  1.2955  0.274821    
+as.factor(isCovidData):chartType              1   0.11   0.106  0.0587  0.808737    
+complexity:as.factor(isCovidData):chartType   2   0.39   0.195  0.1075  0.898074    
+Residuals                                   437 792.03   1.812                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response vis.trust_2 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2  54.96  27.478 17.4340 5.193e-08 ***
+as.factor(isCovidData)                        1   2.11   2.114  1.3412 0.2474470    
+chartType                                     1   8.65   8.647  5.4865 0.0196120 *  
+Age                                           1   0.31   0.309  0.1960 0.6581567    
+Gender                                        3  10.41   3.469  2.2010 0.0872807 .  
+State_1                                      46  87.56   1.903  1.2077 0.1734564    
+Education                                     9  10.71   1.190  0.7548 0.6584856    
+Parents_education                             2   0.73   0.367  0.2330 0.7922448    
+Language                                      3   1.22   0.405  0.2571 0.8562876    
+Ethnicity                                     8  25.97   3.246  2.0597 0.0384731 *  
+Income                                       18  27.58   1.532  0.9720 0.4912949    
+Religion                                      4   9.84   2.459  1.5603 0.1839096    
+trust.in.science_7                            1  20.69  20.688 13.1259 0.0003255 ***
+need_for_cognition                            1  32.78  32.777 20.7958 6.644e-06 ***
+interpersonal.trust_1                         1   4.47   4.473  2.8381 0.0927655 .  
+complexity:as.factor(isCovidData)             2   5.09   2.544  1.6139 0.2002891    
+complexity:chartType                          2   0.40   0.202  0.1283 0.8796074    
+as.factor(isCovidData):chartType              1   0.19   0.186  0.1178 0.7315929    
+complexity:as.factor(isCovidData):chartType   2   0.74   0.372  0.2358 0.7900198    
+Residuals                                   437 688.77   1.576                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response vis.trust_3 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2  10.44   5.219  2.7523   0.06489 .  
+as.factor(isCovidData)                        1   0.28   0.278  0.1467   0.70189    
+chartType                                     1   8.54   8.544  4.5060   0.03434 *  
+Age                                           1   3.53   3.526  1.8598   0.17335    
+Gender                                        3  10.05   3.351  1.7676   0.15262    
+State_1                                      46 115.10   2.502  1.3196   0.08530 .  
+Education                                     9  29.25   3.250  1.7138   0.08355 .  
+Parents_education                             2   4.41   2.207  1.1641   0.31318    
+Language                                      3   1.70   0.565  0.2981   0.82675    
+Ethnicity                                     8  19.02   2.377  1.2536   0.26619    
+Income                                       18  35.88   1.993  1.0513   0.40035    
+Religion                                      4   8.49   2.123  1.1195   0.34667    
+trust.in.science_7                            1  36.58  36.583 19.2940 1.408e-05 ***
+need_for_cognition                            1  30.24  30.235 15.9461 7.645e-05 ***
+interpersonal.trust_1                         1   8.63   8.626  4.5495   0.03349 *  
+complexity:as.factor(isCovidData)             2   3.41   1.707  0.9002   0.40724    
+complexity:chartType                          2   2.45   1.223  0.6448   0.52529    
+as.factor(isCovidData):chartType              1   0.04   0.037  0.0196   0.88881    
+complexity:as.factor(isCovidData):chartType   2   2.34   1.170  0.6169   0.54010    
+Residuals                                   437 828.60   1.896                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response vis.trust_4 :
+                                             Df  Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2   19.58   9.789  3.1170 0.0452781 *  
+as.factor(isCovidData)                        1   71.17  71.173 22.6624  2.63e-06 ***
+chartType                                     1    1.12   1.116  0.3553 0.5514583    
+Age                                           1    2.94   2.942  0.9366 0.3336768    
+Gender                                        3    4.23   1.410  0.4489 0.7182037    
+State_1                                      46  155.61   3.383  1.0771 0.3442044    
+Education                                     9   33.36   3.706  1.1801 0.3057658    
+Parents_education                             2    6.18   3.089  0.9836 0.3747885    
+Language                                      3    0.21   0.069  0.0221 0.9955472    
+Ethnicity                                     8   38.07   4.759  1.5154 0.1494293    
+Income                                       18   48.03   2.668  0.8497 0.6408697    
+Religion                                      4   32.60   8.151  2.5954 0.0359118 *  
+trust.in.science_7                            1   41.77  41.769 13.2997 0.0002974 ***
+need_for_cognition                            1   20.90  20.903  6.6557 0.0102096 *  
+interpersonal.trust_1                         1    2.26   2.263  0.7204 0.3964732    
+complexity:as.factor(isCovidData)             2    3.99   1.995  0.6351 0.5303587    
+complexity:chartType                          2    6.77   3.384  1.0776 0.3413175    
+as.factor(isCovidData):chartType              1    8.37   8.372  2.6657 0.1032552    
+complexity:as.factor(isCovidData):chartType   2    5.15   2.575  0.8199 0.4411534    
+Residuals                                   437 1372.43   3.141                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response vis.trust_5 :
+                                             Df  Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2   30.85  15.426  4.7810  0.008831 ** 
+as.factor(isCovidData)                        1  126.78 126.778 39.2920 8.764e-10 ***
+chartType                                     1    3.35   3.355  1.0398  0.308433    
+Age                                           1    1.64   1.640  0.5083  0.476253    
+Gender                                        3    7.04   2.348  0.7276  0.535912    
+State_1                                      46  156.29   3.398  1.0530  0.383542    
+Education                                     9   30.49   3.388  1.0500  0.399095    
+Parents_education                             2   16.09   8.045  2.4933  0.083816 .  
+Language                                      3    8.58   2.860  0.8865  0.448019    
+Ethnicity                                     8   21.68   2.710  0.8399  0.567804    
+Income                                       18   35.62   1.979  0.6133  0.890062    
+Religion                                      4    7.99   1.997  0.6190  0.649177    
+trust.in.science_7                            1   29.72  29.719  9.2107  0.002550 ** 
+need_for_cognition                            1   11.07  11.068  3.4304  0.064683 .  
+interpersonal.trust_1                         1    4.82   4.818  1.4932  0.222381    
+complexity:as.factor(isCovidData)             2    2.99   1.494  0.4630  0.629724    
+complexity:chartType                          2    5.86   2.931  0.9083  0.403955    
+as.factor(isCovidData):chartType              1    0.23   0.227  0.0704  0.790890    
+complexity:as.factor(isCovidData):chartType   2   12.02   6.010  1.8626  0.156499    
+Residuals                                   437 1410.00   3.227                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response affect.science_1 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2    600   300.1  0.9126  0.402250    
+as.factor(isCovidData)                        1    441   441.5  1.3426  0.247210    
+chartType                                     1    486   486.3  1.4790  0.224584    
+Age                                           1      8     8.2  0.0249  0.874616    
+Gender                                        3    280    93.4  0.2841  0.836919    
+State_1                                      46  14891   323.7  0.9845  0.504662    
+Education                                     9   3868   429.7  1.3069  0.230805    
+Parents_education                             2     87    43.5  0.1322  0.876181    
+Language                                      3    408   136.0  0.4137  0.743230    
+Ethnicity                                     8   2402   300.2  0.9130  0.505341    
+Income                                       18  13622   756.8  2.3016  0.001901 ** 
+Religion                                      4   3059   764.7  2.3256  0.055699 .  
+trust.in.science_7                            1   7677  7676.8 23.3469 1.875e-06 ***
+need_for_cognition                            1    137   136.7  0.4157  0.519448    
+interpersonal.trust_1                         1     52    51.7  0.1571  0.692014    
+complexity:as.factor(isCovidData)             2    271   135.3  0.4113  0.663016    
+complexity:chartType                          2    313   156.6  0.4762  0.621483    
+as.factor(isCovidData):chartType              1    409   408.9  1.2436  0.265382    
+complexity:as.factor(isCovidData):chartType   2    870   434.9  1.3225  0.267525    
+Residuals                                   437 143691   328.8                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response affect.clarity_1 :
+                                             Df Sum Sq Mean Sq F value   Pr(>F)    
+complexity                                    2  11686  5842.8  8.5265 0.000233 ***
+as.factor(isCovidData)                        1   1143  1142.7  1.6676 0.197264    
+chartType                                     1   2808  2808.0  4.0977 0.043549 *  
+Age                                           1    560   560.2  0.8175 0.366424    
+Gender                                        3    545   181.5  0.2649 0.850670    
+State_1                                      46  34327   746.2  1.0890 0.325669    
+Education                                     9   7375   819.4  1.1958 0.295633    
+Parents_education                             2   1404   702.2  1.0247 0.359759    
+Language                                      3   1190   396.8  0.5791 0.629017    
+Ethnicity                                     8   3973   496.6  0.7248 0.669695    
+Income                                       18  11055   614.2  0.8963 0.583430    
+Religion                                      4    531   132.7  0.1936 0.941689    
+trust.in.science_7                            1   1535  1535.2  2.2404 0.135170    
+need_for_cognition                            1   5023  5023.0  7.3301 0.007047 ** 
+interpersonal.trust_1                         1      8     7.6  0.0111 0.916232    
+complexity:as.factor(isCovidData)             2    272   136.1  0.1987 0.819888    
+complexity:chartType                          2   2974  1487.0  2.1700 0.115405    
+as.factor(isCovidData):chartType              1    463   463.0  0.6756 0.411541    
+complexity:as.factor(isCovidData):chartType   2   2726  1363.1  1.9892 0.138035    
+Residuals                                   437 299454   685.2                     
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response affect.aesthetic_1 :
+                                             Df Sum Sq Mean Sq F value  Pr(>F)  
+complexity                                    2    283   141.6  0.2689 0.76437  
+as.factor(isCovidData)                        1    144   143.7  0.2727 0.60178  
+chartType                                     1    222   221.8  0.4211 0.51672  
+Age                                           1   2106  2105.7  3.9970 0.04620 *
+Gender                                        3   3179  1059.8  2.0117 0.11158  
+State_1                                      46  18038   392.1  0.7443 0.89121  
+Education                                     9   3237   359.7  0.6827 0.72480  
+Parents_education                             2   1766   882.9  1.6760 0.18833  
+Language                                      3    263    87.7  0.1665 0.91896  
+Ethnicity                                     8   3551   443.9  0.8426 0.56546  
+Income                                       18   4902   272.3  0.5170 0.95040  
+Religion                                      4   1972   493.0  0.9358 0.44295  
+trust.in.science_7                            1   3167  3167.1  6.0117 0.01460 *
+need_for_cognition                            1   2194  2194.0  4.1647 0.04188 *
+interpersonal.trust_1                         1   2577  2577.2  4.8921 0.02750 *
+complexity:as.factor(isCovidData)             2    645   322.6  0.6123 0.54256  
+complexity:chartType                          2   2044  1022.2  1.9404 0.14488  
+as.factor(isCovidData):chartType              1   1504  1504.5  2.8558 0.09176 .
+complexity:as.factor(isCovidData):chartType   2     50    25.1  0.0476 0.95355  
+Residuals                                   437 230219   526.8                  
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+3 observations deleted due to missingness
+ + + + + + +

+model<- manova( cbind(data.trust_6,data.trust_1,data.trust_2,data.trust_3,data.trust_4,data.trust_5) ~ complexity  * as.factor(isCovidData) * chartType  + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+               data = results)
+
+anova(model)
+ + +
Analysis of Variance Table
+
+                                             Df  Pillai approx F num Df den Df    Pr(>F)    
+(Intercept)                                   1 0.97922   3392.6      6    432 < 2.2e-16 ***
+complexity                                    2 0.06719      2.5     12    866  0.003029 ** 
+as.factor(isCovidData)                        1 0.12758     10.5      6    432 6.446e-11 ***
+chartType                                     1 0.01608      1.2      6    432  0.317789    
+Age                                           1 0.03575      2.7      6    432  0.014868 *  
+Gender                                        3 0.06592      1.6     18   1302  0.047127 *  
+State_1                                      46 0.69976      1.3    276   2622  0.004228 ** 
+Education                                     9 0.15077      1.3     54   2622  0.104194    
+Parents_education                             2 0.02989      1.1     12    866  0.360602    
+Language                                      3 0.05927      1.5     18   1302  0.096618 .  
+Ethnicity                                     8 0.09311      0.9     48   2622  0.739601    
+Income                                       18 0.21734      0.9    108   2622  0.728266    
+Religion                                      4 0.06342      1.2     24   1740  0.260746    
+trust.in.science_7                            1 0.21058     19.2      6    432 < 2.2e-16 ***
+need_for_cognition                            1 0.04322      3.3      6    432  0.003876 ** 
+interpersonal.trust_1                         1 0.03096      2.3      6    432  0.033816 *  
+complexity:as.factor(isCovidData)             2 0.02812      1.0     12    866  0.419272    
+complexity:chartType                          2 0.03333      1.2     12    866  0.261815    
+as.factor(isCovidData):chartType              1 0.02040      1.5      6    432  0.176782    
+complexity:as.factor(isCovidData):chartType   2 0.01151      0.4     12    866  0.957108    
+Residuals                                   437                                             
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + +
eta_squared(model)
+ + +
# Effect Size for ANOVA (Type I)
+
+Parameter                                   | Eta2 (partial) |       95% CI
+---------------------------------------------------------------------------
+complexity                                  |           0.03 | [0.01, 1.00]
+as.factor(isCovidData)                      |           0.13 | [0.07, 1.00]
+chartType                                   |           0.02 | [0.00, 1.00]
+Age                                         |           0.04 | [0.00, 1.00]
+Gender                                      |           0.02 | [0.00, 1.00]
+State_1                                     |           0.12 | [0.13, 1.00]
+Education                                   |           0.03 | [0.00, 1.00]
+Parents_education                           |           0.01 | [0.00, 1.00]
+Language                                    |           0.02 | [0.00, 1.00]
+Ethnicity                                   |           0.02 | [0.00, 1.00]
+Income                                      |           0.04 | [0.00, 1.00]
+Religion                                    |           0.02 | [0.00, 1.00]
+trust.in.science_7                          |           0.21 | [0.15, 1.00]
+need_for_cognition                          |           0.04 | [0.01, 1.00]
+interpersonal.trust_1                       |           0.03 | [0.00, 1.00]
+complexity:as.factor(isCovidData)           |           0.01 | [0.00, 1.00]
+complexity:chartType                        |           0.02 | [0.00, 1.00]
+as.factor(isCovidData):chartType            |           0.02 | [0.00, 1.00]
+complexity:as.factor(isCovidData):chartType |       5.75e-03 | [0.00, 1.00]
+
+- One-sided CIs: upper bound fixed at [1.00].
+ + +
summary.aov(model)
+ + +
 Response data.trust_6 :
+                                             Df Sum Sq Mean Sq  F value    Pr(>F)    
+complexity                                    2   5.73   2.864   2.0456 0.1305443    
+as.factor(isCovidData)                        1   1.59   1.589   1.1346 0.2873781    
+chartType                                     1   0.01   0.005   0.0039 0.9504631    
+Age                                           1  12.15  12.148   8.6757 0.0033971 ** 
+Gender                                        3  12.04   4.012   2.8656 0.0363516 *  
+State_1                                      46 154.41   3.357   2.3973 2.857e-06 ***
+Education                                     9  37.77   4.197   2.9975 0.0017662 ** 
+Parents_education                             2   3.49   1.743   1.2450 0.2889520    
+Language                                      3   2.88   0.960   0.6855 0.5612446    
+Ethnicity                                     8  14.32   1.790   1.2783 0.2527983    
+Income                                       18  37.39   2.077   1.4836 0.0911636 .  
+Religion                                      4  27.36   6.841   4.8855 0.0007307 ***
+trust.in.science_7                            1 152.44 152.445 108.8744 < 2.2e-16 ***
+need_for_cognition                            1   4.99   4.994   3.5665 0.0596190 .  
+interpersonal.trust_1                         1  13.33  13.333   9.5226 0.0021586 ** 
+complexity:as.factor(isCovidData)             2   0.43   0.215   0.1536 0.8576451    
+complexity:chartType                          2   3.03   1.514   1.0816 0.3399609    
+as.factor(isCovidData):chartType              1   9.40   9.401   6.7144 0.0098839 ** 
+complexity:as.factor(isCovidData):chartType   2   2.71   1.356   0.9683 0.3805454    
+Residuals                                   437 611.88   1.400                       
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response data.trust_1 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2   1.39   0.696  0.5744  0.563471    
+as.factor(isCovidData)                        1   0.41   0.408  0.3369  0.561918    
+chartType                                     1   1.31   1.307  1.0789  0.299510    
+Age                                           1   7.46   7.461  6.1609  0.013435 *  
+Gender                                        3   8.36   2.786  2.3007  0.076631 .  
+State_1                                      46  95.69   2.080  1.7179  0.003367 ** 
+Education                                     9  18.83   2.092  1.7279  0.080452 .  
+Parents_education                             2   3.89   1.945  1.6061  0.201859    
+Language                                      3   0.96   0.322  0.2656  0.850176    
+Ethnicity                                     8   7.95   0.994  0.8209  0.584405    
+Income                                       18  34.06   1.892  1.5624  0.065976 .  
+Religion                                      4  19.70   4.925  4.0669  0.003008 ** 
+trust.in.science_7                            1 103.53 103.532 85.4937 < 2.2e-16 ***
+need_for_cognition                            1   0.33   0.326  0.2689  0.604363    
+interpersonal.trust_1                         1   9.93   9.927  8.1974  0.004397 ** 
+complexity:as.factor(isCovidData)             2   2.28   1.138  0.9399  0.391443    
+complexity:chartType                          2   4.55   2.276  1.8793  0.153935    
+as.factor(isCovidData):chartType              1   1.80   1.797  1.4843  0.223763    
+complexity:as.factor(isCovidData):chartType   2   2.21   1.104  0.9120  0.402474    
+Residuals                                   437 529.20   1.211                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response data.trust_2 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2  16.74   8.371  4.2992  0.014159 *  
+as.factor(isCovidData)                        1   6.62   6.617  3.3984  0.065935 .  
+chartType                                     1   1.48   1.482  0.7611  0.383473    
+Age                                           1  16.87  16.869  8.6633  0.003420 ** 
+Gender                                        3   8.02   2.673  1.3729  0.250454    
+State_1                                      46 154.03   3.348  1.7196  0.003313 ** 
+Education                                     9  16.88   1.876  0.9634  0.469804    
+Parents_education                             2   9.40   4.698  2.4128  0.090758 .  
+Language                                      3   4.08   1.358  0.6976  0.553888    
+Ethnicity                                     8  10.19   1.274  0.6544  0.731677    
+Income                                       18  46.17   2.565  1.3172  0.171826    
+Religion                                      4  13.27   3.318  1.7041  0.148030    
+trust.in.science_7                            1  74.25  74.248 38.1304 1.514e-09 ***
+need_for_cognition                            1   0.02   0.023  0.0118  0.913518    
+interpersonal.trust_1                         1   0.47   0.475  0.2437  0.621791    
+complexity:as.factor(isCovidData)             2  10.89   5.446  2.7970  0.062082 .  
+complexity:chartType                          2   4.19   2.097  1.0767  0.341618    
+as.factor(isCovidData):chartType              1   1.85   1.848  0.9493  0.330438    
+complexity:as.factor(isCovidData):chartType   2   0.87   0.434  0.2231  0.800152    
+Residuals                                   437 850.93   1.947                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response data.trust_3 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2   7.23   3.616  2.0203  0.133847    
+as.factor(isCovidData)                        1   3.37   3.375  1.8857  0.170394    
+chartType                                     1   1.42   1.417  0.7916  0.374093    
+Age                                           1   2.48   2.481  1.3863  0.239668    
+Gender                                        3  22.48   7.493  4.1866  0.006140 ** 
+State_1                                      46 132.72   2.885  1.6122  0.008686 ** 
+Education                                     9  28.11   3.124  1.7454  0.076748 .  
+Parents_education                             2   0.75   0.375  0.2097  0.810887    
+Language                                      3   9.42   3.138  1.7537  0.155335    
+Ethnicity                                     8   7.68   0.960  0.5366  0.828963    
+Income                                       18  22.42   1.245  0.6959  0.816170    
+Religion                                      4  17.68   4.421  2.4702  0.044065 *  
+trust.in.science_7                            1 112.21 112.213 62.7007 2.007e-14 ***
+need_for_cognition                            1   0.04   0.038  0.0214  0.883870    
+interpersonal.trust_1                         1   6.25   6.247  3.4904  0.062396 .  
+complexity:as.factor(isCovidData)             2   2.98   1.490  0.8327  0.435555    
+complexity:chartType                          2   3.35   1.674  0.9354  0.393205    
+as.factor(isCovidData):chartType              1   7.22   7.217  4.0327  0.045241 *  
+complexity:as.factor(isCovidData):chartType   2   0.08   0.040  0.0226  0.977657    
+Residuals                                   437 782.08   1.790                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response data.trust_4 :
+                                             Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                                    2  15.85   7.927  5.7999  0.003266 ** 
+as.factor(isCovidData)                        1  37.97  37.971 27.7817 2.138e-07 ***
+chartType                                     1   3.12   3.122  2.2844  0.131404    
+Age                                           1   5.53   5.529  4.0452  0.044910 *  
+Gender                                        3  12.80   4.267  3.1219  0.025823 *  
+State_1                                      46 102.15   2.221  1.6248  0.007781 ** 
+Education                                     9  10.74   1.193  0.8729  0.549473    
+Parents_education                             2   3.02   1.508  1.1030  0.332792    
+Language                                      3   2.31   0.769  0.5630  0.639686    
+Ethnicity                                     8  10.37   1.296  0.9480  0.476545    
+Income                                       18  25.25   1.403  1.0262  0.428231    
+Religion                                      4   1.49   0.372  0.2720  0.896022    
+trust.in.science_7                            1  14.18  14.176 10.3719  0.001375 ** 
+need_for_cognition                            1  16.49  16.485 12.0615  0.000566 ***
+interpersonal.trust_1                         1   2.60   2.605  1.9058  0.168138    
+complexity:as.factor(isCovidData)             2   0.22   0.111  0.0813  0.921956    
+complexity:chartType                          2   2.63   1.316  0.9630  0.382562    
+as.factor(isCovidData):chartType              1   0.39   0.394  0.2882  0.591620    
+complexity:as.factor(isCovidData):chartType   2   2.09   1.046  0.7652  0.465879    
+Residuals                                   437 597.28   1.367                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+ Response data.trust_5 :
+                                             Df Sum Sq Mean Sq F value   Pr(>F)    
+complexity                                    2  12.30  6.1489  3.4900 0.031354 *  
+as.factor(isCovidData)                        1   3.62  3.6229  2.0563 0.152295    
+chartType                                     1   0.28  0.2761  0.1567 0.692390    
+Age                                           1   0.00  0.0030  0.0017 0.966865    
+Gender                                        3  11.85  3.9512  2.2426 0.082671 .  
+State_1                                      46 113.15  2.4599  1.3962 0.049583 *  
+Education                                     9  19.92  2.2133  1.2562 0.258877    
+Parents_education                             2   0.46  0.2289  0.1299 0.878209    
+Language                                      3   3.73  1.2417  0.7048 0.549556    
+Ethnicity                                     8  17.49  2.1860  1.2407 0.273403    
+Income                                       18  48.06  2.6702  1.5155 0.080086 .  
+Religion                                      4   4.06  1.0155  0.5764 0.679915    
+trust.in.science_7                            1  22.33 22.3339 12.6763 0.000411 ***
+need_for_cognition                            1   6.99  6.9884  3.9665 0.047037 *  
+interpersonal.trust_1                         1   6.27  6.2669  3.5570 0.059958 .  
+complexity:as.factor(isCovidData)             2   3.30  1.6514  0.9373 0.392477    
+complexity:chartType                          2   1.07  0.5358  0.3041 0.737947    
+as.factor(isCovidData):chartType              1   0.07  0.0671  0.0381 0.845357    
+complexity:as.factor(isCovidData):chartType   2   1.21  0.6071  0.3446 0.708723    
+Residuals                                   437 769.93  1.7619                     
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+3 observations deleted due to missingness
+ + + + + + +
# post-hoc tests
+aov(vis.trust_6 ~ complexity * as.factor(isCovidData), data = results) %>% tukey_hsd()
+# effect sizes
+eta_squared(aov(vis.trust_6 ~ complexity * as.factor(isCovidData) * chartType + 
+                  + Age + as.factor(Gender) + State_1 + as.factor(Education) + as.factor(Parents_education) + as.factor(Language) + as.factor(Ethnicity) + as.factor(Income) + as.factor(Religion) + trust.in.science_7 + need_for_cognition + 
+                  interpersonal.trust_1,
+             data = results))
+ + + +
+

Colinearity of trust in vis and trust in data

+ + + +
colinearity_model <- lm(formula = Age ~ vis.trust_1 + vis.trust_2 + vis.trust_3 + affect.science_1 + affect.clarity_1 + affect.aesthetic_1 + vis.trust_6 + data.trust_1 + data.trust_2 + data.trust_3 + data.trust_4 + data.trust_5 + data.trust_6 + interpersonal.trust_1 + trust.in.science_7 + need_for_cognition,
+            data = results)
+vif(colinearity_model)
+ + + +

vif(colinearity_model)relation of trust in vis and trust in data

+ + + +
data_frame = data.frame(results$vis.trust_1, results$vis.trust_2, results$vis.trust_3, results$affect.science_1, results$affect.clarity_1, results$affect.aesthetic_1, results$vis.trust_6, results$data.trust_1, results$data.trust_2, results$data.trust_3, results$data.trust_4, results$data.trust_5, results$data.trust_6, results$interpersonal.trust_1, results$trust.in.science_7, results$need_for_cognition)
+cor(data_frame)
+ + + +
+
+

Trust in science, need for cognition, and interpersonal trust on +trust in Vis

+ + + +
results %>%
+  gather(key = variables, value = values, 
+         trust.in.science_7, need_for_cognition, interpersonal.trust_1) %>%
+  ggplot(aes(x = values, y = vis.trust_6, color = variables)) +
+
+  facet_grid(cols = vars(variables)) +
+    geom_jitter() +
+  geom_smooth(color = "black") +
+  geom_blank() + 
+   theme_minimal() +
+  theme(panel.spacing = unit(2, "lines"))
+ + + +

Trust in Data

+ + + +
results %>%
+  ggplot(aes(x = data.trust_6, y = isCovidData, colour = as.factor(isCovidData))) +
+  geom_jitter(data = results, width = 0.5) +
+  # labs(title = "Trust in data") + 
+  geom_vline(data = results %>% 
+                group_by(complexity, isCovidData, chartType) %>%
+                summarize(n = n(), 
+                          data.trust_6 = mean(data.trust_6)), 
+              aes(xintercept = data.trust_6, colour = as.factor(isCovidData))) +
+  facet_grid(rows = vars(complexity), cols = vars(chartType)) +
+  theme_minimal()
+
+results %>% 
+  group_by(complexity, isCovidData) %>%
+  summarize(n = n(), 
+            mean = mean(data.trust_6),
+            se = sd(data.trust_6)/sqrt(n),
+            n = n)
+ + + + + + +
model <- lm(formula = data.trust_6 ~ complexity * chartType
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results%>% filter(isCovidData == 0))
+anova(model)
+
+ + + + + + +
# post-hoc tests
+aov(data.trust_6 ~ complexity * as.factor(isCovidData), data = results) %>% tukey_hsd()
+aov(data.trust_6 ~ chartType * as.factor(isCovidData), data = results) %>% tukey_hsd()
+# effect sizes
+eta_squared(aov(data.trust_6 ~ complexity * as.factor(isCovidData) * chartType + 
+                  Age + as.factor(Gender) + State_1 + as.factor(Education) + as.factor(Parents_education) + as.factor(Language) + 
+                  as.factor(Ethnicity) + as.factor(Income) + as.factor(Religion) + trust.in.science_7 + need_for_cognition + 
+                  interpersonal.trust_1,
+             data = results))
+emmeans(aov(data.trust_6 ~ complexity , data = results) , ~ complexity)
+ + + +

Trust in science, need for cognition, and interpersonal trust on +trust in Data

+ + + +
results %>%
+  gather(key = variables, value = values, 
+         trust.in.science_7, need_for_cognition, interpersonal.trust_1) %>%
+  ggplot(aes(x = values, y = data.trust_6, color = variables)) +
+
+  facet_grid(cols = vars(variables)) +
+    geom_jitter() +
+  geom_smooth(color = "black") +
+  geom_blank() + 
+   theme_minimal() +
+  theme(panel.spacing = unit(2, "lines"))
+ + + + + + +
results_long_data <- results %>%
+  select(data.trust_1, data.trust_2, data.trust_3,
+         data.trust_4, data.trust_5, data.trust_6,
+         ResponseId, complexity,
+         vlat_simple, vlat_moderate, vlat_complex) %>%
+  gather(key = trustItemData, value = trustRatingData, 
+         data.trust_1, data.trust_2, data.trust_3, data.trust_4, data.trust_5, data.trust_6)
+
+results_long_data %>%
+  ggplot(aes(x = trustRatingData, y = 1, color = complexity)) +
+  geom_jitter() +
+  ylim(0, 2) + 
+  labs(title = "Trust in data (All)") + 
+  geom_vline(data = results_long_data %>% 
+               group_by(complexity, trustItemData) %>%
+               summarize(n = n(), 
+                         average = mean(trustRatingData)), 
+             aes(xintercept = average, color = complexity)) +
+  facet_grid(vars(trustItemData)) +
+  theme_minimal()
+ + + +
+
+

Relationship between trust in data and vis, across complexity

+ + + +
results_long_data <- results %>%
+  select(data.trust_1, data.trust_2, data.trust_3,
+         data.trust_4, data.trust_5, data.trust_6,
+         ResponseId, complexity,
+         chartType, isCovidData, 
+         vlat_simple, vlat_moderate, vlat_complex) %>%
+  gather(key = trustItemData, value = trustRatingData, 
+         # data.trust_1, data.trust_2, data.trust_3, data.trust_4, data.trust_5, 
+         data.trust_6)
+
+results_long_vis <- results %>%
+  gather(key = trustItemVis, value = trustRatingVis, 
+         # vis.trust_1, vis.trust_2, vis.trust_3, vis.trust_4, vis.trust_5, 
+         vis.trust_6)
+
+results_long_all <- merge(results_long_vis, results_long_data, 
+                          by = c("ResponseId", "complexity", "chartType", "isCovidData"))
+
+model<- glm(trustRatingVis ~  trustRatingData * complexity + 
+              trustRatingData *  chartType + 
+              trustRatingData *  as.factor(isCovidData),
+                      data = results_long_all)
+Anova(model)
+ + + + + + +
results_long_all %>%
+  # filter(trustItemVis == "bar.vis_2") %>%
+  ggplot(aes(x = trustRatingVis, y = trustRatingData, color = as.factor(isCovidData))) +
+  geom_jitter(alpha = 0.25) +
+  stat_smooth(method = "lm",
+              formula = y ~ x,
+              geom = "smooth", color = "black") +
+  labs(title = "Relationship bewteen trust in Vis and Data") + 
+  facet_grid(rows = vars(chartType), cols = vars(complexity)) +
+  theme_minimal()
+ + + +
+
+

Do the trust items predict trust?

+ + + +
model <- lm(formula = vis.trust_6 ~ vis.trust_1 + 
+              vis.trust_2 + 
+              vis.trust_3 + 
+              vis.trust_4 + 
+              vis.trust_5 + 
+              affect.science_1 +
+              affect.clarity_1 + 
+              affect.aesthetic_1 +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+summary(model)
+ + + + + + +
model <- lm(formula = data.trust_6 ~ data.trust_1 + 
+              data.trust_2 + 
+              data.trust_3 + 
+              data.trust_4 + 
+              data.trust_5 +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+summary(model)
+ + + +
+
+

Which trust measurements predict behavioral outcomes?

+ + + +
model <- lm(formula = vis.trust_4 ~ vis.trust_1 + 
+              vis.trust_2 + 
+              vis.trust_3 +
+              vis.trust_6 +
+              affect.science_1 +
+              affect.clarity_1 + 
+              affect.aesthetic_1 +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+summary(model)
+ + + + + + +
model <- lm(formula = vis.trust_5 ~ vis.trust_1 + 
+              vis.trust_2 + 
+              vis.trust_3 +
+              vis.trust_6 +
+              affect.science_1 +
+              affect.clarity_1 + 
+              affect.aesthetic_1 +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+summary(model)
+ + +

+Call:
+lm(formula = vis.trust_5 ~ vis.trust_1 + vis.trust_2 + vis.trust_3 + 
+    vis.trust_6 + affect.science_1 + affect.clarity_1 + affect.aesthetic_1 + 
+    Age + Gender + State_1 + Education + Parents_education + 
+    Language + Ethnicity + Income + Religion + trust.in.science_7 + 
+    need_for_cognition + interpersonal.trust_1, data = results)
+
+Residuals:
+    Min      1Q  Median      3Q     Max 
+-3.6137 -1.0005  0.1875  1.0599  3.7954 
+
+Coefficients: (1 not defined because of singularities)
+                        Estimate Std. Error t value Pr(>|t|)    
+(Intercept)            6.8983258 11.1541131   0.618   0.5366    
+vis.trust_1            0.1654944  0.0723770   2.287   0.0227 *  
+vis.trust_2           -0.0700186  0.0895431  -0.782   0.4347    
+vis.trust_3            0.5055452  0.0877894   5.759 1.59e-08 ***
+vis.trust_6            0.1940812  0.0877665   2.211   0.0275 *  
+affect.science_1      -0.0040897  0.0047826  -0.855   0.3929    
+affect.clarity_1       0.0049858  0.0036282   1.374   0.1701    
+affect.aesthetic_1    -0.0061383  0.0037793  -1.624   0.1050    
+Age                   -0.0047859  0.0054796  -0.873   0.3829    
+Gender2               -0.0002455  0.1585950  -0.002   0.9988    
+Gender3               -0.8574544  0.7533807  -1.138   0.2557    
+Gender5               -0.0676304  2.5614059  -0.026   0.9789    
+State_1Alaska          0.9130358  3.2211060   0.283   0.7770    
+State_1Arizona         0.0796834  0.7122489   0.112   0.9110    
+State_1Arkansas        0.6925107  0.9857672   0.703   0.4827    
+State_1California      0.2323355  0.4981027   0.466   0.6411    
+State_1Colorado        0.5483217  0.6982153   0.785   0.4327    
+State_1Connecticut    -0.2859602  0.8865255  -0.323   0.7472    
+State_1Delaware        1.3516004  1.2833472   1.053   0.2928    
+State_1Florida         0.0292903  0.5338977   0.055   0.9563    
+State_1Georgia         0.6537663  0.5646337   1.158   0.2475    
+State_1Hawaii          0.4632148  1.1156216   0.415   0.6782    
+State_1Illinois        0.4834355  0.5964777   0.810   0.4181    
+State_1Indiana         0.0100316  0.7392443   0.014   0.9892    
+State_1Iowa            1.5602400  0.9856159   1.583   0.1141    
+State_1Kansas          0.8557160  0.7804126   1.096   0.2735    
+State_1Kentucky        0.1959218  0.7272128   0.269   0.7877    
+State_1Louisiana       0.3960415  0.8282551   0.478   0.6328    
+State_1Maine          -0.1060877  1.0852291  -0.098   0.9222    
+State_1Maryland        0.8736085  0.6371119   1.371   0.1710    
+State_1Massachusetts   0.3204814  0.6525378   0.491   0.6236    
+State_1Michigan        0.0112196  0.6136382   0.018   0.9854    
+State_1Minnesota       0.0044142  0.8862272   0.005   0.9960    
+State_1Mississippi     0.7426988  0.9694226   0.766   0.4440    
+State_1Missouri        0.7406180  0.7239769   1.023   0.3069    
+State_1Montana        -0.0802522  1.3122480  -0.061   0.9513    
+State_1Nebraska        0.9540497  1.0855424   0.879   0.3800    
+State_1Nevada          1.3905433  0.9460415   1.470   0.1423    
+State_1New Hampshire   0.1348267  1.7640649   0.076   0.9391    
+State_1New Jersey      1.4178615  0.7577706   1.871   0.0620 .  
+State_1New York        0.2218299  0.5525909   0.401   0.6883    
+State_1North Carolina  1.0624815  0.5886474   1.805   0.0718 .  
+State_1Ohio           -0.9995362  0.6267236  -1.595   0.1115    
+State_1Oklahoma        0.4119686  0.8445519   0.488   0.6259    
+State_1Oregon          0.7491734  0.7610634   0.984   0.3255    
+State_1Pennsylvania    0.2677601  0.5497123   0.487   0.6264    
+State_1Rhode Island    0.8835446  1.0897997   0.811   0.4180    
+State_1South Carolina  0.1481524  0.8881443   0.167   0.8676    
+State_1South Dakota    0.1598751  1.7995366   0.089   0.9292    
+State_1Tennessee       0.8371711  0.6700815   1.249   0.2122    
+State_1Texas           0.4906562  0.5312451   0.924   0.3562    
+State_1Utah           -0.1454604  0.8292123  -0.175   0.8608    
+State_1Vermont         1.0352761  1.2922610   0.801   0.4235    
+State_1Virginia        0.4694817  0.7552982   0.622   0.5345    
+State_1Washington      0.1183486  0.5971784   0.198   0.8430    
+State_1West Virginia  -1.6715323  1.0709885  -1.561   0.1193    
+State_1Wisconsin       1.0559749  0.6055320   1.744   0.0819 .  
+State_1Wyoming         2.9971987  1.7754711   1.688   0.0921 .  
+Education2             1.4889138  0.7316559   2.035   0.0424 *  
+Education3             1.4182630  0.7104594   1.996   0.0465 *  
+Education4             1.2258351  0.7622315   1.608   0.1085    
+Education5             1.2073315  0.7706229   1.567   0.1179    
+Education6             1.2551205  0.7003148   1.792   0.0738 .  
+Education7             0.9924632  0.7251797   1.369   0.1718    
+Education8             0.8444186  0.8620245   0.980   0.3278    
+Education9             0.4324445  1.1741843   0.368   0.7128    
+Education10            1.9737670  1.8700926   1.055   0.2918    
+Parents_education2    -0.0090787  0.1936329  -0.047   0.9626    
+Parents_education3     0.3070623  0.2177521   1.410   0.1592    
+Language2             -0.5711739  0.9824173  -0.581   0.5613    
+Language3              0.3583621  0.9504647   0.377   0.7063    
+Language4              2.2197398  1.5882656   1.398   0.1629    
+Ethnicity2             0.4442625  1.9182422   0.232   0.8170    
+Ethnicity3            -0.2833989  1.8843595  -0.150   0.8805    
+Ethnicity4             0.4728969  1.9433916   0.243   0.8079    
+Ethnicity5            -0.6884299  2.2207802  -0.310   0.7567    
+Ethnicity6             1.7937527  2.5277792   0.710   0.4783    
+Ethnicity7            -0.1177346  1.8826834  -0.063   0.9502    
+Ethnicity8            -0.4296101  1.8964107  -0.227   0.8209    
+Ethnicity9             0.0976298  1.8892332   0.052   0.9588    
+Ethnicity10                   NA         NA      NA       NA    
+Income2                0.6168627  0.7924509   0.778   0.4367    
+Income3                1.4647738  0.6499642   2.254   0.0247 *  
+Income4                1.2214829  0.6225380   1.962   0.0504 .  
+Income5                1.1764970  0.6253967   1.881   0.0606 .  
+Income6                1.4282342  0.6240546   2.289   0.0226 *  
+Income7                1.3419889  0.6277638   2.138   0.0331 *  
+Income8                1.5060124  0.6588454   2.286   0.0227 *  
+Income9                1.1814688  0.6568584   1.799   0.0728 .  
+Income10               1.4512076  0.6619806   2.192   0.0289 *  
+Income11               0.9909869  0.6645514   1.491   0.1366    
+Income12               1.2522790  0.6845209   1.829   0.0680 .  
+Income13               0.8336257  0.7052663   1.182   0.2378    
+Income14               1.3716421  0.6573623   2.087   0.0375 *  
+Income15               0.6717645  0.8799697   0.763   0.4456    
+Income16               1.4445849  0.6902114   2.093   0.0369 *  
+Income17               1.1246862  0.6333101   1.776   0.0764 .  
+Income18               0.7149495  1.3455013   0.531   0.5954    
+Income19               1.6020486  0.7440956   2.153   0.0319 *  
+Religion2             -0.1447428  0.3506155  -0.413   0.6799    
+Religion3             -0.2389463  0.3452509  -0.692   0.4892    
+Religion4             -0.1774818  0.3336779  -0.532   0.5951    
+Religion5             -0.0544771  0.7458376  -0.073   0.9418    
+trust.in.science_7     0.0111162  0.0439041   0.253   0.8002    
+need_for_cognition     0.0484377  0.1325712   0.365   0.7150    
+interpersonal.trust_1 -0.1579809  0.0625460  -2.526   0.0119 *  
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+
+Residual standard error: 1.635 on 441 degrees of freedom
+  (3 observations deleted due to missingness)
+Multiple R-squared:  0.3869,    Adjusted R-squared:  0.2423 
+F-statistic: 2.676 on 104 and 441 DF,  p-value: 1.169e-12
+ + + + + + +
results %>%
+  ggplot(aes(x = data.trust_1, y = data.trust_6, color = as.factor(isCovidData))) +
+  geom_jitter() +
+  geom_smooth(method="lm") +
+  facet_wrap(~isCovidData) +
+  theme_minimal()
+ + + +

How does performance on VLAT questions predict trust?

+ + + +
model <- lm(formula = vis.trust_6 ~  assigned_vlat +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+ + +
Analysis of Variance Table
+
+Response: vis.trust_6
+                       Df Sum Sq Mean Sq  F value    Pr(>F)    
+assigned_vlat           1   3.03   3.031   2.3361  0.127115    
+Age                     1   9.80   9.797   7.5518  0.006238 ** 
+Gender                  3   8.98   2.992   2.3066  0.076008 .  
+State_1                46 129.02   2.805   2.1619 3.734e-05 ***
+Education               9  31.47   3.496   2.6950  0.004623 ** 
+Parents_education       2   1.22   0.612   0.4714  0.624447    
+Language                3   3.96   1.320   1.0172  0.384779    
+Ethnicity               8  17.01   2.126   1.6386  0.111622    
+Income                 18  28.11   1.562   1.2038  0.253242    
+Religion                4  14.82   3.705   2.8560  0.023337 *  
+trust.in.science_7      1 133.56 133.562 102.9516 < 2.2e-16 ***
+need_for_cognition      1   6.58   6.576   5.0687  0.024847 *  
+interpersonal.trust_1   1   6.82   6.823   5.2591  0.022296 *  
+Residuals             447 579.91   1.297                       
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + +
emmeans(aov(vis.trust_6 ~ vlat_simple * vlat_complex , data = results) , ~ vlat_simple | vlat_complex)
+ + +
vlat_complex = 0:
+ vlat_simple emmean     SE  df lower.CL upper.CL
+        0.77   5.24 0.0956 545     5.05     5.43
+
+vlat_complex = 1:
+ vlat_simple emmean     SE  df lower.CL upper.CL
+        0.77   5.47 0.0721 545     5.33     5.62
+
+Confidence level used: 0.95 
+ + + + + + +
results %>%
+  gather(key = vlat_level, value = vlat_performance, vlat_simple,  vlat_moderate, vlat_complex) %>%
+  ggplot(aes(x = vis.trust_6, y = vlat_performance, colour = as.factor(assigned_vlat))) +
+  geom_jitter(width = 0.5) +
+  # y(0, 2) + 
+  # labs(title = "Trust in data") + 
+  # geom_vline(data = results %>% 
+  #              group_by(complexity, isCovidData) %>%
+  #              summarize(n = n(), 
+  #                        vis.trust_6 = mean(vis.trust_6)), 
+  #            aes(xintercept = vis.trust_6, colour = as.factor(isCovidData))) +
+  facet_grid(rows = vars(vlat_level), cols = vars(chartType)) +
+  theme_minimal() + 
+  theme(panel.spacing = unit(2, "lines"))
+        # legend.position = "none")
+ + + +

Overall distribution of VLAT performance

+

Trust in Vis

+ + + +
# vlat_long <- results %>%
+#   gather(key = vlat_level, value = vlat_performance, vlat_simple,  vlat_moderate, vlat_complex) 
+# 
+# model <- lmer(formula = vlat_performance ~ vlat_level * isCovidData * chartType +
+#               Age + Gender + State_1 + Education + Parents_education + Language + 
+#               Ethnicity + Income + Religion + trust.in.science_7 + 
+#               need_for_cognition + interpersonal.trust_1 + (1|ResponseId),
+#             data = vlat_long)
+# Anova(model)
+# 
+# emmeans(aov(vlat_performance ~ vlat_level , data = results) , ~ vlat_simple | vlat_complex)
+# 
+# # post-hoc tests
+# aov(vlat_performance ~ vlat_level * as.factor(isCovidData), data = vlat_long) %>% tukey_hsd()
+ + + + + + +
results %>%
+  gather(key = vlat_level, value = vlat_performance, vlat_simple,  vlat_moderate, vlat_complex) %>%
+  group_by(vlat_level, chartType, isCovidData) %>%
+  summarize(n = n(),
+            mean_vlat_performance = mean(vlat_performance),
+            se = sd(vlat_performance)/sqrt(n),
+            n = n()) %>%
+  ggplot(aes(x = vlat_level, y = mean_vlat_performance, 
+             ymax = mean_vlat_performance + se, ymin = mean_vlat_performance - se,
+             colour = vlat_level)) +
+  geom_point() +
+  geom_errorbar() +
+  # labs(title = "Trust in data") + 
+  # geom_vline(data = results %>% 
+  #              group_by(complexity, isCovidData) %>%
+  #              summarize(n = n(), 
+  #                        vis.trust_6 = mean(vis.trust_6)), 
+  #            aes(xintercept = vis.trust_6, colour = as.factor(isCovidData))) +
+  facet_grid(rows = vars(isCovidData)) +
+  theme_minimal() + 
+  theme(panel.spacing = unit(2, "lines"))
+        # legend.position = "none")
+ + + +

Trust in Data

+ + + +
model <- lm(formula = data.trust_6 ~ vlat_simple * vlat_moderate * vlat_complex +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+
+emmeans(aov(data.trust_6 ~ vlat_simple * vlat_complex , data = results) , ~ vlat_simple | vlat_complex)
+ + + +
+
+

Which antecedent drives the interaction effect for trust in +visualization for covid data?

+ + + +
model <- lm(formula = vis.trust_1 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results %>% filter(isCovidData == 1))
+anova(model)
+ + + + + + +
model <- lm(formula = vis.trust_2 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results %>% filter(isCovidData == 1))
+anova(model)
+ + + + + + +
model <- lm(formula = vis.trust_3 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results %>% filter(isCovidData == 1))
+anova(model)
+ + + + + + +
model <- lm(formula = affect.science_1 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results %>% filter(isCovidData == 1))
+anova(model)
+ + + + + + +
model <- lm(formula = affect.clarity_1 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results %>% filter(isCovidData == 1))
+anova(model)
+ + + + + + +
model <- lm(formula = affect.aesthetic_1 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results %>% filter(isCovidData == 1))
+anova(model)
+ + + +
+
+

Which antecedent drives the main effect for trust in data?

+ + + +
model <- lm(formula = data.trust_1 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + + + + + +
model <- lm(formula = data.trust_2 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + + + + + +
model <- lm(formula = data.trust_3 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + + + + + +
model <- lm(formula = data.trust_4 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + + + + + +
model <- lm(formula = data.trust_5 ~ complexity
+                                    + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+ + +
Analysis of Variance Table
+
+Response: data.trust_5
+                       Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity              2  12.30  6.1489  3.5134 0.0306236 *  
+Age                     1   0.01  0.0150  0.0085 0.9263927    
+Gender                  3  11.20  3.7322  2.1325 0.0953809 .  
+State_1                46 112.98  2.4562  1.4034 0.0467885 *  
+Education               9  20.72  2.3020  1.3153 0.2263077    
+Parents_education       2   0.62  0.3113  0.1778 0.8371296    
+Language                3   3.64  1.2146  0.6940 0.5560659    
+Ethnicity               8  17.35  2.1691  1.2394 0.2740997    
+Income                 18  47.44  2.6356  1.5059 0.0831539 .  
+Religion                4   3.37  0.8419  0.4811 0.7496600    
+trust.in.science_7      1  22.29 22.2913 12.7369 0.0003974 ***
+need_for_cognition      1   7.34  7.3354  4.1913 0.0412161 *  
+interpersonal.trust_1   1   6.27  6.2738  3.5847 0.0589601 .  
+Residuals             446 780.56  1.7501                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + + +
+
+

How does provenance data predict trust?

+

Overall

+ + + +
brushed <- results %>%
+  gather(key = provenance_type, value = provenance_value, brushed, explore_interactions, explore_time) %>%
+  group_by(provenance_type, chartType, isCovidData, complexity) %>%
+  summarize(n = n(), 
+            mean = mean(provenance_value), 
+            se = sd(provenance_value)/sqrt(n),
+            n = n) %>%
+  filter(provenance_type == "brushed") %>%
+  ggplot(aes(x = provenance_type, y = mean, ymax = mean + se, ymin = mean - se, color = as.factor(isCovidData))) +
+  geom_point(position = position_dodge2(width = 0.5)) +
+  geom_errorbar(width = 0.5, size = 0.66, position = "dodge") +
+  facet_grid(rows = vars(complexity), cols = vars(isCovidData)) + 
+  theme_minimal() +
+  theme(panel.spacing = unit(2, "lines"))
+brushed
+
+interactions <- results %>%
+  gather(key = provenance_type, value = provenance_value, brushed, explore_interactions, explore_time) %>%
+  group_by(provenance_type, chartType, isCovidData, complexity) %>%
+  summarize(n = n(), 
+            mean = mean(provenance_value), 
+            se = sd(provenance_value)/sqrt(n),
+            n = n) %>%
+  filter(provenance_type == "explore_interactions") %>%
+  ggplot(aes(x = provenance_type, y = mean, ymax = mean + se, ymin = mean - se, color = as.factor(isCovidData))) +
+  geom_point(position = position_dodge2(width = 0.5)) +
+  geom_errorbar(width = 0.5, size = 0.66, position = "dodge") +
+  facet_grid(rows = vars(complexity), cols = vars(chartType)) + 
+  theme_minimal() +
+  theme(panel.spacing = unit(2, "lines"))
+interactions
+
+exploreTime <- results %>%
+  gather(key = provenance_type, value = provenance_value, brushed, explore_interactions, explore_time) %>%
+  group_by(provenance_type, chartType, isCovidData, complexity) %>%
+  summarize(n = n(), 
+            mean = mean(provenance_value), 
+            se = sd(provenance_value)/sqrt(n),
+            n = n) %>%
+  filter(provenance_type == "explore_time") %>%
+  ggplot(aes(x = provenance_type, y = mean, ymax = mean + se, ymin = mean - se, color = as.factor(isCovidData))) +
+  geom_point(position = position_dodge2(width = 0.5)) +
+  geom_errorbar(width = 0.5, size = 0.66, position = "dodge") +
+  facet_grid(rows = vars(chartType), cols = vars(complexity)) + 
+  theme_minimal() +
+  theme(panel.spacing = unit(2, "lines"))
+exploreTime
+
+exploreTime + interactions + brushed
+ggsave("provenanceResults.png", width = 26, height = 14)
+ + + +

explore_interactions

+ + + +
model <- lm(formula = explore_interactions ~ complexity * chartType * isCovidData +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+ + +
Analysis of Variance Table
+
+Response: explore_interactions
+                                  Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity                         2   3.62  1.8108  1.3216   0.26778    
+chartType                          1   0.00  0.0043  0.0031   0.95556    
+isCovidData                        1   5.29  5.2914  3.8617   0.05003 .  
+Age                                1  21.87 21.8733 15.9634 7.578e-05 ***
+Gender                             3  21.89  7.2978  5.3260   0.00130 ** 
+State_1                           46  59.25  1.2881  0.9401   0.58698    
+Education                          9  10.41  1.1563  0.8439   0.57595    
+Parents_education                  2   8.55  4.2738  3.1191   0.04518 *  
+Language                           3   1.17  0.3914  0.2856   0.83578    
+Ethnicity                          8  17.46  2.1826  1.5928   0.12461    
+Income                            18  22.08  1.2267  0.8953   0.58471    
+Religion                           4   7.11  1.7787  1.2981   0.26994    
+trust.in.science_7                 1   6.70  6.7007  4.8903   0.02753 *  
+need_for_cognition                 1   5.23  5.2339  3.8198   0.05129 .  
+interpersonal.trust_1              1   3.71  3.7112  2.7084   0.10054    
+complexity:chartType               2   0.42  0.2120  0.1547   0.85670    
+complexity:isCovidData             2   2.65  1.3246  0.9667   0.38116    
+chartType:isCovidData              1   0.00  0.0001  0.0001   0.99386    
+complexity:chartType:isCovidData   2   0.76  0.3781  0.2759   0.75898    
+Residuals                        437 598.79  1.3702                      
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + + +

explore_time

+ + + +
model <- lm(formula = explore_time ~ complexity * chartType * isCovidData +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+ + +
Analysis of Variance Table
+
+Response: explore_time
+                                  Df     Sum Sq  Mean Sq F value   Pr(>F)   
+complexity                         2   11546601  5773301  0.8285 0.437410   
+chartType                          1    9225464  9225464  1.3238 0.250536   
+isCovidData                        1   16042464 16042464  2.3020 0.129927   
+Age                                1   62648946 62648946  8.9899 0.002870 **
+Gender                             3   44564779 14854926  2.1316 0.095526 . 
+State_1                           46  287423601  6248339  0.8966 0.666542   
+Education                          9   88627287  9847476  1.4131 0.179773   
+Parents_education                  2   41616277 20808139  2.9859 0.051525 . 
+Language                           3    5762167  1920722  0.2756 0.842995   
+Ethnicity                          8  158088313 19761039  2.8356 0.004445 **
+Income                            18  123385347  6854741  0.9836 0.477474   
+Religion                           4  106522939 26630735  3.8214 0.004581 **
+trust.in.science_7                 1   25492061 25492061  3.6580 0.056453 . 
+need_for_cognition                 1    3078093  3078093  0.4417 0.506655   
+interpersonal.trust_1              1   16434195 16434195  2.3583 0.125345   
+complexity:chartType               2    5438215  2719108  0.3902 0.677168   
+complexity:isCovidData             2    5813922  2906961  0.4171 0.659191   
+chartType:isCovidData              1     133966   133966  0.0192 0.889791   
+complexity:chartType:isCovidData   2    5347737  2673868  0.3837 0.681571   
+Residuals                        437 3045364538  6968798                    
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + + +

Hypothesis: for the complex condition, we expect people who brushed +more to have higher trust

+ + + +
complexCondition <- results %>%
+  filter(complexity == "complex")
+
+# can change the predictor to bar.vis
+model<- manova(cbind(data.trust_1, 
+                     data.trust_2, 
+                     data.trust_3, 
+                     data.trust_4, 
+                     data.trust_5, 
+                     data.trust_6) ~ brushed + explore_interactions + explore_time, 
+               data = complexCondition)
+summary.aov(model)
+ + + +

Hypothesis: for all the conditions, we expect people who hovered more +to have higher trust

+ + + +
# can change the predictor to bar.vis
+model<- manova(cbind(vis.trust_6, 
+                     vis.trust_5, 
+                     vis.trust_4, 
+                     vis.trust_3, 
+                     vis.trust_2, 
+                     vis.trust_1) ~ brushed + explore_interactions + explore_time, 
+               data = results)
+summary.aov(model)
+ + + +
+
+

Affect on Trust {it’s own section}

+ + + +
results %>%
+  gather(key = affects, value = affectRatings, affect.science_1,  affect.clarity_1, affect.aesthetic_1) %>%
+  group_by(affects, chartType, isCovidData, complexity) %>%
+  summarize(n = n(),
+            mean = mean(affectRatings),
+            se = sd(affectRatings)/sqrt(n),
+            n = n()) %>%
+  ggplot(aes(x = affects, y = mean, 
+             ymax = mean + se, ymin = mean - se,
+             colour = as.factor(isCovidData))) +
+  geom_point(position = position_dodge2(width = 0.5)) +
+  geom_errorbar(width = 0.5, size = 0.66, position = "dodge") +
+  # labs(title = "Trust in data") + 
+  # geom_vline(data = results %>% 
+  #              group_by(complexity, isCovidData) %>%
+  #              summarize(n = n(), 
+  #                        vis.trust_6 = mean(vis.trust_6)), 
+  #            aes(xintercept = vis.trust_6, colour = as.factor(isCovidData))) +
+  facet_grid(rows = vars(chartType), cols = vars(complexity)) +
+  theme_minimal() + 
+  theme(panel.spacing = unit(2, "lines"))
+        # legend.position = "none")
+ggsave("affectMeasures.png", width = 17, height = 9)
+ + + + + + +
model <- lm(formula = affect.science_1 ~ complexity * chartType * isCovidData +
+              Age + as.factor(Gender) + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+ + + + + + +
model <- lm(formula = affect.clarity_1 ~ complexity * chartType * isCovidData +
+              Age + as.factor(Gender) + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+summary(model)
+ + + + +
model <- lm(formula = affect.aesthetic_1 ~ complexity * chartType * isCovidData +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+summary(model)
+ + + +

Trust in Vis

+ + + +
model <- lm(formula = vis.trust_6 ~ affect.science_1 * affect.clarity_1 * affect.aesthetic_1 +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+summary(model)
+
+emmeans(aov(vis.trust_6 ~ affect.science_1 * affect.clarity_1 , data = results) , ~ affect.clarity_1)
+ + + +

Trust in Data

+ + + +
model <- lm(formula = data.trust_6 ~ affect.science_1 * affect.clarity_1 * affect.aesthetic_1 +
+              Age + Gender + State_1 + Education + Parents_education + Language + 
+              Ethnicity + Income + Religion + trust.in.science_7 + 
+              need_for_cognition + interpersonal.trust_1,
+            data = results)
+anova(model)
+
+emmeans(aov(data.trust_6 ~ affect.science_1 * affect.clarity_1 , data = results) , ~ affect.clarity_1)
+ + + +
+
+

Factor Analysis

+ + + +
factorAnalysis <- results %>%
+  select(data.trust_1, data.trust_2, data.trust_3, data.trust_4, data.trust_5, data.trust_6,
+         vis.trust_1, vis.trust_2, vis.trust_3, vis.trust_4, vis.trust_5, vis.trust_6,
+         trust.in.science_1, trust.in.science_2, trust.in.science_3, trust.in.science_4, trust.in.science_5,
+         trust.in.science_6, trust.in.science_7, trust.in.science_8, 
+         cognition_1, cognition_2, cognition_3, cognition_4, cognition_5, cognition_6,
+         # brushed, explore_interactions, # explore_time, 
+         interpersonal.trust_1,
+         vlat_simple, vlat_moderate, vlat_complex,
+         # initial impression
+         affect.science_1, affect.clarity_1, affect.aesthetic_1)
+
+nfactors(factorAnalysis)
+ + + +

Factor 4 seem to have minimum compelxity, BIC is pretty low, and big +jump for root mean 5 seems meh becuase of the big jump from 4-5 on +complexity.

+ + + +
f7 <- fa(factorAnalysis, 7)
+pdf(file = "f7.pdf",   # The directory you want to save the file in
+    width = 15, # The width of the plot in inches
+    height = 23) # The height of the plot in inches
+fa.diagram(f7)
+dev.off()
+# based on the factor analysis, it looks like not all the vis Qs go together and not all the data Qs go together. 
+ + + + +
+ +
LS0tCnRpdGxlOiAiVHJ1c3QgaW4gU2NpZW5jZSBBbmFseXNpcyBOb3RlYm9vayIKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6IGRlZmF1bHQKICBwZGZfZG9jdW1lbnQ6IGRlZmF1bHQKLS0tCmBgYHtyIGVjaG8gPSBGQUxTRX0KcmVxdWlyZSh0aWR5dmVyc2UpCmxpYnJhcnkocHN5Y2gpCmxpYnJhcnkoZ2dwbG90MikKbGlicmFyeShjYXIpCmxpYnJhcnkobG1lNCkKbGlicmFyeShlbW1l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aXR5LCBpc0NvdmlkRGF0YSkgJT4lCiAgICAgICAgICAgICAgICBzdW1tYXJpemUobiA9IG4oKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYW4gPSBtZWFuKHZpcy50cnVzdF82KSwKICAgICAgICAgICAgc2UgPSBzZCh2aXMudHJ1c3RfNikvc3FydChuKSksIAogICAgICAgICAgICAgIGFlcyh4ID0gbWVhbiwgeGVuZCA9IG1lYW4sIHkgPSAtLjI1LCB5ZW5kID0gLjI1LCAgY29sb3VyID0gYXMuZmFjdG9yKGlzQ292aWREYXRhKSksIHNpemUgPSAxKSArCiAgICAgICAgIyBzdGF0X3N1bW1hcnkoZnVuLmRhdGEgPSAibWVhbl9jbF9ib290IiwgY29sb3VyID0gInJlZCIsIHNpemUgPSAwLjUsIHBvc2l0aW9uID0gcG9zaXRpb25fbnVkZ2UoeD0wLjI1LCB5PTApLCBhbHBoYT0wLjUpICsKCiAgZ2VvbV90ZXh0KCBkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBpc0NvdmlkRGF0YSkgJT4lCiAgICAgICAgICAgICAgICBzdW1tYXJpemUobiA9IG4oKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYW4gPSByb3VuZChtZWFuKHZpcy50cnVzdF82KSxkaWdpdHM9MiksCiAgICAgICAgICAgIHNlID0gcm91bmQoc2QoZGF0YS50cnVzdF82KS9zcXJ0KG4pLGRpZ2l0cz0yKSwKICAgICAgICAgICAgICAgICAgICAgICAgICB2aXMudHJ1c3RfNiA9IG1lYW4odmlzLnRydXN0XzYpKSwKICAgICAgICAgICAgIyBhZXMobGFiZWwgPSBwYXN0ZShtZWFuLCAiWyIsbWVhbi1zZSwiLCIsbWVhbitzZSwiXSIpLCB4ID0gNi4yLCB5ID0gMC40MywgZm9udGZhY2UgPSAzKSwgc2l6ZT0zLCBjb2xvdXIgPSAiYmxhY2siKSsKICAgICAgICAgICA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nZSIpKSArCiAgeWxpbSgtMC41LCAwLjUpICsKICBnZW9tX2ppdHRlcihkYXRhID0gcmVzdWx0cywgd2lkdGggPSAwLjMsIGhlaWdodCA9IDAuMiwgY29sb3IgPSAibGlnaHQgZ3JheSIsIGFscGhhID0gMC41KSArCiAgI3N0YXRfc3VtbWFyeShmdW4uZGF0YT1NaW5NZWFuU0VNTWF4LCBnZW9tPSJib3hwbG90IiwgY29sb3VyPSJyZWQiKSArCgogIGdlb21fYm94cGxvdChsd2QgPSAxLCBmYXR0ZW4gPSBOVUxMLCB3aWR0aCA9IDAuMjUsIGFscGhhID0gMC41KSArCgogIGdlb21fc2VnbWVudChkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBjaGFydFR5cGUpICU+JQogICAgICAgICAgICAgICAgc3VtbWFyaXplKG4gPSBuKCksIAogICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFuID0gbWVhbih2aXMudHJ1c3RfNiksCiAgICAgICAgICAgIHNlID0gc2QodmlzLnRydXN0XzYpL3NxcnQobikpLCAKICAgICAgICAgICAgICBhZXMoeCA9IG1lYW4sIHhlbmQgPSBtZWFuLCB5ID0gLS4yNSwgeWVuZCA9IC4yNSwgIGNvbG91ciA9IGNoYXJ0VHlwZSksIHNpemUgPSAxKSArCiAgICAgICAgIyBzdGF0X3N1bW1hcnkoZnVuLmRhdGEgPSAibWVhbl9jbF9ib290IiwgY29sb3VyID0gInJlZCIsIHNpemUgPSAwLjUsIHBvc2l0aW9uID0gcG9zaXRpb25fbnVkZ2UoeD0wLjI1LCB5PTApLCBhbHBoYT0wLjUpICsKCiAgZ2VvbV90ZXh0KCBkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBjaGFydFR5cGUpICU+JQogICAgICAgICAgICAgICAgc3VtbWFyaXplKG4gPSBuKCksIAogICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFuID0gcm91bmQobWVhbih2aXMudHJ1c3RfNiksZGlnaXRzPTIpLAogICAgICAgICAgICBzZSA9IHJvdW5kKHNkKGRhdGEudHJ1c3RfNikvc3FydChuKSxkaWdpdHM9MiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgdmlzLnRydXN0XzYgPSBtZWFuKHZpcy50cnVzdF82KSksCiAgICAgICAgICAgICMgYWVzKGxhYmVsID0gcGFzdGUobWVhbiwgIlsiLG1lYW4tc2UsIiwiLG1lYW4rc2UsIl0iKSwgeCA9IDYuMiwgeSA9IDAuNDMsIGZvbnRmYWNlID0gMyksIHNpemU9MywgY29sb3VyID0gImJsYWNrIikrCiAgICAgICAgICAgICAgYWVzKGxhYmVsID0gcGFzdGUobWVhbiksIHggPSBtZWFuLCB5ID0gLjM1LCBmb250ZmFjZSA9IDMpLCBzaXplPTQsIGNvbG91ciA9ICJibGFjayIpKwoKICBmYWNldF9ncmlkKGNvbXBsZXhpdHkgfiBjaGFydFR5cGUpICsKICB4bGFiKCJUcnVzdCBpbiBWaXN1YWxpemF0aW9uIikgKwogIHRoZW1lX21pbmltYWwoKSArIAogIHRoZW1lKHBhbmVsLnNwYWNpbmcgPSB1bml0KDIsICJsaW5lcyIpLAogICAgICAgIGxlZ2VuZC5wb3NpdGlvbiA9ICJub25lIiwKICAgICAgICBheGlzLnRleHQueSA9IGVsZW1lbnRfYmxhbmsoKSwKICAgICAgICBheGlzLnRpdGxlLnkgPSBlbGVtZW50X2JsYW5rKCksCiAgICAgICAgYXhpcy50aWNrcy55ID0gZWxlbWVudF9ibGFuaygpKQoKCgpnZ3NhdmUocGFzdGUoImNvbXBsZXhpdHlfY2hhcnRUeXBlX2ludGVyYWN0aW9uLnBkZiIsIHNlcD0iIikpCgpgYGAKCgoKYGBge3J9CnJlc3VsdHMgJT4lCiAgZ3JvdXBfYnkoY29tcGxleGl0eSwgaXNDb3ZpZERhdGEpICU+JQogIHN1bW1hcml6ZShuID0gbigpLAogICAgICAgICA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iwgeSA9IC0uMjUsIHllbmQgPSAuMjUsICBjb2xvdXIgPSJzYWxtb24iKSwgc2l6ZSA9IDEpICsKCiAgCiAgZ2VvbV90ZXh0KCBkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5KSAlPiUKICAgICAgICAgICAgICAgIHN1bW1hcml6ZShuID0gbigpLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVhbiA9IHJvdW5kKG1lYW4oZGF0YS50cnVzdF82KSxkaWdpdHM9MiksCiAgICAgICAgICAgIHNlID0gcm91bmQoc2QoZGF0YS50cnVzdF82KS9zcXJ0KG4pLGRpZ2l0cz0yKSwKICAgICAgICAgICAgICAgICAgICAgICAgICBkYWR0YS50cnVzdF82ID0gbWVhbihkYXRhLnRydXN0XzYpKSwKICAgICAgICAgICAgIyBhZXMobGFiZWwgPSBwYXN0ZShtZWFuLCAiWyIsbWVhbi1zZSwiLCIsbWVhbitzZSwiXSIpLCB4ID0gNi4yLCB5ID0gMC40MywgZm9udGZhY2UgPSAzKSwgc2l6ZT0zLCBjb2xvdXIgPSAiYmxhY2siKSsKICAgICAgICAgICAgICBhZXMobGFiZWwgPSBwYXN0ZShtZWFuKSwgeCA9IG1lYW4sIHkgPSAuMzUsIGZvbnRmYWNlID0gMyksIHNpemU9NCwgY29sb3VyID0gImJsYWNrIikrCiAgCgogIAogIGZhY2V0X2dyaWQocm93cyA9IHZhcnMoY29tcGxleGl0eSkpICsKICB4bGFiKCJUcnVzdCBpbiBEYXRhIikgKwogIHRoZW1lX21pbmltYWwoKSArIAogIHRoZW1lKHBhbmVsLnNwYWNpbmcgPSB1bml0KDIsICJsaW5lcyIpLAogICAgICAgIGxlZ2VuZC5wb3NpdGlvbiA9ICJub25lIiwKICAgICAgICBheGlzLnRleHQueSA9IGVsZW1lbnRfYmxhbmsoKSwKICAgICAgICBheGlzLnRpdGxlLnkgPSBlbGVtZW50X2JsYW5rKCksCiAgICAgICA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ArIAogICAgICAgICAgICAgIHZpcy50cnVzdF8zICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzQgKyAKICAgICAgICAgICAgICB2aXMudHJ1c3RfNSArIAogICAgICAgICAgICAgIGFmZmVjdC5zY2llbmNlXzEgKwogICAgICAgICAgICAgIGFmZmVjdC5jbGFyaXR5XzEgKyAKICAgICAgICAgICAgICBhZmZlY3QuYWVzdGhldGljXzEgKwogICAgICAgICAgICAgIEFnZSArIEdlbmRlciArIFN0YXRlXzEgKyBFZHVjYXRpb24gKyBQYXJlbnRzX2VkdWNhdGlvbiArIExhbmd1YWdlICsgCiAgICAgICAgICAgICAgRXRobmljaXR5ICsgSW5jb21lICsgUmVsaWdpb24gKyB0cnVzdC5pbi5zY2llbmNlXzcgKyAKICAgICAgICAgICAgICBuZWVkX2Zvcl9jb2duaXRpb24gKyBpbnRlcnBlcnNvbmFsLnRydXN0XzEsCiAgICAgICAgICAgIGRhdGEgPSByZXN1bHRzKQpzdW1tYXJ5KG1vZGVsKQpgYGAKCgpgYGB7cn0KbW9kZWwgPC0gbG0oZm9ybXVsYSA9IGRhdGEudHJ1c3RfNiB+IGRhdGEudHJ1c3RfMSArIAogICAgICAgICAgICAgIGRhdGEudHJ1c3RfMiArIAogICAgICAgICAgICAgIGRhdGEudHJ1c3RfMyArIAogICAgICAgICAgICAgIGRhdGEudHJ1c3RfNCArIAogICAgICAgICAgICAgIGRhdGEudHJ1c3RfNSArCiAgICAgICAgICAgICAgQWdlICsgR2VuZGVyICsgU3RhdGVfMSArIEVkdWNhdGlvbiArIFBhcmVudHNfZWR1Y2F0aW9uICsgTGFuZ3VhZ2UgKyAKICAgICAgICAgICAgICBFdGhuaWNpdHkgKyBJbmNvbWUgKyBSZWxpZ2lvbiArIHRydXN0LmluLnNjaWVuY2VfNyArIAogICAgICAgICAgICAgIG5lZWRfZm9yX2NvZ25pdGlvbiArIGludGVycGVyc29uYWwudHJ1c3RfMSwKICAgICAgICAgICAgZGF0YSA9IHJlc3VsdHMpCnN1bW1hcnkobW9kZWwpCmBgYAoKIyBXaGljaCB0cnVzdCBtZWFzdXJlbWVudHMgcHJlZGljdCBiZWhhdmlvcmFsIG91dGNvbWVzPwoKYGBge3J9Cm1vZGVsIDwtIGxtKGZvcm11bGEgPSB2aXMudHJ1c3RfNCB+IHZpcy50cnVzdF8xICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzIgKyAKICAgICAgICAgICAgICB2aXMudHJ1c3RfMyArCiAgICAgICAgICAgICAgdmlzLnRydXN0XzYgKwogICAgICAgICAgICAgIGFmZmVjdC5zY2llbmNlXzEgKwogICAgICAgICAgICAgIGFmZmVjdC5jbGFyaXR5XzEgKyAKICAgICAgICAgICAgICBhZmZlY3QuYWVzdGhldGljXzEgKwogICAgICAgICAgICAgIEFnZSArIEdlbmRlciArIFN0YXRlXzEgKyBFZHVjYXRpb24gKyBQYXJlbnRzX2VkdWNhdGlvbiArIExhbmd1YWdlICsgCiAgICAgICAgICAgICAgRXRobmljaXR5ICsgSW5jb21lICsgUmVsaWdpb24gKyB0cnVzdC5pbi5zY2llbmNlXzcgKyAKICAgICAgICAgICAgICBuZWVkX2Zvcl9jb2duaXRpb24gKyBpbnRlcnBlcnNvbmFsLnRydXN0XzEsCiAgICAgICAgICAgIGRhdGEgPSByZXN1bHRzKQpzdW1tYXJ5KG1vZGVsKQpgYGAKCmBgYHtyfQptb2RlbCA8LSBsbShmb3JtdWxhID0gdmlzLnRydXN0XzUgfiB2aXMudHJ1c3RfMSArIAogICAgICAgICAgICAgIHZpcy50cnVzdF8yICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzMgKwogICAgICAgICAgICAgIHZpcy50cnVzdF82ICsKICAgICAgICAgICAgICBhZmZlY3Quc2NpZW5jZV8xICsKICAgICAgICAgICAgICBhZmZlY3QuY2xhcml0eV8xICsgCiAgICAgICAgICAgICAgYWZmZWN0LmFlc3RoZXRpY18xICsKICAgICAgICAgICAgICBBZ2UgKyBHZW5kZXIgKy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29uZGl0aW9uLCB3ZSBleHBlY3QgcGVvcGxlIHdobyBicnVzaGVkIG1vcmUgdG8gaGF2ZSBoaWdoZXIgdHJ1c3QKCmBgYHtyfQpjb21wbGV4Q29uZGl0aW9uIDwtIHJlc3VsdHMgJT4lCiAgZmlsdGVyKGNvbXBsZXhpdHkgPT0gImNvbXBsZXgiKQoKIyBjYW4gY2hhbmdlIHRoZSBwcmVkaWN0b3IgdG8gYmFyLnZpcwptb2RlbDwtIG1hbm92YShjYmluZChkYXRhLnRydXN0XzEsIAogICAgICAgICAgICAgICAgICAgICBkYXRhLnRydXN0XzIsIAogICAgICAgICAgICAgICAgICAgICBkYXRhLnRydXN0XzMsIAogICAgICAgICAgICAgICAgICAgICBkYXRhLnRydXN0XzQsIAogICAgICAgICAgICAgICAgICAgICBkYXRhLnRydXN0XzUsIAogICAgICAgICAgICAgICAgICAgICBkYXRhLnRydXN0XzYpIH4gYnJ1c2hlZCArIGV4cGxvcmVfaW50ZXJhY3Rpb25zICsgZXhwbG9yZV90aW1lLCAKICAgICAgICAgICAgICAgZGF0YSA9IGNvbXBsZXhDb25kaXRpb24pCnN1bW1hcnkuYW92KG1vZGVsKQpgYGAKCkh5cG90aGVzaXM6CmZvciBhbGwgdGhlIGNvbmRpdGlvbnMsIHdlIGV4cGVjdCBwZW9wbGUgd2hvIGhvdmVyZWQgbW9yZSB0byBoYXZlIGhpZ2hlciB0cnVzdAoKCmBgYHtyfQojIGNhbiBjaGFuZ2UgdGhlIHByZWRpY3RvciB0byBiYXIudmlzCm1vZGVsPC0gbWFub3ZhKGNiaW5kKHZpcy50cnVzdF82LCAKICAgICAgICAgICAgICAgICAgICAgdmlzLnRydXN0XzUsIAogICAgICAgICAgICAgICAgICAgICB2aXMudHJ1c3RfNCwgCiAgICAgICAgICAgICAgICAgICAgIHZpcy50cnVzdF8zLCAKICAgICAgICAgICAgICAgICAgICAgdmlzLnRydXN0XzIsIAogICAgICAgICAgICAgICAgICAgICB2aXMudHJ1c3RfM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gc2VlbXMgbWVoIGJlY3Vhc2Ugb2YgdGhlIGJpZyBqdW1wIGZyb20gNC01IG9uIGNvbXBsZXhpdHkuIAoKYGBge3J9CmY3IDwtIGZhKGZhY3RvckFuYWx5c2lzLCA3KQpwZGYoZmlsZSA9ICJmNy5wZGYiLCAgICMgVGhlIGRpcmVjdG9yeSB5b3Ugd2FudCB0byBzYXZlIHRoZSBmaWxlIGluCiAgICB3aWR0aCA9IDE1LCAjIFRoZSB3aWR0aCBvZiB0aGUgcGxvdCBpbiBpbmNoZXMKICAgIGhlaWdodCA9IDIzKSAjIFRoZSBoZWlnaHQgb2YgdGhlIHBsb3QgaW4gaW5jaGVzCmZhLmRpYWdyYW0oZjcpCmRldi5vZmYoKQojIGJhc2VkIG9uIHRoZSBmYWN0b3IgYW5hbHlzaXMsIGl0IGxvb2tzIGxpa2Ugbm90IGFsbCB0aGUgdmlzIFFzIGdvIHRvZ2V0aGVyIGFuZCBub3QgYWxsIHRoZSBkYXRhIFFzIGdvIHRvZ2V0aGVyLiAKYGBgCgoKCg==
+ + + +
+ + + + + + + + + + + + + + + + diff --git a/study_data/replicationStudy/trustFullAnalysis_7.24.2023.Rmd b/study_data/replicationStudy/trustFullAnalysis_7.24.2023.Rmd index d4c2361..b8a8fab 100644 --- a/study_data/replicationStudy/trustFullAnalysis_7.24.2023.Rmd +++ b/study_data/replicationStudy/trustFullAnalysis_7.24.2023.Rmd @@ -163,19 +163,33 @@ results %>% ``` ```{r} -model <- lm(formula = vis.trust_6 ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , +model <- lm(formula = vis.trust_5 ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , data = results) anova(model) ``` ```{r} model <- lm(formula = vis.trust_6 ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , - data = results%>% filter(complexity !='moderatex')) + data = results) anova(model) ``` +```{r} + +model<- manova( cbind(vis.trust_6,vis.trust_1,vis.trust_2,vis.trust_3,vis.trust_4,vis.trust_5,affect.science_1,affect.clarity_1,affect.aesthetic_1) ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , + data = results) + +anova(model) +eta_squared(model) + +summary.aov(model) + + + +``` + ```{r} model <- lm(formula = vis.trust_6 ~ complexity + chartType + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , data = results) @@ -186,6 +200,21 @@ anova(model) Linear Regression Model for trust in vis as a function of + +```{r} +# can change the predictor to bar.vis +model<- manova(cbind(vis.trust_6, + affect.science_1, + affect.clarity_1, + affect.aesthetic_1, + vis.trust_3, + vis.trust_2, + vis.trust_1) ~ complexity* chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , + data = results) +summary(model) +``` + + ```{r} model <- lm(formula = vis.trust_6 ~ complexity *chartType + Age + Gender + State_1 + Income + Education + Parents_education + Language + Ethnicity + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 , data = results) diff --git a/study_data/replicationStudy/trustFullAnalysis_7.24.2023.nb.html b/study_data/replicationStudy/trustFullAnalysis_7.24.2023.nb.html index 33007bf..5c9bd54 100644 --- a/study_data/replicationStudy/trustFullAnalysis_7.24.2023.nb.html +++ b/study_data/replicationStudy/trustFullAnalysis_7.24.2023.nb.html @@ -1754,8 +1754,73 @@

Trust in Science Analysis Notebook

- -
Warning: namespace ‘ez’ is not available and has been replaced
+
+
Loading required package: tidyverse
+── Attaching core tidyverse packages ────────────────────────────────────────────────────────────────────────────────────────── tidyverse 2.0.0 ──
+✔ dplyr     1.1.0     ✔ readr     2.1.4
+✔ forcats   1.0.0     ✔ stringr   1.5.0
+✔ ggplot2   3.4.1     ✔ tibble    3.2.0
+✔ lubridate 1.9.2     ✔ tidyr     1.3.0
+✔ purrr     1.0.1     ── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
+✖ dplyr::filter() masks stats::filter()
+✖ dplyr::lag()    masks stats::lag()
+ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
+Attaching package: ‘psych’
+
+The following objects are masked from ‘package:ggplot2’:
+
+    %+%, alpha
+
+Loading required package: carData
+
+Attaching package: ‘car’
+
+The following object is masked from ‘package:psych’:
+
+    logit
+
+The following object is masked from ‘package:dplyr’:
+
+    recode
+
+The following object is masked from ‘package:purrr’:
+
+    some
+
+Loading required package: Matrix
+
+Attaching package: ‘Matrix’
+
+The following objects are masked from ‘package:tidyr’:
+
+    expand, pack, unpack
+
+
+Attaching package: ‘rstatix’
+
+The following object is masked from ‘package:stats’:
+
+    filter
+
+
+Attaching package: ‘effectsize’
+
+The following objects are masked from ‘package:rstatix’:
+
+    cohens_d, eta_squared
+
+The following object is masked from ‘package:psych’:
+
+    phi
+
+
+Attaching package: ‘GPArotation’
+
+The following objects are masked from ‘package:psych’:
+
+    equamax, varimin
+
+Warning: namespace ‘ez’ is not available and has been replaced
 by .GlobalEnv when processing object ‘anova_result’
@@ -1796,7 +1861,7 @@

Trust in Science Analysis Notebook

- +

 MinMeanSEMMax <- function(x) {
   v <- c(min(x), mean(x) - sd(x)/sqrt(length(x)), mean(x), mean(x) + sd(x)/sqrt(length(x)), max(x))
@@ -1838,20 +1903,13 @@ 

Trust in Science Analysis Notebook

legend.position = "none", axis.text.y = element_blank(), axis.title.y = element_blank(), - axis.ticks.y = element_blank())
- - -
`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.
- - -
ggsave(paste("complexity_dataType_interaction.pdf", sep=""))
+ axis.ticks.y = element_blank()) + + + +ggsave(paste("complexity_dataType_interaction.pdf", sep="")) +
- -
Saving 7.29 x 4.51 in image
- - -

- @@ -1867,7 +1925,7 @@

Trust in Science Analysis Notebook

`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.
- +
-
- - -
model <- lm(formula = vis.trust_6 ~ complexity  * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+
+
model <- lm(formula = vis.trust_5 ~ complexity  * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
             data = results)
 anova(model)
- +
Analysis of Variance Table
 
-Response: vis.trust_6
-                       Df  Sum Sq Mean Sq F value  Pr(>F)    
-complexity              2   3.505   1.753  1.0992 0.33556    
-chartType               1   3.013   3.013  1.8895 0.17112    
-Age                     1   5.882   5.882  3.6892 0.05649 .  
-Gender                  4   6.263   1.566  0.9819 0.41901    
-State_1                41  94.562   2.306  1.4464 0.05536 .  
-Education               8  26.758   3.345  2.0976 0.03870 *  
-Parents_education       2   1.350   0.675  0.4232 0.65567    
-Language                3  21.482   7.161  4.4907 0.00466 ** 
-Ethnicity               7  15.258   2.180  1.3670 0.22248    
-Income                 17  38.909   2.289  1.4354 0.12580    
-Religion                4   8.527   2.132  1.3369 0.25838    
-trust.in.science_7      1 133.317 133.317 83.6094 < 2e-16 ***
-need_for_cognition      1   0.520   0.520  0.3258 0.56890    
-interpersonal.trust_1   1   1.261   1.261  0.7909 0.37513    
-complexity:chartType    2   0.096   0.048  0.0302 0.97025    
-Residuals             165 263.097   1.595                    
+Response: vis.trust_5
+                       Df Sum Sq Mean Sq F value    Pr(>F)    
+complexity              2   0.68   0.338  0.1127 0.8935283    
+chartType               1   1.79   1.785  0.5945 0.4417753    
+Age                     1   0.30   0.297  0.0989 0.7536004    
+Gender                  4  14.82   3.705  1.2337 0.2985932    
+State_1                41 112.44   2.742  0.9132 0.6232012    
+Education               8  41.35   5.169  1.7211 0.0968992 .  
+Parents_education       2   0.84   0.419  0.1395 0.8698570    
+Language                3  25.42   8.472  2.8213 0.0405880 *  
+Ethnicity               7  25.11   3.588  1.1947 0.3085028    
+Income                 17  52.35   3.080  1.0255 0.4333812    
+Religion                4  17.35   4.337  1.4444 0.2216479    
+trust.in.science_7      1  40.37  40.366 13.4416 0.0003315 ***
+need_for_cognition      1   1.11   1.111  0.3700 0.5438341    
+interpersonal.trust_1   1   2.16   2.160  0.7193 0.3975888    
+complexity:chartType    2   4.18   2.091  0.6963 0.4998683    
+Residuals             165 495.50   3.003                      
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- +
model <- lm(formula = vis.trust_6 ~ complexity * chartType + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
-            data = results%>% filter(complexity !='moderatex'))
+            data = results)
 anova(model)
@@ -2014,73 +2060,67 @@

Trust in Science Analysis Notebook

- -
model <- lm(formula = vis.trust_6 ~ complexity  + chartType + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
-            data = results)
+
+

+model<- manova( cbind(vis.trust_6,vis.trust_1,vis.trust_2,vis.trust_3,vis.trust_4,vis.trust_5,affect.science_1,affect.clarity_1,affect.aesthetic_1) ~ complexity  * chartType  + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+               data = results)
+
 anova(model)
- +
Analysis of Variance Table
 
-Response: vis.trust_6
-                       Df Sum Sq Mean Sq F value Pr(>F)    
-complexity              2   3.51   1.753  1.0096 0.3658    
-chartType               1   3.01   3.013  1.7354 0.1889    
-trust.in.science_7      1 173.53 173.528 99.9521 <2e-16 ***
-need_for_cognition      1   0.20   0.196  0.1128 0.7372    
-interpersonal.trust_1   1   2.59   2.588  1.4905 0.2233    
-Residuals             254 440.97   1.736                   
+                       Df  Pillai approx F num Df den Df    Pr(>F)    
+(Intercept)             1 0.98590  1219.32      9    157 < 2.2e-16 ***
+complexity              2 0.18774     1.82     18    316   0.02243 *  
+chartType               1 0.06709     1.25      9    157   0.26605    
+Age                     1 0.11895     2.36      9    157   0.01604 *  
+Gender                  4 0.20616     0.97     36    640   0.52766    
+State_1                41 1.88577     1.07    369   1485   0.20990    
+Education               8 0.45038     1.09     72   1312   0.29307    
+Parents_education       2 0.09347     0.86     18    316   0.62716    
+Language                3 0.22437     1.43     27    477   0.07723 .  
+Ethnicity               7 0.46600     1.29     63   1141   0.06597 .  
+Income                 17 0.96487     1.17    153   1485   0.09110 .  
+Religion                4 0.17042     0.79     36    640   0.80521    
+trust.in.science_7      1 0.40270    11.76      9    157 4.857e-14 ***
+need_for_cognition      1 0.11276     2.22      9    157   0.02358 *  
+interpersonal.trust_1   1 0.06655     1.24      9    157   0.27226    
+complexity:chartType    2 0.10018     0.93     18    316   0.54752    
+Residuals             165                                             
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- - -

Linear Regression Model for trust in vis as a function of

- - - -
model <- lm(formula = vis.trust_6 ~ complexity *chartType  + Age + Gender + State_1 + Income + Education + Parents_education + Language + Ethnicity  + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
-            data = results)
-anova(model)
+ +
eta_squared(model)
- -
Analysis of Variance Table
-
-Response: vis.trust_6
-                       Df  Sum Sq Mean Sq F value  Pr(>F)    
-complexity              2   3.505   1.753  1.0992 0.33556    
-chartType               1   3.013   3.013  1.8895 0.17112    
-Age                     1   5.882   5.882  3.6892 0.05649 .  
-Gender                  4   6.263   1.566  0.9819 0.41901    
-State_1                41  94.562   2.306  1.4464 0.05536 .  
-Income                 17  38.875   2.287  1.4342 0.12635    
-Education               8  23.677   2.960  1.8561 0.07022 .  
-Parents_education       2   1.544   0.772  0.4840 0.61716    
-Language                3  20.165   6.722  4.2155 0.00666 ** 
-Ethnicity               7  19.495   2.785  1.7466 0.10151    
-Religion                4   8.527   2.132  1.3369 0.25838    
-trust.in.science_7      1 133.317 133.317 83.6094 < 2e-16 ***
-need_for_cognition      1   0.520   0.520  0.3258 0.56890    
-interpersonal.trust_1   1   1.261   1.261  0.7909 0.37513    
-complexity:chartType    2   0.096   0.048  0.0302 0.97025    
-Residuals             165 263.097   1.595                    
----
-Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ +
# Effect Size for ANOVA (Type I)
+
+Parameter             | Eta2 (partial) |       95% CI
+-----------------------------------------------------
+complexity            |           0.09 | [0.01, 1.00]
+chartType             |           0.07 | [0.00, 1.00]
+Age                   |           0.12 | [0.01, 1.00]
+Gender                |           0.05 | [0.00, 1.00]
+State_1               |           0.21 | [0.00, 1.00]
+Education             |           0.06 | [0.00, 1.00]
+Parents_education     |           0.05 | [0.00, 1.00]
+Language              |           0.07 | [0.00, 1.00]
+Ethnicity             |           0.07 | [0.00, 1.00]
+Income                |           0.11 | [0.00, 1.00]
+Religion              |           0.04 | [0.00, 1.00]
+trust.in.science_7    |           0.40 | [0.29, 1.00]
+need_for_cognition    |           0.11 | [0.01, 1.00]
+interpersonal.trust_1 |           0.07 | [0.00, 1.00]
+complexity:chartType  |           0.05 | [0.00, 1.00]
+
+- One-sided CIs: upper bound fixed at [1.00].
- - - -
# can change the predictor to bar.vis
-model<- manova(cbind(vis.trust_6, 
-                     vis.trust_5, 
-                     vis.trust_4, 
-                     vis.trust_3, 
-                     vis.trust_2, 
-                     vis.trust_1) ~ complexity  * chartType  + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
-               data = results %>%filter(isCovidData == 1))
-summary.aov(model)
+ +
summary.aov(model)
- +
 Response vis.trust_6 :
                        Df  Sum Sq Mean Sq F value  Pr(>F)    
 complexity              2   3.505   1.753  1.0992 0.33556    
@@ -2102,45 +2142,45 @@ 

Trust in Science Analysis Notebook

--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - Response vis.trust_5 : - Df Sum Sq Mean Sq F value Pr(>F) -complexity 2 0.68 0.338 0.1127 0.8935283 -chartType 1 1.79 1.785 0.5945 0.4417753 -Age 1 0.30 0.297 0.0989 0.7536004 -Gender 4 14.82 3.705 1.2337 0.2985932 -State_1 41 112.44 2.742 0.9132 0.6232012 -Education 8 41.35 5.169 1.7211 0.0968992 . -Parents_education 2 0.84 0.419 0.1395 0.8698570 -Language 3 25.42 8.472 2.8213 0.0405880 * -Ethnicity 7 25.11 3.588 1.1947 0.3085028 -Income 17 52.35 3.080 1.0255 0.4333812 -Religion 4 17.35 4.337 1.4444 0.2216479 -trust.in.science_7 1 40.37 40.366 13.4416 0.0003315 *** -need_for_cognition 1 1.11 1.111 0.3700 0.5438341 -interpersonal.trust_1 1 2.16 2.160 0.7193 0.3975888 -complexity:chartType 2 4.18 2.091 0.6963 0.4998683 -Residuals 165 495.50 3.003 + Response vis.trust_1 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 0.123 0.061 0.0385 0.962247 +chartType 1 0.110 0.110 0.0691 0.792937 +Age 1 13.054 13.054 8.1859 0.004768 ** +Gender 4 2.145 0.536 0.3363 0.853234 +State_1 41 88.553 2.160 1.3544 0.094778 . +Education 8 26.082 3.260 2.0445 0.044208 * +Parents_education 2 0.821 0.411 0.2575 0.773265 +Language 3 15.545 5.182 3.2494 0.023334 * +Ethnicity 7 35.100 5.014 3.1444 0.003815 ** +Income 17 28.181 1.658 1.0395 0.418536 +Religion 4 7.784 1.946 1.2203 0.304188 +trust.in.science_7 1 59.373 59.373 37.2325 7.226e-09 *** +need_for_cognition 1 0.086 0.086 0.0538 0.816911 +interpersonal.trust_1 1 1.974 1.974 1.2377 0.267526 +complexity:chartType 2 1.934 0.967 0.6064 0.546509 +Residuals 165 263.120 1.595 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - Response vis.trust_4 : - Df Sum Sq Mean Sq F value Pr(>F) -complexity 2 5.27 2.637 0.8651 0.4229297 -chartType 1 0.01 0.007 0.0023 0.9621805 -Age 1 0.06 0.064 0.0210 0.8848391 -Gender 4 15.86 3.966 1.3009 0.2718495 -State_1 41 140.41 3.425 1.1234 0.2998026 -Education 8 40.42 5.052 1.6572 0.1124960 -Parents_education 2 10.33 5.166 1.6946 0.1868604 -Language 3 27.32 9.107 2.9873 0.0327566 * -Ethnicity 7 73.74 10.535 3.4557 0.0017676 ** -Income 17 46.20 2.717 0.8914 0.5849737 -Religion 4 6.69 1.672 0.5484 0.7004665 -trust.in.science_7 1 39.72 39.720 13.0293 0.0004064 *** -need_for_cognition 1 3.63 3.632 1.1915 0.2766202 -interpersonal.trust_1 1 9.99 9.985 3.2754 0.0721437 . -complexity:chartType 2 9.94 4.972 1.6308 0.1989062 -Residuals 165 503.01 3.049 + Response vis.trust_2 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 17.052 8.5260 6.8566 0.001379 ** +chartType 1 6.256 6.2563 5.0313 0.026224 * +Age 1 4.798 4.7980 3.8585 0.051173 . +Gender 4 6.989 1.7472 1.4051 0.234509 +State_1 41 56.370 1.3749 1.1057 0.322937 +Education 8 10.046 1.2557 1.0099 0.430596 +Parents_education 2 1.789 0.8944 0.7192 0.488639 +Language 3 10.425 3.4749 2.7945 0.042012 * +Ethnicity 7 8.895 1.2708 1.0220 0.417697 +Income 17 27.505 1.6180 1.3012 0.197236 +Religion 4 3.780 0.9451 0.7600 0.552706 +trust.in.science_7 1 31.318 31.3185 25.1864 1.337e-06 *** +need_for_cognition 1 2.136 2.1355 1.7174 0.191852 +interpersonal.trust_1 1 0.317 0.3170 0.2550 0.614285 +complexity:chartType 2 5.389 2.6947 2.1671 0.117760 +Residuals 165 205.172 1.2435 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 @@ -2165,45 +2205,108 @@

Trust in Science Analysis Notebook

--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - Response vis.trust_2 : - Df Sum Sq Mean Sq F value Pr(>F) -complexity 2 17.052 8.5260 6.8566 0.001379 ** -chartType 1 6.256 6.2563 5.0313 0.026224 * -Age 1 4.798 4.7980 3.8585 0.051173 . -Gender 4 6.989 1.7472 1.4051 0.234509 -State_1 41 56.370 1.3749 1.1057 0.322937 -Education 8 10.046 1.2557 1.0099 0.430596 -Parents_education 2 1.789 0.8944 0.7192 0.488639 -Language 3 10.425 3.4749 2.7945 0.042012 * -Ethnicity 7 8.895 1.2708 1.0220 0.417697 -Income 17 27.505 1.6180 1.3012 0.197236 -Religion 4 3.780 0.9451 0.7600 0.552706 -trust.in.science_7 1 31.318 31.3185 25.1864 1.337e-06 *** -need_for_cognition 1 2.136 2.1355 1.7174 0.191852 -interpersonal.trust_1 1 0.317 0.3170 0.2550 0.614285 -complexity:chartType 2 5.389 2.6947 2.1671 0.117760 -Residuals 165 205.172 1.2435 + Response vis.trust_4 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 5.27 2.637 0.8651 0.4229297 +chartType 1 0.01 0.007 0.0023 0.9621805 +Age 1 0.06 0.064 0.0210 0.8848391 +Gender 4 15.86 3.966 1.3009 0.2718495 +State_1 41 140.41 3.425 1.1234 0.2998026 +Education 8 40.42 5.052 1.6572 0.1124960 +Parents_education 2 10.33 5.166 1.6946 0.1868604 +Language 3 27.32 9.107 2.9873 0.0327566 * +Ethnicity 7 73.74 10.535 3.4557 0.0017676 ** +Income 17 46.20 2.717 0.8914 0.5849737 +Religion 4 6.69 1.672 0.5484 0.7004665 +trust.in.science_7 1 39.72 39.720 13.0293 0.0004064 *** +need_for_cognition 1 3.63 3.632 1.1915 0.2766202 +interpersonal.trust_1 1 9.99 9.985 3.2754 0.0721437 . +complexity:chartType 2 9.94 4.972 1.6308 0.1989062 +Residuals 165 503.01 3.049 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - Response vis.trust_1 : - Df Sum Sq Mean Sq F value Pr(>F) -complexity 2 0.123 0.061 0.0385 0.962247 -chartType 1 0.110 0.110 0.0691 0.792937 -Age 1 13.054 13.054 8.1859 0.004768 ** -Gender 4 2.145 0.536 0.3363 0.853234 -State_1 41 88.553 2.160 1.3544 0.094778 . -Education 8 26.082 3.260 2.0445 0.044208 * -Parents_education 2 0.821 0.411 0.2575 0.773265 -Language 3 15.545 5.182 3.2494 0.023334 * -Ethnicity 7 35.100 5.014 3.1444 0.003815 ** -Income 17 28.181 1.658 1.0395 0.418536 -Religion 4 7.784 1.946 1.2203 0.304188 -trust.in.science_7 1 59.373 59.373 37.2325 7.226e-09 *** -need_for_cognition 1 0.086 0.086 0.0538 0.816911 -interpersonal.trust_1 1 1.974 1.974 1.2377 0.267526 -complexity:chartType 2 1.934 0.967 0.6064 0.546509 -Residuals 165 263.120 1.595 + Response vis.trust_5 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 0.68 0.338 0.1127 0.8935283 +chartType 1 1.79 1.785 0.5945 0.4417753 +Age 1 0.30 0.297 0.0989 0.7536004 +Gender 4 14.82 3.705 1.2337 0.2985932 +State_1 41 112.44 2.742 0.9132 0.6232012 +Education 8 41.35 5.169 1.7211 0.0968992 . +Parents_education 2 0.84 0.419 0.1395 0.8698570 +Language 3 25.42 8.472 2.8213 0.0405880 * +Ethnicity 7 25.11 3.588 1.1947 0.3085028 +Income 17 52.35 3.080 1.0255 0.4333812 +Religion 4 17.35 4.337 1.4444 0.2216479 +trust.in.science_7 1 40.37 40.366 13.4416 0.0003315 *** +need_for_cognition 1 1.11 1.111 0.3700 0.5438341 +interpersonal.trust_1 1 2.16 2.160 0.7193 0.3975888 +complexity:chartType 2 4.18 2.091 0.6963 0.4998683 +Residuals 165 495.50 3.003 +--- +Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 + + Response affect.science_1 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 867 433.3 1.1795 0.3100207 +chartType 1 657 657.2 1.7891 0.1828730 +Age 1 571 571.1 1.5547 0.2142085 +Gender 4 1440 359.9 0.9799 0.4201180 +State_1 41 22079 538.5 1.4660 0.0491460 * +Education 8 7783 972.8 2.6484 0.0092935 ** +Parents_education 2 506 252.8 0.6881 0.5039551 +Language 3 1991 663.7 1.8067 0.1479501 +Ethnicity 7 4166 595.2 1.6203 0.1328991 +Income 17 18085 1063.9 2.8962 0.0002449 *** +Religion 4 3086 771.4 2.1000 0.0830929 . +trust.in.science_7 1 18671 18670.6 50.8274 3e-11 *** +need_for_cognition 1 1044 1044.5 2.8434 0.0936401 . +interpersonal.trust_1 1 54 54.3 0.1479 0.7010331 +complexity:chartType 2 859 429.3 1.1686 0.3133556 +Residuals 165 60610 367.3 +--- +Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 + + Response affect.clarity_1 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 9154 4576.9 7.9566 0.0005025 *** +chartType 1 64 63.7 0.1107 0.7397241 +Age 1 405 404.7 0.7036 0.4028034 +Gender 4 464 116.1 0.2019 0.9370578 +State_1 41 28622 698.1 1.2136 0.1985703 +Education 8 5261 657.6 1.1432 0.3371169 +Parents_education 2 476 238.0 0.4137 0.6618978 +Language 3 334 111.2 0.1933 0.9008451 +Ethnicity 7 2006 286.6 0.4981 0.8349429 +Income 17 16416 965.7 1.6787 0.0512308 . +Religion 4 1379 344.7 0.5992 0.6637429 +trust.in.science_7 1 2320 2320.0 4.0332 0.0462441 * +need_for_cognition 1 1749 1748.8 3.0402 0.0830871 . +interpersonal.trust_1 1 2686 2686.2 4.6697 0.0321412 * +complexity:chartType 2 1038 518.8 0.9019 0.4077963 +Residuals 165 94914 575.2 +--- +Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 + + Response affect.aesthetic_1 : + Df Sum Sq Mean Sq F value Pr(>F) +complexity 2 947 473.55 0.9522 0.38798 +chartType 1 108 108.10 0.2174 0.64166 +Age 1 1361 1361.24 2.7373 0.09993 . +Gender 4 1866 466.54 0.9381 0.44336 +State_1 41 21497 524.33 1.0544 0.39567 +Education 8 2700 337.52 0.6787 0.70983 +Parents_education 2 1094 547.13 1.1002 0.33523 +Language 3 2732 910.71 1.8313 0.14346 +Ethnicity 7 2430 347.18 0.6981 0.67358 +Income 17 7638 449.32 0.9035 0.57080 +Religion 4 979 244.76 0.4922 0.74148 +trust.in.science_7 1 173 172.91 0.3477 0.55622 +need_for_cognition 1 2331 2331.19 4.6877 0.03182 * +interpersonal.trust_1 1 80 80.40 0.1617 0.68814 +complexity:chartType 2 2868 1434.22 2.8840 0.05873 . +Residuals 165 82054 497.30 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
@@ -2211,6 +2314,77 @@

Trust in Science Analysis Notebook

+ +
model <- lm(formula = vis.trust_6 ~ complexity  + chartType + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+
+ + + +

Linear Regression Model for trust in vis as a function of

+ + + +
# can change the predictor to bar.vis
+model<- manova(cbind(vis.trust_6,
+                    affect.science_1,
+                    affect.clarity_1,
+                    affect.aesthetic_1,
+                     vis.trust_3, 
+                     vis.trust_2, 
+                     vis.trust_1) ~ complexity* chartType  + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+               data = results)
+summary(model)
+ + +
                       Df  Pillai approx F num Df den Df   Pr(>F)    
+complexity              2 0.17230   2.1547     14    320 0.009332 ** 
+chartType               1 0.06252   1.5148      7    159 0.165739    
+Age                     1 0.10609   2.6957      7    159 0.011493 *  
+Gender                  4 0.12778   0.7637     28    648 0.805797    
+State_1                41 1.50502   1.1022    287   1155 0.141854    
+Education               8 0.36181   1.1242     56   1155 0.250313    
+Parents_education       2 0.05383   0.6323     14    320 0.837761    
+Language                3 0.18707   1.5296     21    483 0.062707 .  
+Ethnicity               7 0.33632   1.1897     49   1155 0.176988    
+Income                 17 0.78991   1.2346    119   1155 0.051731 .  
+Religion                4 0.13559   0.8120     28    648 0.743401    
+trust.in.science_7      1 0.39448  14.7977      7    159 8.77e-15 ***
+need_for_cognition      1 0.10424   2.6434      7    159 0.013027 *  
+interpersonal.trust_1   1 0.05440   1.3069      7    159 0.250287    
+complexity:chartType    2 0.08642   1.0323     14    320 0.420482    
+Residuals             165                                            
+---
+Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
+ + + + + + +
model <- lm(formula = vis.trust_6 ~ complexity *chartType  + Age + Gender + State_1 + Income + Education + Parents_education + Language + Ethnicity  + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+            data = results)
+anova(model)
+
+ + + + +
# can change the predictor to bar.vis
+model<- manova(cbind(vis.trust_6, 
+                     vis.trust_5, 
+                     vis.trust_4, 
+                     vis.trust_3, 
+                     vis.trust_2, 
+                     vis.trust_1) ~ complexity  * chartType  + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
+               data = results %>%filter(isCovidData == 1))
+summary.aov(model)
+ + + + +
# post-hoc tests
 aov(vis.trust_6 ~ complexity * as.factor(isCovidData), data = results) %>% tukey_hsd()
@@ -2266,7 +2440,7 @@ 

Trust in science, need for cognition, and interpersonal trust on

Trust in Data

- +
results %>%
   ggplot(aes(x = data.trust_6, y = isCovidData, colour = as.factor(isCovidData))) +
   geom_jitter(data = results, width = 0.5) +
@@ -2277,66 +2451,26 @@ 

Trust in science, need for cognition, and interpersonal trust on data.trust_6 = mean(data.trust_6)), aes(xintercept = data.trust_6, colour = as.factor(isCovidData))) + facet_grid(rows = vars(complexity), cols = vars(chartType)) + - theme_minimal()

- - -
`summarise()` has grouped output by 'complexity', 'isCovidData'. You can override using the `.groups` argument.
- - -

- - -
results %>% 
+  theme_minimal()
+
+results %>% 
   group_by(complexity, isCovidData) %>%
   summarize(n = n(), 
             mean = mean(data.trust_6),
             se = sd(data.trust_6)/sqrt(n),
             n = n)
- -
`summarise()` has grouped output by 'complexity'. You can override using the `.groups` argument.
- - -
- -
- - +
model <- lm(formula = data.trust_6 ~ complexity * chartType
                                     + Age + Gender + State_1 + Education + Parents_education + Language + Ethnicity + Income + Religion + trust.in.science_7 + need_for_cognition + interpersonal.trust_1 ,
             data = results)
-anova(model)
+anova(model) +

- -
Analysis of Variance Table
-
-Response: data.trust_6
-                       Df  Sum Sq Mean Sq F value    Pr(>F)    
-complexity              2   8.874   4.437  2.8811   0.05890 .  
-chartType               1   3.193   3.193  2.0733   0.15179    
-Age                     1   7.814   7.814  5.0739   0.02561 *  
-Gender                  4   4.671   1.168  0.7582   0.55391    
-State_1                41  93.917   2.291  1.4873   0.04309 *  
-Education               8  55.865   6.983  4.5341 5.278e-05 ***
-Parents_education       2   3.338   1.669  1.0837   0.34074    
-Language                3  14.400   4.800  3.1167   0.02771 *  
-Ethnicity               7  11.026   1.575  1.0227   0.41715    
-Income                 17  34.871   2.051  1.3318   0.17857    
-Religion                4   9.148   2.287  1.4850   0.20902    
-trust.in.science_7      1 127.657 127.657 82.8867 2.766e-16 ***
-need_for_cognition      1   0.963   0.963  0.6251   0.43029    
-interpersonal.trust_1   1   0.019   0.019  0.0123   0.91185    
-complexity:chartType    2   2.672   1.336  0.8674   0.42194    
-Residuals             165 254.123   1.540                      
----
-Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.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laWdodCA9IDAuMiwgY29sb3IgPSAibGlnaHQgZ3JheSIsIGFscGhhID0gMC41KSArCiAgI3N0YXRfc3VtbWFyeShmdW4uZGF0YT1NaW5NZWFuU0VNTWF4LCBnZW9tPSJib3hwbG90IiwgY29sb3VyPSJyZWQiKSArCgogIGdlb21fYm94cGxvdChsd2QgPSAxLCBmYXR0ZW4gPSBOVUxMLCB3aWR0aCA9IDAuMjUsIGFscGhhID0gMC41KSArCgogIGdlb21fc2VnbWVudChkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBpc0NvdmlkRGF0YSkgJT4lCiAgICAgICAgICAgICAgICBzdW1tYXJpemUobiA9IG4oKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYW4gPSBtZWFuKHZpcy50cnVzdF82KSwKICAgICAgICAgICAgc2UgPSBzZCh2aXMudHJ1c3RfNikvc3FydChuKSksIAogICAgICAgICAgICAgIGFlcyh4ID0gbWVhbiwgeGVuZCA9IG1lYW4sIHkgPSAtLjI1LCB5ZW5kID0gLjI1LCAgY29sb3VyID0gYXMuZmFjdG9yKGlzQ292aWREYXRhKSksIHNpemUgPSAxKSArCiAgICAgICAgIyBzdGF0X3N1bW1hcnkoZnVuLmRhdGEgPSAibWVhbl9jbF9ib290IiwgY29sb3VyID0gInJlZCIsIHNpemUgPSAwLjUsIHBvc2l0aW9uID0gcG9zaXRpb25fbnVkZ2UoeD0wLjI1LCB5PTApLCBhbHBoYT0wLjUpICsKCiAgZ2VvbV90ZXh0KCBkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBpc0NvdmlkRGF0YSkgJT4lCiAgICAgICAgICAgICAgICBzdW1tYXJpemUobiA9IG4oKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYW4gPSByb3VuZChtZWFuKHZpcy50cnVzdF82KSxkaWdpdHM9MiksCiAgICA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biIpLCBzaXplID0gMSkgKwoKICAKICBnZW9tX3RleHQoIGRhdGEgPSByZXN1bHRzICU+JSAKICAgICAgICAgICAgICAgIGdyb3VwX2J5KGNvbXBsZXhpdHkpICU+JQogICAgICAgICAgICAgICAgc3VtbWFyaXplKG4gPSBuKCksIAogICAgICAgICAgICAgICAgICAgICAgICAgICBtZWFuID0gcm91bmQobWVhbihkYXRhLnRydXN0XzYpLGRpZ2l0cz0yKSwKICAgICAgICAgICAgc2UgPSByb3VuZChzZChkYXRhLnRydXN0XzYpL3NxcnQobiksZGlnaXRzPTIpLAogICAgICAgICAgICAgICAgICAgICAgICAgIGRhZHRhLnRydXN0XzYgPSBtZWFuKGRhdGEudHJ1c3RfNikpLAogICAgICAgICAgICAjIGFlcyhsYWJlbCA9IHBhc3RlKG1lYW4sICJbIixtZWFuLXNlLCIsIixtZWFuK3NlLCJdIiksIHggPSA2LjIsIHkgPSAwLjQzLCBmb250ZmFjZSA9IDMpLCBzaXplPTMsIGNvbG91ciA9ICJibGFjayIpKwogICAgICAgICAgICAgIGFlcyhsYWJlbCA9IHBhc3RlKG1lYW4pLCB4ID0gbWVhbiwgeSA9IC4zNSwgZm9udGZhY2UgPSAzKSwgc2l6ZT00LCBjb2xvdXIgPSAiYmxhY2siKSsKICAKCiAgCiAgZmFjZXRfZ3JpZChyb3dzID0gdmFycyhjb21wbGV4aXR5KSkgKwogIHhsYWIoIlRydXN0IGluIERhdGEiKSArCiAgdGhlbWVfbWluaW1hbCgpICsgCiAgdGhlbWUocGFuZWwuc3BhY2luZyA9IHVuaXQoMiwgImxpbmVzIiksCiAgICAgICAgbGVnZW5kLnBvc2l0aW9uID0gIm5vbmUiLAogICAgICAgIGF4aXMudGV4dC55ID0gZWxlbWVudF9ibGFuaygpLAogICAgICAgIGF4aXMudGl0bGUueSA9IGVsZW1lbnRfYmxhbmsoKSwKICAgICAgICBheGlzLnRpY2tzLnkgPSBlbGVtZW50X2JsYW5rKCkpCgpnZ3NhdmUocGFzd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yh0aXRsZSA9ICJSZWxhdGlvbnNoaXAgYmV3dGVlbiB0cnVzdCBpbiBWaXMgYW5kIERhdGEiKSArIAogIGZhY2V0X2dyaWQocm93cyA9IHZhcnMoY2hhcnRUeXBlKSwgY29scyA9IHZhcnMoY29tcGxleGl0eSkpICsKICB0aGVtZV9taW5pbWFsKCkKYGBgCgoKCiMgRG8gdGhlIHRydXN0IGl0ZW1zIHByZWRpY3QgdHJ1c3Q/CgoKYGBge3J9Cm1vZGVsIDwtIGxtKGZvcm11bGEgPSB2aXMudHJ1c3RfNiB+IHZpcy50cnVzdF8xICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzIgKyAKICAgICAgICAgICAgICB2aXMudHJ1c3RfMyArIAogICAgICAgICAgICAgIHZpcy50cnVzdF80ICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzUgKyAKICAgICAgICAgICAgICBhZmZlY3Quc2NpZW5jZV8xICsKICAgICAgICAgICAgICBhZmZlY3QuY2xhcml0eV8xICsgCiAgICAgICAgICAgICAgYWZmZWN0LmFlc3RoZXRpY18xICsKICAgICAgICAgICAgICBBZ2UgKyBHZW5kZXIgKyBTdGF0ZV8xICsgRWR1Y2F0aW9uICsgUGFyZW50c19lZHVjYXRpb24gKyBMYW5ndWFnZSArIAogICAgICAgICAgICAgIEV0aG5pY2l0eSArIEluY29tZSArIFJlbGlnaW9uICsgdHJ1c3QuaW4uc2NpZW5jZV83ICsgCiAgICAgICAgICAgICAgbmVlZF9mb3JfY29nbml0aW9uICsgaW50ZXJwZXJzb25hbC50cnVzdF8xLAogICAgICAgICAgICBkYXRhID0gcmVzdWx0cykKc3VtbWFyeShtb2RlbCkKYGBgCgoKYGBge3J9Cm1vZGVsIDwtIGxtKGZvcm11bGEgPSBkYXRhLnRydXN0XzYgfiBkYXRhLnRydXN0XzEgKyAKICAgICAgICAgICAgICBkYXRhLnRydXN0XzIgKyAKICAgICAgICAgICAgICBkYXRhLnRydXN0XzMgKyAKICAgICAgICAgICAgICBkYXRhLnRydXN0XzQgKyAKICAgICAgICAgICAgICBkYXRhLnRydXN0XzUgKwogICAgICAgICAgICAgIEFnZSArIEdlbmRlciArIFN0YXRlXzEgKyBFZHVjYXRpb24gKyBQYXJlbnRzX2VkdWNhdGlvbiArIExhbmd1YWdlICsgCiAgICAgICAgICAgICAgRXRobmljaXR5ICsgSW5jb21lICsgUmVsaWdpb24gKyB0cnVzdC5pbi5zY2llbmNlXzcgKyAKICAgICAgICAgICAgICBuZWVkX2Zvcl9jb2duaXRpb24gKyBpbnRlcnBlcnNvbmFsLnRydXN0XzEsCiAgICAgICAgICAgIGRhdGEgPSByZXN1bHRzKQpzdW1tYXJ5KG1vZGVsKQpgYGAKCiMgV2hpY2ggdHJ1c3QgbWVhc3VyZW1lbnRzIHByZWRpY3QgYmVoYXZpb3JhbCBvdXRjb21lcz8KCmBgYHtyfQptb2RlbCA8LSBsbShmb3JtdWxhID0gdmlzLnRydXN0XzQgfiB2aXMudHJ1c3RfMSArIAogICAgICAgICAgICAgIHZpcy50cnVzdF8yICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzMgKwogICAgICAgICAgICAgIHZpcy50cnVzdF82ICsKICAgICAgICAgICAgICBhZmZlY3Quc2NpZW5jZV8xICsKICAgICAgICAgICAgICBhZmZlY3QuY2xhcml0eV8xICsgCiAgICAgICAgICAgICAgYWZmZWN0LmFlc3RoZXRpY18xICsKICAgICAgICAgICAgICBBZ2UgKyBHZW5kZXIgKyBTdGF0ZV8xICsgRWR1Y2F0aW9uICsgUGFyZW50c19lZHVjYXRpb24gKyBMYW5ndWFnZSArIAogICAgICAgICAgICAgIEV0aG5pY2l0eSArIEluY29tZSArIFJlbGlnaW9uICsgdHJ1c3QuaW4uc2NpZW5jZV83ICsgCiAgICAgICAgICAgICAgbmVlZF9mb3JfY29nbml0aW9uICsgaW50ZXJwZXJzb25hbC50cnVzdF8xLAogICAgICAgICAgICBkYXRhID0gcmVzdWx0cykKc3VtbWFyeShtb2RlbC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QgPSAxLCBmYXR0ZW4gPSBOVUxMLCB3aWR0aCA9IDAuMjUsIGFscGhhID0gMC41KSArCgogIGdlb21fc2VnbWVudChkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBpc0NvdmlkRGF0YSkgJT4lCiAgICAgICAgICAgICAgICBzdW1tYXJpemUobiA9IG4oKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYW4gPSBtZWFuKHZpcy50cnVzdF82KSwKICAgICAgICAgICAgc2UgPSBzZCh2aXMudHJ1c3RfNikvc3FydChuKSksIAogICAgICAgICAgICAgIGFlcyh4ID0gbWVhbiwgeGVuZCA9IG1lYW4sIHkgPSAtLjI1LCB5ZW5kID0gLjI1LCAgY29sb3VyID0gYXMuZmFjdG9yKGlzQ292aWREYXRhKSksIHNpemUgPSAxKSArCiAgICAgICAgIyBzdGF0X3N1bW1hcnkoZnVuLmRhdGEgPSAibWVhbl9jbF9ib290IiwgY29sb3VyID0gInJlZCIsIHNpemUgPSAwLjUsIHBvc2l0aW9uID0gcG9zaXRpb25fbnVkZ2UoeD0wLjI1LCB5PTApLCBhbHBoYT0wLjUpICsKCiAgZ2VvbV90ZXh0KCBkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5LCBpc0NvdmlkRGF0YSkgJT4lCiAgICAgICAgICAgICAgICBzdW1tYXJpemUobiA9IG4oKSwgCiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYW4gPSByb3VuZChtZWFuKHZpcy50cnVzdF82KSxkaWdpdHM9MiksCiAgICAgICAgICAgIHNlID0gcm91bmQoc2QoZGF0YS50cnVzdF82KS9zcXJ0KG4pLGRpZ2l0cz0yKSwKICAgICAgICAgICAgICAgICAgICAgICAgICB2aXMudHJ1c3RfNiA9IG1lYW4odmlzLnRydXN0XzYpKSwKICAgICAgICAgICAgIyBhZXMobGFiZWwgPSBwYX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ICAgICAgICAgICAgICAgICBsYWJlbHMgPSBjKCJDcm9wIERhdGEiLCAiQ292aWQgRGF0YSIpKQoKcmVzdWx0cyAlPiUKICBnZ3Bsb3QoYWVzKHggPSBkYXRhLnRydXN0XzYsIHkgPSAwKSkgKwogICMgc2NhbGVfY29sb3JfbWFudWFsKHZhbHVlcyA9IGMoInB1cnBsZSIsICJvcmFuZ2UiKSkgKwogIHlsaW0oLTAuNSwgMC41KSArCiAgZ2VvbV9qaXR0ZXIoZGF0YSA9IHJlc3VsdHMsIHdpZHRoID0gMC4yNSwgaGVpZ2h0ID0gMC4yLCBjb2xvciA9ICJsaWdodCBncmF5IiwgYWxwaGEgPSAwLjUpICsKICBnZW9tX2JveHBsb3QobHdkID0gMSwgZmF0dGVuID0gTlVMTCwgd2lkdGggPSAwLjI1LCBhbHBoYSA9IDAuNSwgY29sb3IgPSAic2FsbW9uIikgKwogICMgbGFicyh0aXRsZSA9ICJUcnVzdCBpbiBkYXRhIikgKyAKCiAgCiAgIGdlb21fc2VnbWVudChkYXRhID0gcmVzdWx0cyAlPiUgCiAgICAgICAgICAgICAgICBncm91cF9ieShjb21wbGV4aXR5KSAlPiUKICAgICAgICAgICAgICAgIHN1bW1hcml6ZShuID0gbigpLCAKICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVhbiA9IG1lYW4oZGF0YS50cnVzdF82KSwKICAgICAgICAgICAgc2UgPSBzZChkYXRhLnRydXN0XzYpL3NxcnQobikpLCAKICAgICAgICAgICAgICBhZXMoeCA9IG1lYW4sIHhlbmQgPSBtZWFuLCB5ID0gLS4yNSwgeWVuZCA9IC4yNSwgIGNvbG91ciA9InNhbG1vbiIpLCBzaXplID0gMSkgKwoKICAKICBnZW9tX3RleHQoIGRhdGEgPSByZXN1bHRzICU+JSAKICAgICAgICAgICAgICAgIGdyb3VwX2J5KGNvbXBsZXhpdHkpICU+JQogICAgICAgICAgICAgICAgc3VtbWFyaXplKG4gPSBuKCksIAogICAgICAgICAgICAgICAgICA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W4gVmlzIGFuZCBEYXRhIikgKyAKICBmYWNldF9ncmlkKHJvd3MgPSB2YXJzKGNoYXJ0VHlwZSksIGNvbHMgPSB2YXJzKGNvbXBsZXhpdHkpKSArCiAgdGhlbWVfbWluaW1hbCgpCmBgYAoKCgojIERvIHRoZSB0cnVzdCBpdGVtcyBwcmVkaWN0IHRydXN0PwoKCmBgYHtyfQptb2RlbCA8LSBsbShmb3JtdWxhID0gdmlzLnRydXN0XzYgfiB2aXMudHJ1c3RfMSArIAogICAgICAgICAgICAgIHZpcy50cnVzdF8yICsgCiAgICAgICAgICAgICAgdmlzLnRydXN0XzMgKyAKICAgICAgICAgICAgICB2aXMudHJ1c3RfNCArIAogICAgICAgICAgICAgIHZpcy50cnVzdF81ICsgCiAgICAgICAgICAgICAgYWZmZWN0LnNjaWVuY2VfMSArCiAgICAgICAgICAgICAgYWZmZWN0LmNsYXJpdHlfMSArIAogICAgICAgICAgICAgIGFmZmVjdC5hZXN0aGV0aWNfMSArCiAgICAgICAgICAgICAgQWdlICsgR2VuZGVyICsgU3RhdGVfMSArIEVkdWNhdGlvbiArIFBhcmVudHNfZWR1Y2F0aW9uICsgTGFuZ3VhZ2UgKyAKICAgICAgICAgICAgICBFdGhuaWNpdHkgKyBJbmNvbWUgKyBSZWxpZ2lvbiArIHRydXN0LmluLnNjaWVuY2VfNyArIAogICAgICAgICAgICAgIG5lZWRfZm9yX2NvZ25pdGlvbiArIGludGVycGVyc29uYWwudHJ1c3RfMSwKICAgICAgICAgICAgZGF0YSA9IHJlc3VsdHMpCnN1bW1hcnkobW9kZWwpCmBgYAoKCmBgYHtyfQptb2RlbCA8LSBsbShmb3JtdWxhID0gZGF0YS50cnVzdF82IH4gZGF0YS50cnVzdF8xICsgCiAgICAgICAgICAgICAgZGF0YS50cnVzdF8yICsgCiAgICAgICAgICAgICAgZGF0YS50cnVzdF8zICsgCiAgICAgICAgICAgICAgZGF0YS50cnVzdF80ICsgCiAgICAgICAgICAgICAgZGF0YS50cnVzdF81ICsKICAgICAgICAgICAgICBBZ2UgKyBHZW5kZXIgKyBTdGF0ZV8xICsgRWR1Y2F0aW9uICsgUGFyZW50c19lZHVjYXRpb24gKyBMYW5ndWFnZSArIAogICAgICAgICAgICAgIEV0aG5pY2l0eSArIEluY29tZSArIFJlbGlnaW9uICsgdHJ1c3QuaW4uc2NpZW5jZV83ICsgCiAgICAgICAgICAgICAgbmVlZF9mb3JfY29nbml0aW9uICsgaW50ZXJwZXJzb25hbC50cnVzdF8xLAogICAgICAgICAgICBkYXRhID0gcmVzdWx0cykKc3VtbWFyeShtb2RlbCkKYGBgCgojIFdoaWNoIHRydXN0IG1lYXN1cmVtZW50cyBwcmVkaWN0IGJlaGF2aW9yYWwgb3V0Y29tZXM/CgpgYGB7cn0KbW9kZWwgPC0gbG0oZm9ybXVsYSA9IHZpcy50cnVzdF80IH4gdmlzLnRydXN0XzEgKyAKICAgICAgICAgICAgICB2aXMudHJ1c3RfMiArIAogICAgICAgICAgICAgIHZpcy50cnVzdF8zICsKICAgICAgICAgICAgICB2aXMudHJ1c3RfNiArCiAgICAgICAgICAgICAgYWZmZWN0LnNjaWVuY2VfMSArCiAgICAgICAgICAgICAgYWZmZWN0LmNsYXJpdHlfMSArIAogICAgICAgICAgICAgIGFmZmVjdC5hZXN0aGV0aWNfMSArCiAgICAgICAgICAgICAgQWdlICsgR2VuZGVyICsgU3RhdGVfMSArIEVkdWNhdGlvbiArIFBhcmVudHNfZWR1Y2F0aW9uICsgTGFuZ3VhZ2UgKyAKICAgICAgICAgICAgICBFdGhuaWNpdHkgKyBJbmNvbWUgKyBSZWxpZ2lvbiArIHRydXN0LmluLnNjaWVuY2VfNyArIAogICAgICAgICAgICAgIG5lZWRfZm9yX2NvZ25pdGlvbiArIGludGVycGVyc29uYWwudHJ1c3RfMSwKICAgICAgICAgICAgZGF0YSA9IHJlc3VsdHMpCnN1bW1hcnkobW9kZWwpCmBgYAoKYGBge3J9Cm1vZGVsIDwtIGxtKGZvcm11bGE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jb21wbGV4aXR5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgQWdlICsgR2VuZGVyICsgU3RhdGVfMSArIEVkdWNhdGlvbiArIFBhcmVudHNfZWR1Y2F0aW9uICsgTGFuZ3VhZ2UgKyBFdGhuaWNpdHkgKyBJbmNvbWUgKyBSZWxpZ2lvbiArIHRydXN0LmluLnNjaWVuY2VfNyArIG5lZWRfZm9yX2NvZ25pdGlvbiArIGludGVycGVyc29uYWwudHJ1c3RfMSAsCiAgICAgICAgICAgIGRhdGEgPSByZXN1bHRzKQphbm92YShtb2RlbCkKYGBgCgpgYGB7cn0KbW9kZWwgPC0gbG0oZm9ybXVsYSA9IGRhdGEudHJ1c3RfMyB+IGNvbXBsZXhpdHkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBBZ2UgKyBHZW5kZXIgKyBTdGF0ZV8xICsgRWR1Y2F0aW9uICsgUGFyZW50c19lZHVjYXRpb24gKyBMYW5ndWFnZSArIEV0aG5pY2l0eSArIEluY29tZSArIFJlbGlnaW9uICsgdHJ1c3QuaW4uc2NpZW5jZV83ICsgbmVlZF9mb3JfY29nbml0aW9uICsgaW50ZXJwZXJzb25hbC50cnVzdF8xICwKICAgICAgICAgICAgZGF0YSA9IHJlc3VsdHMpCmFub3ZhKG1vZGVsKQpgYGAKCmBgYHtyfQptb2RlbCA8LSBsbShmb3JtdWxhID0gZGF0YS50cnVzdF80IH4gY29tcGxleGl0eQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEFnZSArIEdlbmRlciArIFN0YXRlXzEgKyBFZHVjYXRpb24gKyBQYXJlbnRzX2VkdWNhdGlvbiArIExhbmd1YWdlICsgRXRobmljaXR5ICsgSW5jb21lICsgUmVsaWdpb24gKyB0cnVzdC5pbi5zY2llbmNlXzcgKyBuZWVkX2Zvcl9jb2duaXRpb24gKyBpbnRlcnBlcnNvbmFsLnRydXN0XzEgLAogICAgICAgICAgICBkYXRhID0gcm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