-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathline_plot.R
318 lines (262 loc) · 13.5 KB
/
line_plot.R
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
library(ggpubr)
library(multcomp)
library(car)
library(FSA)
library(ggplot2)
library(phia)
library(psych)
library(likert)
library(plyr)
library(tidyr)
library(tidyverse)
library(dplyr)
data_sticker = read.csv("clean_data_gather.csv", stringsAsFactors=FALSE) [-c(1)]
data_sticker$img_val[data_sticker$img_val == "happy"] <- "ihappy"
data_sticker$img_val[data_sticker$img_val == "sad"] <- "isad"
data_sticker$sticker_val[data_sticker$sticker_val == "none"] <- "blur/opaque"
#isad_ssad_data=data_sticker[data_sticker$img_val =="isad" & data_sticker$sticker_val =="ssad",]
#ihappy_shappy_data=data_sticker[data_sticker$img_val =="ihappy" & data_sticker$sticker_val =="shappy",]
#isad_none_data=data_sticker[data_sticker$img_val =="isad" & data_sticker$sticker_val =="none",]
satisfaction_sad = mean(isad_data$satisfaction)
sufficiency_sad = mean(isad_data$sufficiency)
appealing_sad = mean(isad_data$appealing)
satisfaction_sad = mean(isad_none_data$satisfaction)
sufficiency_sad = mean(isad_none_data$sufficiency)
appealing_sad = mean(isad_none_data$appealing)
# ------------------------------ Foreground vs background -----------------
movie = data_sticker[data_sticker$scenario =="movie",]
movie$img_val[movie$img_val == "ihappy"] <- "bystander"
movie$img_val[movie$img_val == "isad"] <- "subject"
pdf(file="satisfaction_img_sticker_val.pdf")
ggline(movie, x = "img_val", y = "satisfaction", color = "sticker_val",
add = c("mean_ci"), ylab="Satisfaction", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
dev.off()
pdf(file="satisfaction_img_sticker_type.pdf")
ggline(movie, x = "sticker_type", y = "satisfaction", color = "img_val",
add = c("mean_ci"), ylab="Satisfaction", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
dev.off()
pdf(file="appealing_img_sticker_val.pdf")
ggline(movie, x = "img_val", y = "appealing", color = "sticker_val",
add = c("mean_ci"), ylab="Appealing", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
dev.off()
pdf(file="appealing_img_sticker_type.pdf")
ggline(movie, x = "sticker_type", y = "appealing", color = "img_val",
add = c("mean_ci"), ylab="Appealing", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
dev.off()
pdf(file="sufficiency_img_sticker_val.pdf")
ggline(movie, x = "img_val", y = "sufficiency", color = "sticker_val",
add = c("mean_ci"), ylab="Sufficiency", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
dev.off()
pdf(file="sufficiency_img_sticker_type.pdf")
ggline(movie, x = "sticker_type", y = "sufficiency", color = "img_val",
add = c("mean_ci"), ylab="Sufficiency", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
dev.off()
# ------------------------------ Satisfaction -----------------
ggline(data_sticker, x = "sticker_type", y = "satisfaction", color = "img_val",
add = c("mean_ci"), ylab="Satisfaction", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "img_val", y = "satisfaction", color = "sticker_val",
add = c("mean_ci"), ylab="Satisfaction", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "img_val", y = "satisfaction", color = "experiment",
add = c("mean_ci"), ylab="Satisfaction", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "sticker_val", y = "satisfaction", color = "experiment",
add = c("mean_ci"), ylab="Satisfaction", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ Sufficiency -----------------
ggline(data_sticker, x = "sticker_type", y = "sufficiency", color = "sticker_val",
add = c("mean_ci"), ylab="sufficiency", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "sticker_type", y = "sufficiency", color = "img_val",
add = c("mean_ci"), ylab="sufficiency", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "img_val", y = "sufficiency", color = "sticker_val",
add = c("mean_ci"), ylab="sufficiency", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "img_val", y = "sufficiency", color = "experiment",
add = c("mean_ci"), ylab="sufficiency", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "sticker_val", y = "sufficiency", color = "experiment",
add = c("mean_ci"), ylab="sufficiency", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ Appealing -----------------
ggline(data_sticker, x = "sticker_type", y = "appealing", color = "sticker_val",
add = c("mean_ci"), ylab="appealing", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "sticker_type", y = "appealing", color = "img_val",
add = c("mean_ci"), ylab="appealing", xlab="sticker_type"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "img_val", y = "appealing", color = "sticker_val",
add = c("mean_ci"), ylab="appealing", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "img_val", y = "appealing", color = "experiment",
add = c("mean_ci"), ylab="appealing", xlab="image_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
ggline(data_sticker, x = "sticker_val", y = "appealing", color = "experiment",
add = c("mean_ci"), ylab="appealing", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ Valence -----------------
# --------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------
data_valence = read.csv("clean_emotion_data.csv", stringsAsFactors=FALSE) [-c(1)]
data_valence_gather = read.csv("clean_emotion_data_gather.csv", stringsAsFactors=FALSE) [-c(1)]
data_valence$img_val[data_valence$img_val == "happy"] <- "ihappy"
data_valence$img_val[data_valence$img_val == "sad"] <- "isad"
data_valence$sticker_val[data_valence$sticker_val == "none"] <- "blur/opaque"
ggline(data_valence_gather, x = "emotion", y = "valence", color = "experiment",
add = c("mean_ci"), ylab="valence", xlab="emotion"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ Interaction -----------------
# --------------------------------------------------------------------------------------
# ------------------------------ Happiness -----------------
ggline(data_valence, x = "img_val", y = "happiness", color = "sticker_val",
add = c("mean_ci"), ylab="valence (hapiness)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ sadness -----------------
ggline(data_valence, x = "img_val", y = "sadness", color = "sticker_val",
add = c("mean_ci"), ylab="valence (sadness)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ amusement -----------------
ggline(data_valence, x = "img_val", y = "amusement", color = "sticker_val",
add = c("mean_ci"), ylab="valence (amusement)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ surprise -----------------
ggline(data_valence, x = "img_val", y = "surprise", color = "sticker_val",
add = c("mean_ci"), ylab="valence (surprise)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ neutral -----------------
ggline(data_valence, x = "img_val", y = "neutral", color = "sticker_val",
add = c("mean_ci"), ylab="valence (neutral)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ anger -----------------
ggline(data_valence, x = "img_val", y = "anger", color = "sticker_val",
add = c("mean_ci"), ylab="valence (anger)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ disgust -----------------
ggline(data_valence, x = "img_val", y = "disgust", color = "sticker_val",
add = c("mean_ci"), ylab="valence (disgust)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ fear -----------------
ggline(data_valence, x = "img_val", y = "fear", color = "sticker_val",
add = c("mean_ci"), ylab="valence (fear)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ Main effect sticker -----------------
# --------------------------------------------------------------------------------------
# ------------------------------ Happiness -----------------
ggline(data_valence, x = "sticker_val", y = "happiness", color = "sticker_val",
add = c("mean_ci"), ylab="valence (hapiness)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ sadness -----------------
ggline(data_valence, x = "sticker_val", y = "sadness", color = "sticker_val",
add = c("mean_ci"), ylab="valence (sadness)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ amusement -----------------
ggline(data_valence, x = "sticker_val", y = "amusement", color = "sticker_val",
add = c("mean_ci"), ylab="valence (amusement)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ surprise -----------------
ggline(data_valence, x = "sticker_val", y = "surprise", color = "sticker_val",
add = c("mean_ci"), ylab="valence (surprise)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ neutral -----------------
ggline(data_valence, x = "sticker_val", y = "neutral", color = "sticker_val",
add = c("mean_ci"), ylab="valence (neutral)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ anger -----------------
ggline(data_valence, x = "sticker_val", y = "anger", color = "sticker_val",
add = c("mean_ci"), ylab="valence (anger)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ disgust -----------------
ggline(data_valence, x = "sticker_val", y = "disgust", color = "sticker_val",
add = c("mean_ci"), ylab="valence (disgust)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ fear -----------------
ggline(data_valence, x = "sticker_val", y = "fear", color = "sticker_val",
add = c("mean_ci"), ylab="valence (fear)", xlab="sticker_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ Main effect Image valence -----------------
# --------------------------------------------------------------------------------------
# ------------------------------ Happiness -----------------
ggline(data_valence, x = "img_val", y = "happiness", color = "experiment",
add = c("mean_ci"), ylab="valence (hapiness)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ sadness -----------------
ggline(data_valence, x = "img_val", y = "sadness", color = "experiment",
add = c("mean_ci"), ylab="valence (sadness)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ amusement -----------------
ggline(data_valence, x = "img_val", y = "amusement", color = "experiment",
add = c("mean_ci"), ylab="valence (amusement)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ surprise -----------------
ggline(data_valence, x = "img_val", y = "surprise", color = "experiment",
add = c("mean_ci"), ylab="valence (surprise)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ neutral -----------------
ggline(data_valence, x = "img_val", y = "neutral", color = "experiment",
add = c("mean_ci"), ylab="valence (neutral)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ anger -----------------
ggline(data_valence, x = "img_val", y = "anger", color = "experiment",
add = c("mean_ci"), ylab="valence (anger)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ disgust -----------------
ggline(data_valence, x = "img_val", y = "disgust", color = "experiment",
add = c("mean_ci"), ylab="valence (disgust)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)
# ------------------------------ fear -----------------
ggline(data_valence, x = "img_val", y = "fear", color = "experiment",
add = c("mean_ci"), ylab="valence (fear)", xlab="img_val"
#palette = c("#FF0000", "#006400", "#0000CD", "#8B008B")
)