-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrustExprimentsff.Rmd
60 lines (50 loc) · 1.26 KB
/
trustExprimentsff.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: "Expriments for Trust"
author: "Group"
output:
pdf_document: default
html_document: default
---
```{r}
library(ggplot2)
library(ggthemr)
library(dplyr)
```
```{r}
# Load the expriment's data
dff <- read.csv("./cleaneddata/ff.csv")
head(dff)
```
```{r}
dff$Outcome <- ifelse(dff$Q7=="I do not trust what the speaker was saying.", "No Trust", ifelse(dff$Q7=="I trust what the speaker was saying.", "Trust", "NA"))
summary(dff)
```
```{r}
ggthemr('earth', type="outer", layout='scientific', spacing=2)
p2 <- ggplot(data=dff %>% filter(Outcome != "NA"), aes(x=FL_3_DO)) +
geom_bar(aes(y=FL_3_DO, fill=Outcome), stat = "identity") +
labs(title="Counts", y="Total Counts", x = "Tmt vs. Control") +
ylab("") +
theme_classic() #+ theme(legend.position = "none")
p2
```
```{r}
# Adding columns for control, treatment and clusters (M, F)
t = c("FTreatment", "MTreatment")
s = c("FTreatment", "FControl")
dff$treat = ifelse(dff$FL_3_DO %in% t, 1, 0 )
dff$female = ifelse(dff$FL_3_DO %in% s, 1, 0)
dff$trust = ifelse(dff$Q7 == "I trust what the speaker was saying.", 1,
ifelse (dff$Q6 == "Paleo", NA, 0))
```
```{r}
head(dff)
```
```{r}
summary(dff)
```
```{r}
# Regressing trust on treatment
lrff = lm(trust ~ treat, data = dff)
summary(lrff)
```