-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.Rhistory
More file actions
512 lines (512 loc) · 19.7 KB
/
.Rhistory
File metadata and controls
512 lines (512 loc) · 19.7 KB
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
theme_classic() +
labs(x = "", y = "Mean \nEmotionality \nDifference", color = "Assignment") +
theme(axis.title.y = element_text(angle=0))
###statistics
emo_join <- left_join(emo_differences, emo_differences_soft, by = "n")
emo_join[, compare := 0]
emo_join[diff.x < diff.y , compare := 1]
emo_join[, .(mean = mean(compare))]
emo_join[, .(mean = mean(compare)), by = .(n)] #what percentage of simulated runs is the random below the software
load("effect sizes + circular logic.RData")
mem_plot
View(mem_plot)
rm(list = ls()) # clear environment
library(lme4)
library(lmerTest)
library(tidyverse)
library(data.table) # used extensively for data cleaning and analysis
library(dtplyr)
library(effsize)
library(pwr)
library(Rmisc)
library(car)
library(esquisse)
library(ggpubr)
retrieval = read.csv("clean_scripts/Extra_retrieval.csv")
retrieval <- as.data.table(retrieval)
retrieval[, HR := mean(correct), by = participant] # hit rate by participant
retrieval[, avg_mem := correct - HR, by = participant] # participant-corrected hit rate
random = retrieval[condition == "random"]
software = retrieval[condition == "software"]
# useful for grabbing specific number of stimuli later
tmp_software <- separate(data = software,
col = stimulus, sep = 1,
into = c("letter", "number"))
tmp_software <- separate(data = tmp_software,
col = number, sep = ".jpg",
into = c("number", "jpg"))
# get avg correct/accuracy rates by participant
all_HR <- retrieval[,.(mean = mean(correct)),
by = .(condition, participant, old_object_condition)]
# RANDOM condition 3 vs 1 exposures (paired Cohen's D)
all_cohensd_random_HR = cohen.d(
all_HR[condition == "random" & old_object_condition == 3]$mean,
all_HR[condition == "random" & old_object_condition == 1]$mean,
paired = T) # 0.94
# SOFTWARE condition 3 vs 1 exposures (paired Cohen's D)
all_cohensd_software_HR = cohen.d(
all_HR[condition == "software" & old_object_condition == 3]$mean,
all_HR[condition == "software" & old_object_condition == 1]$mean,
paired = T) # 0.86
# compare 1 vs 3 exposures
all_ANOVA = aov(correct ~ condition * old_object_condition,
data = retrieval[old_object_condition %in% c(1,3)])
# different ways of examining output
summary(all_ANOVA)
model.tables(all_ANOVA, type = "means", se = T)
TukeyHSD(all_ANOVA, which = "old_object_condition")
# the stimuli-per-group you're interested in looking at
n_stim_list = seq(1,80,1)
# create a table to populate; for both random and software
plot_ef <- data.frame(matrix(ncol = 5,
nrow = length(n_stim_list)*2))
colnames(plot_ef) <- c("stimpergroup","mean","group","CI_upper","CI_lower")
plot_ef$stimpergroup <- rep(n_stim_list, each=2)
plot_ef$group <- rep(c("Random","Software"))
load("plot_ef.RData") # pre-simulated results
load("clean_scripts/plot_ef.RData") # pre-simulated results
ef_graph <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_line() +
ylab("effect size") +
geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7)
ef_graph
plot_ef = read.csv("plotef_full.csv")
plot_ef = read.csv("clean_scripts/plotef_full.csv")
ef_graph <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_line() +
ylab("effect size") +
geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7)
ef_graph
# Calculate average % increase in effect size across the numbers we have
# NOTE: 1 and 2 aren't working since uneven numbers of images for 1 and 2
mean((plot_ef[plot_ef$stimpergroup > 2 & plot_ef$group == "Software", "mean"] - plot_ef[plot_ef$stimpergroup > 2 & plot_ef$group == "Random", "mean"] ) * 100) # 52.5883
?geom_smooth
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(method="loess") +
ylab("effect size") +
geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x)) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(method = "log", formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
# range of effect sizes
d <- seq(.1,2.1,.01)
nd <- length(d)
# power values
p <- seq(.4,.9,.1)
np <- length(p)
# obtain sample sizes
samsize <- array(numeric(nn*np), dim=c(nd,np))
for (i in 1:np){
for (j in 1:nd){
result <- pwr.t.test(n = NULL, d = d[j],
sig.level = .05, power = p[i],
type = "paired")
samsize[j,i] <- ceiling(result$n)
}
}
# set up graph
xrange <- range(d)
yrange <- round(range(samsize))
colors <- rainbow(length(p))
plot(xrange, yrange, type="n",
xlab="Effect Size (d)",
ylab="Sample Size (n)" )
# add power curves
for (i in 1:np){
lines(d, samsize[,i], type="l", lwd=2, col=colors[i])
}
abline(h=0, v=plot_ef[group == "Software" & stimpergroup ==80]$mean, lty=3, col="#674AEE")
abline(h=0, v=plot_ef[group == "Random" & stimpergroup ==80]$mean, lty=3, col="#6AA84F")
# range of effect sizes
d <- seq(.1,2.1,.01)
nd <- length(d)
# power values
p <- seq(.4,.9,.1)
np <- length(p)
library(pwr)
# obtain sample sizes
samsize <- array(numeric(nn*np), dim=c(nd,np))
for (i in 1:np){
for (j in 1:nd){
result <- pwr.t.test(n = NULL, d = d[j],
sig.level = .05, power = p[i],
type = "paired")
samsize[j,i] <- ceiling(result$n)
}
}
# obtain sample sizes
samsize <- array(numeric(nd*np), dim=c(nd,np))
for (i in 1:np){
for (j in 1:nd){
result <- pwr.t.test(n = NULL, d = d[j],
sig.level = .05, power = p[i],
type = "paired")
samsize[j,i] <- ceiling(result$n)
}
}
# set up graph
xrange <- range(d)
yrange <- round(range(samsize))
colors <- rainbow(length(p))
plot(xrange, yrange, type="n",
xlab="Effect Size (d)",
ylab="Sample Size (n)" )
# add power curves
for (i in 1:np){
lines(d, samsize[,i], type="l", lwd=2, col=colors[i])
}
abline(h=0, v=plot_ef[group == "Software" & stimpergroup ==80]$mean, lty=3, col="#674AEE")
abline(h=0, v=plot_ef[group == "Random" & stimpergroup ==80]$mean, lty=3, col="#6AA84F")
View(plot_ef)
plot_ef[group == "Software" & stimpergroup ==80]
library(data.table) # used extensively for data cleaning and analysis
abline(h=0, v=plot_ef[group == "Software" & stimpergroup ==80]$mean, lty=3, col="#674AEE")
plot_ef as.data.table(plot_ef)
plot_ef = as.data.table(plot_ef)
abline(h=0, v=plot_ef[group == "Software" & stimpergroup ==80]$mean, lty=3, col="#674AEE")
abline(h=0, v=plot_ef[group == "Random" & stimpergroup ==80]$mean, lty=3, col="#6AA84F")
abline(h=0, v=plot_ef[group == "Software" & stimpergroup ==80]$mean, lty=5, col="#674AEE")
abline(h=0, v=plot_ef[group == "Random" & stimpergroup ==80]$mean, lty=5, col="#6AA84F")
effsize_plotpower = plot(xrange, yrange, type="n",
xlab="Effect Size (d)",
ylab="Sample Size (n)" )
# add power curves
for (i in 1:np){
p + lines(d, samsize[,i], type="l", lwd=2, col=colors[i])
}
p
plot(xrange, yrange, type="n",
xlab="Effect Size (d)",
ylab="Sample Size (n)" )
# add power curves
for (i in 1:np){
lines(d, samsize[,i], type="l", lwd=2, col=colors[i])
}
abline(h=0, v=plot_ef[group == "Software" & stimpergroup ==80]$mean, lty=5, col="#674AEE")
abline(h=0, v=plot_ef[group == "Random" & stimpergroup ==80]$mean, lty=5, col="#6AA84F")
?theme
theme_minimal()
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
)
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
) +
scale_color_manual(colors = c("#6AA84F", "#674AEE"))
ef_graph1
?colors
scale_color_manual
?scale_color_manual
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
) +
scale_color_manual(values = c("#6AA84F", "#674AEE"))
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
) +
scale_color_manual(values = c("#6AA84F", "#674AEE")) +
scale_fill_manual(values = c("#6AA84F", "#674AEE"))
ef_graph1
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group, fill=group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
) +
scale_color_manual(values = c("#6AA84F", "#674AEE")) +
scale_fill_manual(values = c("#6AA84F", "#674AEE"))
ef_graph1
Effect_Sizes <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group)) +
geom_line() +
geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7, color = "black") +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
theme_classic() +
labs(x = "Number of Stimuli Per Group", y = "Effect Size", color = "Group")
Effect_Sizes
ef_graph1 <- ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group, fill=group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
) +
scale_color_manual(values = c("#6AA84F", "#674AEE")) +
scale_fill_manual(values = c("#6AA84F", "#674AEE"))
ggplot(plot_ef, aes(x = stimpergroup, y = mean, color = group, fill=group)) +
geom_smooth(formula = y ~ log(x), stat="smooth", se=T) +
ylab("effect size") +
# geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7) +
theme(
panel.background = element_rect(fill="transparent"),
plot.background = element_rect(fill="transparent", color = NA),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.background = element_rect(fill="transparent"),
legend.box.background = element_rect(fill = "transparent")
) +
scale_color_manual(values = c("#6AA84F", "#674AEE")) +
scale_fill_manual(values = c("#6AA84F", "#674AEE"))
shoe_plot <- combined_shoe %>%
filter(humanmade_response %in% c("human-made", "natural") | is.na(humanmade_response)) %>%
filter(outdoors_response %in% c("outdoors", "indoors") | is.na(outdoors_response)) %>%
ggplot() +
aes(x = agreement, fill = group, colour = group) +
geom_density(adjust = 0.4, alpha = .4) +
scale_fill_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
labs(x = "Shoebox Score Agreement", y = "Frequency", fill = "Assignment", color = "Assignment") +
theme_classic()
retrieval_full <- read.csv("clean_extra_retrieval_full.csv") # currently in the cleaned folder
retrieval_full <- read.csv("clean_scripts/extra_retrieval_full.csv") # currently in the cleaned folder
app_values_soft = read.csv("experiment_stimuli/summary.csv")
load("effect sizes + circular logic.RData")
soft_diff_fun
emo_plot
emo_differences$group = "Random"
setDT(emo_differences)
emo_differences_group = emo_differences[, .(diff = mean(diff), CI_upper = CI(diff)[[1]], CI_lower= CI(diff)[[3]]), by = .(n, group)]
emo_differences_soft$group = "Software"
plot_emo = rbind(emo_differences_group, emo_differences_soft, fill = TRUE)
emo_plot <- ggplot(plot_emo, aes(x = n, y = diff, color = group)) +
geom_line() +
geom_errorbar(aes(ymin=CI_lower, ymax=CI_upper), width = .7, color = "black") +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
theme_classic() +
labs(x = "", y = "Mean \nEmotionality \nDifference", color = "Assignment") +
theme(axis.title.y = element_text(angle=0))
###statistics
emo_join <- left_join(emo_differences, emo_differences_soft, by = "n")
emo_join[, compare := 0]
emo_join[diff.x < diff.y , compare := 1]
emo_join[, .(mean = mean(compare))]
emo_join[, .(mean = mean(compare)), by = .(n)] #what percentage of simulated runs is the random below the software
```
plot_emo
emo_plot
shoe_plot <- combined_shoe %>%
filter(humanmade_response %in% c("human-made", "natural") | is.na(humanmade_response)) %>%
filter(outdoors_response %in% c("outdoors", "indoors") | is.na(outdoors_response)) %>%
ggplot() +
aes(x = agreement, fill = group, colour = group) +
geom_density(adjust = 0.4, alpha = .4) +
scale_fill_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
labs(x = "Shoebox Score Agreement", y = "Frequency", fill = "Assignment", color = "Assignment") +
theme_classic()
human_plot <- combined_human %>%
ggplot() +
aes(x = agreement, fill = group, colour = group) +
geom_density(adjust = 0.4, alpha = .4) +
scale_fill_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
labs(x = "Human-made Score Agreement", y = "", fill = "Assignment", color = "Assignment") +
theme_classic()
outdoors_plot <- combined_outdoors %>%
ggplot() +
aes(x = agreement, fill = group, colour = group) +
geom_density(adjust = 0.4, alpha = .4) +
scale_fill_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
labs(x = "Indoor/Outdoor Score Agreement", y = "Frequency", fill = "Assignment", color = "Assignment") +
theme_classic()
name_plot <- combined_name_20 %>%
ggplot() +
aes(x = h_index, fill = group, colour = group) +
geom_density(adjust = 0.4, alpha = .4) +
scale_fill_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
scale_color_manual(
values = c("#F6B254","#674AEE"), labels = c("Random", "Software")
) +
labs(x = "H-Index", y = "", fill = "Assignment", color = "Assignment") +
theme_classic()
agreement <- ggarrange(shoe_plot,human_plot, outdoors_plot, name_plot, nrow = 2, ncol = 2, common.legend = TRUE, labels = c("A","B","C", "D"))
agreement
# RANDOM condition 3 vs 1 exposures (paired Cohen's D)
all_cohensd_random_HR = cohen.d(
all_HR[condition == "random" & old_object_condition == 3]$mean,
all_HR[condition == "random" & old_object_condition == 1]$mean,
paired = T) # 0.94
# SOFTWARE condition 3 vs 1 exposures (paired Cohen's D)
all_cohensd_software_HR = cohen.d(
all_HR[condition == "software" & old_object_condition == 3]$mean,
all_HR[condition == "software" & old_object_condition == 1]$mean,
paired = T) # 0.86
all_cohensd_random_HR
all_cohensd_software_HR
# compare 1 vs 3 exposures
all_ANOVA = aov(correct ~ condition * old_object_condition,
data = retrieval[old_object_condition %in% c(1,3)])
# different ways of examining output
summary(all_ANOVA)
model.tables(all_ANOVA, type = "means", se = T)
TukeyHSD(all_ANOVA, which = "old_object_condition")
plot_ef[group == "Software" & stimpergroup ==20]$mean
plot_ef[group == "Random" & stimpergroup ==20]$mean
yrange
plot(xrange, c(0,200), type="n",
xlab="Effect Size (d)",
ylab="Sample Size (n)" )
# add power curves
for (i in 1:np){
lines(d, samsize[,i], type="l", lwd=2, col=colors[i])
}
?pwr.t.test
# obtain sample sizes
samsize <- array(numeric(nd*np), dim=c(nd,np))
for (i in 1:np){
for (j in 1:nd){
result <- pwr.t.test(n = NULL, d = d[j],
sig.level = .05, power = p[i],
type = "two.sample",)
samsize[j,i] <- ceiling(result$n)
}
}
yrange <- round(range(samsize))
colors <- rainbow(length(p))
plot(xrange, c(0,200), type="n",
xlab="Effect Size (d)",
ylab="Sample Size (n)" )
# add power curves
for (i in 1:np){
lines(d, samsize[,i], type="l", lwd=2, col=colors[i])
}