-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutil1.r
More file actions
executable file
·699 lines (624 loc) · 66.9 KB
/
util1.r
File metadata and controls
executable file
·699 lines (624 loc) · 66.9 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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
prepare_meta_vectors <- function() {
total_meta_conditions <<- length(b_bases)*length(b_sexs)*length(b_conds)*length(b_sex_conds)*n_repeats
meta_n_repeats <<- rep(n_repeats, total_meta_conditions)
meta_n_experiments_per_repeat <<- rep(n_experiments_per_repeat, total_meta_conditions)
meta_n_participants_per_experiment <<- rep(n_participants_per_experiment, total_meta_conditions)
meta_n_trials_per_participant <<- rep(n_trials_per_participant, total_meta_conditions)
meta_n_people <<- rep(n_people, total_meta_conditions)
meta_true_base <<- vector()
meta_true_sex <<- vector()
meta_true_cond <<- vector()
meta_true_sex_cond <<- vector()
pub_pp_l <<- vector()
pub_pp_l_pb_sym <<- vector()
pub_pp_l_pb_asym <<- vector()
pub_pp_c <<- vector()
pub_pp_c_pb_sym <<- vector()
pub_pp_c_pb_asym <<- vector()
meta_var_pop <<- vector()
meta_base_estimate_pp_l <<- vector()
meta_sex_estimate_pp_l <<- vector()
meta_cond_estimate_pp_l <<- vector()
meta_sex_cond_estimate_pp_l <<- vector()
meta_base_estimate_pp_l_pb_sym <<- vector()
meta_sex_estimate_pp_l_pb_sym <<- vector()
meta_cond_estimate_pp_l_pb_sym <<- vector()
meta_sex_cond_estimate_pp_l_pb_sym <<- vector()
meta_base_estimate_pp_l_pb_asym <<- vector()
meta_sex_estimate_pp_l_pb_asym <<- vector()
meta_cond_estimate_pp_l_pb_asym <<- vector()
meta_sex_cond_estimate_pp_l_pb_asym <<- vector()
meta_base_estimate_pp_c <<- vector()
meta_sex_estimate_pp_c <<- vector()
meta_cond_estimate_pp_c <<- vector()
meta_sex_cond_estimate_pp_c <<- vector()
meta_base_estimate_pp_c_pb_sym <<- vector()
meta_sex_estimate_pp_c_pb_sym <<- vector()
meta_cond_estimate_pp_c_pb_sym <<- vector()
meta_sex_cond_estimate_pp_c_pb_sym <<- vector()
meta_base_estimate_pp_c_pb_asym <<- vector()
meta_sex_estimate_pp_c_pb_asym <<- vector()
meta_cond_estimate_pp_c_pb_asym <<- vector()
meta_sex_cond_estimate_pp_c_pb_asym <<- vector()
meta_base_estimate_upper_pp_l <<- vector()
meta_sex_estimate_upper_pp_l <<- vector()
meta_cond_estimate_upper_pp_l <<- vector()
meta_sex_cond_estimate_upper_pp_l <<- vector()
meta_base_estimate_upper_pp_l_pb_sym <<- vector()
meta_sex_estimate_upper_pp_l_pb_sym <<- vector()
meta_cond_estimate_upper_pp_l_pb_sym <<- vector()
meta_sex_cond_estimate_upper_pp_l_pb_sym <<- vector()
meta_base_estimate_upper_pp_l_pb_asym <<- vector()
meta_sex_estimate_upper_pp_l_pb_asym <<- vector()
meta_cond_estimate_upper_pp_l_pb_asym <<- vector()
meta_sex_cond_estimate_upper_pp_l_pb_asym <<- vector()
meta_base_estimate_upper_pp_c <<- vector()
meta_sex_estimate_upper_pp_c <<- vector()
meta_cond_estimate_upper_pp_c <<- vector()
meta_sex_cond_estimate_upper_pp_c <<- vector()
meta_base_estimate_upper_pp_c_pb_sym <<- vector()
meta_sex_estimate_upper_pp_c_pb_sym <<- vector()
meta_cond_estimate_upper_pp_c_pb_sym <<- vector()
meta_sex_cond_estimate_upper_pp_c_pb_sym <<- vector()
meta_base_estimate_upper_pp_c_pb_asym <<- vector()
meta_sex_estimate_upper_pp_c_pb_asym <<- vector()
meta_cond_estimate_upper_pp_c_pb_asym <<- vector()
meta_sex_cond_estimate_upper_pp_c_pb_asym <<- vector()
meta_base_estimate_lower_pp_l <<- vector()
meta_sex_estimate_lower_pp_l <<- vector()
meta_cond_estimate_lower_pp_l <<- vector()
meta_sex_cond_estimate_lower_pp_l <<- vector()
meta_base_estimate_lower_pp_l_pb_sym <<- vector()
meta_sex_estimate_lower_pp_l_pb_sym <<- vector()
meta_cond_estimate_lower_pp_l_pb_sym <<- vector()
meta_sex_cond_estimate_lower_pp_l_pb_sym <<- vector()
meta_base_estimate_lower_pp_l_pb_asym <<- vector()
meta_sex_estimate_lower_pp_l_pb_asym <<- vector()
meta_cond_estimate_lower_pp_l_pb_asym <<- vector()
meta_sex_cond_estimate_lower_pp_l_pb_asym <<- vector()
meta_base_estimate_lower_pp_c <<- vector()
meta_sex_estimate_lower_pp_c <<- vector()
meta_cond_estimate_lower_pp_c <<- vector()
meta_sex_cond_estimate_lower_pp_c <<- vector()
meta_base_estimate_lower_pp_c_pb_sym <<- vector()
meta_sex_estimate_lower_pp_c_pb_sym <<- vector()
meta_cond_estimate_lower_pp_c_pb_sym <<- vector()
meta_sex_cond_estimate_lower_pp_c_pb_sym <<- vector()
meta_base_estimate_lower_pp_c_pb_asym <<- vector()
meta_sex_estimate_lower_pp_c_pb_asym <<- vector()
meta_cond_estimate_lower_pp_c_pb_asym <<- vector()
meta_sex_cond_estimate_lower_pp_c_pb_asym <<- vector()
meta_base_uncertainty_pp_l <<- vector()
meta_sex_uncertainty_pp_l <<- vector()
meta_cond_uncertainty_pp_l <<- vector()
meta_sex_cond_uncertainty_pp_l <<- vector()
meta_base_uncertainty_pp_l_pb_sym <<- vector()
meta_sex_uncertainty_pp_l_pb_sym <<- vector()
meta_cond_uncertainty_pp_l_pb_sym <<- vector()
meta_sex_cond_uncertainty_pp_l_pb_sym <<- vector()
meta_base_uncertainty_pp_l_pb_asym <<- vector()
meta_sex_uncertainty_pp_l_pb_asym <<- vector()
meta_cond_uncertainty_pp_l_pb_asym <<- vector()
meta_sex_cond_uncertainty_pp_l_pb_asym <<- vector()
meta_base_uncertainty_pp_c <<- vector()
meta_sex_uncertainty_pp_c <<- vector()
meta_cond_uncertainty_pp_c <<- vector()
meta_sex_cond_uncertainty_pp_c <<- vector()
meta_base_uncertainty_pp_c_pb_sym <<- vector()
meta_sex_uncertainty_pp_c_pb_sym <<- vector()
meta_cond_uncertainty_pp_c_pb_sym <<- vector()
meta_sex_cond_uncertainty_pp_c_pb_sym <<- vector()
meta_base_uncertainty_pp_c_pb_asym <<- vector()
meta_sex_uncertainty_pp_c_pb_asym <<- vector()
meta_cond_uncertainty_pp_c_pb_asym <<- vector()
meta_sex_cond_uncertainty_pp_c_pb_asym <<- vector()
}
prepare_data_vectors <- function() {
repeat_id <<- vector()
expt <<- vector()
analysis_type <<- vector()
true_base <<- vector()
b_base_lower <<- vector()
b_base_med <<- vector()
b_base_upper <<- vector()
b_base_error <<- vector()
true_sex <<- vector()
b_sex_p_value <<- vector()
b_sex_lower <<- vector()
b_sex_med <<- vector()
b_sex_upper <<- vector()
b_sex_error <<- vector()
true_cond <<- vector()
b_cond_p_value <<- vector()
b_cond_lower <<- vector()
b_cond_med <<- vector()
b_cond_upper <<- vector()
b_cond_error <<- vector()
true_sex_cond <<- vector()
b_sex_cond_p_value <<- vector()
b_sex_cond_lower <<- vector()
b_sex_cond_med <<- vector()
b_sex_cond_upper <<- vector()
b_sex_cond_error <<- vector()
pub_true <<- vector()
pub_method <<-vector()
pp_n <<- vector()
var_pop <<- vector()
}
save_analysis_results_1 <- function(type) {
repeat_id <<- c(repeat_id, rep(rep, n_experiments_per_repeat))
expt <<- c(expt, c(1:n_experiments_per_repeat))
true_base <<- c(true_base, rep(b_base, n_experiments_per_repeat))
true_sex <<- c(true_sex, rep(b_sex, n_experiments_per_repeat))
true_cond <<- c(true_cond, rep(b_cond, n_experiments_per_repeat))
true_sex_cond <<- c(true_sex_cond, rep(b_sex_cond, n_experiments_per_repeat))
analysis_type <<- c(analysis_type, rep(type, n_experiments_per_repeat))
var_pop <<- c(var_pop, rep(population$var_base[1], n_experiments_per_repeat))
}
save_results_meta <- function() {
print(">>>>>>>> Saving results")
# combine results into a data frame
results <- data.frame(repeat_id, expt, analysis_type,
true_base, b_base_lower, b_base_med, b_base_upper, b_base_error,
true_sex, b_sex_p_value, b_sex_lower, b_sex_med, b_sex_upper, b_sex_error,
true_cond, b_cond_p_value, b_cond_lower, b_cond_med, b_cond_upper, b_cond_error,
true_sex_cond, b_sex_cond_p_value, b_sex_cond_lower, b_sex_cond_med, b_sex_cond_upper, b_sex_cond_error,
pub_true, pub_method, pp_n,
var_pop
)
saved_results <<- results
rm(this_data_set, model,
repeat_id, expt, analysis_type,
true_base, b_base_lower, b_base_med, b_base_upper,
true_sex, b_sex_p_value, b_sex_lower, b_sex_med, b_sex_upper,
true_cond, b_cond_p_value, b_cond_lower, b_cond_med, b_cond_upper,
true_sex_cond, b_sex_cond_p_value, b_sex_cond_lower, b_sex_cond_med, b_sex_cond_upper, var_pop, pub_true, pp_n,
pos = ".GlobalEnv")
for (rep in 1:n_repeats) {
pp_l_results <- results[results$repeat_id == rep & results$analysis_type == "pp_linear",]
pp_l_pb_sym_results <- results[results$repeat_id == rep & results$analysis_type == "pp_linear_pb_sym",]
pp_l_pb_asym_results <- results[results$repeat_id == rep & results$analysis_type == "pp_linear_pb_asym",]
pp_c_results <- results[results$repeat_id == rep & results$analysis_type == "pp_citation",]
pp_c_pb_sym_results <- results[results$repeat_id == rep & results$analysis_type == "pp_citation_pb_sym",]
pp_c_pb_asym_results <- results[results$repeat_id == rep & results$analysis_type == "pp_citation_pb_asym",]
#pub_true and var_pop
pub_pp_l <<- c(pub_pp_l, sum(pp_l_results$pub_true))
pub_pp_l_pb_sym <<- c(pub_pp_l_pb_sym, sum(pp_l_pb_sym_results$pub_true))
pub_pp_l_pb_asym <<- c(pub_pp_l_pb_asym, sum(pp_l_pb_asym_results$pub_true))
pub_pp_c <<- c(pub_pp_c, sum(pp_c_results$pub_true))
pub_pp_c_pb_sym <<- c(pub_pp_c_pb_sym, sum(pp_c_pb_sym_results$pub_true))
pub_pp_c_pb_asym <<- c(pub_pp_c_pb_asym, sum(pp_c_pb_asym_results$pub_true))
meta_var_pop <<- c(meta_var_pop, pp_l_results$var_pop[1])
# estimate
if (pp_final_expt_only == FALSE) {
meta_base_estimate_pp_l <<- c(meta_base_estimate_pp_l, mean(pp_l_results$b_base_med))
meta_sex_estimate_pp_l <<- c(meta_sex_estimate_pp_l, mean(pp_l_results$b_sex_med))
meta_cond_estimate_pp_l <<- c(meta_cond_estimate_pp_l, mean(pp_l_results$b_cond_med))
meta_sex_cond_estimate_pp_l <<- c(meta_sex_cond_estimate_pp_l, mean(pp_l_results$b_sex_cond_med))
} else {
meta_base_estimate_pp_l <<- c(meta_base_estimate_pp_l, mean(pp_l_results$b_base_med[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_pp_l <<- c(meta_sex_estimate_pp_l, mean(pp_l_results$b_sex_med[pp_l_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_pp_l <<- c(meta_cond_estimate_pp_l, mean(pp_l_results$b_cond_med[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_pp_l <<- c(meta_sex_cond_estimate_pp_l, mean(pp_l_results$b_sex_cond_med[pp_l_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_pp_l_pb_sym <<- c(meta_base_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_med))
meta_sex_estimate_pp_l_pb_sym <<- c(meta_sex_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_med))
meta_cond_estimate_pp_l_pb_sym <<- c(meta_cond_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_med))
meta_sex_cond_estimate_pp_l_pb_sym <<- c(meta_sex_cond_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_med))
} else {
meta_base_estimate_pp_l_pb_sym <<- c(meta_base_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_med[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_pp_l_pb_sym <<- c(meta_sex_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_med[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_pp_l_pb_sym <<- c(meta_cond_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_med[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_pp_l_pb_sym <<- c(meta_sex_cond_estimate_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_med[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_pp_l_pb_asym <<- c(meta_base_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_med))
meta_sex_estimate_pp_l_pb_asym <<- c(meta_sex_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_med))
meta_cond_estimate_pp_l_pb_asym <<- c(meta_cond_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_med))
meta_sex_cond_estimate_pp_l_pb_asym <<- c(meta_sex_cond_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_med))
} else {
meta_base_estimate_pp_l_pb_asym <<- c(meta_base_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_med[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_pp_l_pb_asym <<- c(meta_sex_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_med[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_pp_l_pb_asym <<- c(meta_cond_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_med[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_pp_l_pb_asym <<- c(meta_sex_cond_estimate_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_med[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_pp_c <<- c(meta_base_estimate_pp_c, mean(pp_c_results$b_base_med))
meta_sex_estimate_pp_c <<- c(meta_sex_estimate_pp_c, mean(pp_c_results$b_sex_med))
meta_cond_estimate_pp_c <<- c(meta_cond_estimate_pp_c, mean(pp_c_results$b_cond_med))
meta_sex_cond_estimate_pp_c <<- c(meta_sex_cond_estimate_pp_c, mean(pp_c_results$b_sex_cond_med))
} else {
meta_base_estimate_pp_c <<- c(meta_base_estimate_pp_c, mean(pp_c_results$b_base_med[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_pp_c <<- c(meta_sex_estimate_pp_c, mean(pp_c_results$b_sex_med[pp_c_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_pp_c <<- c(meta_cond_estimate_pp_c, mean(pp_c_results$b_cond_med[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_pp_c <<- c(meta_sex_cond_estimate_pp_c, mean(pp_c_results$b_sex_cond_med[pp_c_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_pp_c_pb_sym <<- c(meta_base_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_med))
meta_sex_estimate_pp_c_pb_sym <<- c(meta_sex_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_med))
meta_cond_estimate_pp_c_pb_sym <<- c(meta_cond_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_med))
meta_sex_cond_estimate_pp_c_pb_sym <<- c(meta_sex_cond_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_med))
} else {
meta_base_estimate_pp_c_pb_sym <<- c(meta_base_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_med[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_pp_c_pb_sym <<- c(meta_sex_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_med[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_pp_c_pb_sym <<- c(meta_cond_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_med[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_pp_c_pb_sym <<- c(meta_sex_cond_estimate_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_med[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_pp_c_pb_asym <<- c(meta_base_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_med))
meta_sex_estimate_pp_c_pb_asym <<- c(meta_sex_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_med))
meta_cond_estimate_pp_c_pb_asym <<- c(meta_cond_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_med))
meta_sex_cond_estimate_pp_c_pb_asym <<- c(meta_sex_cond_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_med))
} else {
meta_base_estimate_pp_c_pb_asym <<- c(meta_base_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_med[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_pp_c_pb_asym <<- c(meta_sex_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_med[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_pp_c_pb_asym <<- c(meta_cond_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_med[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_pp_c_pb_asym <<- c(meta_sex_cond_estimate_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_med[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
}
# Upper
if (pp_final_expt_only == FALSE) {
meta_base_estimate_upper_pp_l <<- c(meta_base_estimate_upper_pp_l, mean(pp_l_results$b_base_upper))
meta_sex_estimate_upper_pp_l <<- c(meta_sex_estimate_upper_pp_l, mean(pp_l_results$b_sex_upper))
meta_cond_estimate_upper_pp_l <<- c(meta_cond_estimate_upper_pp_l, mean(pp_l_results$b_cond_upper))
meta_sex_cond_estimate_upper_pp_l <<- c(meta_sex_cond_estimate_upper_pp_l, mean(pp_l_results$b_sex_cond_upper))
} else {
meta_base_estimate_upper_pp_l <<- c(meta_base_estimate_upper_pp_l, mean(pp_l_results$b_base_upper[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_upper_pp_l <<- c(meta_sex_estimate_upper_pp_l, mean(pp_l_results$b_sex_upper[pp_l_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_upper_pp_l <<- c(meta_cond_estimate_upper_pp_l, mean(pp_l_results$b_cond_upper[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_upper_pp_l <<- c(meta_sex_cond_estimate_upper_pp_l, mean(pp_l_results$b_sex_cond_upper[pp_l_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_upper_pp_l_pb_sym <<- c(meta_base_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_upper))
meta_sex_estimate_upper_pp_l_pb_sym <<- c(meta_sex_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_upper))
meta_cond_estimate_upper_pp_l_pb_sym <<- c(meta_cond_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_upper))
meta_sex_cond_estimate_upper_pp_l_pb_sym <<- c(meta_sex_cond_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_upper))
} else {
meta_base_estimate_upper_pp_l_pb_sym <<- c(meta_base_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_upper_pp_l_pb_sym <<- c(meta_sex_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_upper_pp_l_pb_sym <<- c(meta_cond_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_upper_pp_l_pb_sym <<- c(meta_sex_cond_estimate_upper_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_upper_pp_l_pb_asym <<- c(meta_base_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_upper))
meta_sex_estimate_upper_pp_l_pb_asym <<- c(meta_sex_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_upper))
meta_cond_estimate_upper_pp_l_pb_asym <<- c(meta_cond_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_upper))
meta_sex_cond_estimate_upper_pp_l_pb_asym <<- c(meta_sex_cond_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_upper))
} else {
meta_base_estimate_upper_pp_l_pb_asym <<- c(meta_base_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_upper_pp_l_pb_asym <<- c(meta_sex_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_upper_pp_l_pb_asym <<- c(meta_cond_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_upper_pp_l_pb_asym <<- c(meta_sex_cond_estimate_upper_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_upper_pp_c <<- c(meta_base_estimate_upper_pp_c, mean(pp_c_results$b_base_upper))
meta_sex_estimate_upper_pp_c <<- c(meta_sex_estimate_upper_pp_c, mean(pp_c_results$b_sex_upper))
meta_cond_estimate_upper_pp_c <<- c(meta_cond_estimate_upper_pp_c, mean(pp_c_results$b_cond_upper))
meta_sex_cond_estimate_upper_pp_c <<- c(meta_sex_cond_estimate_upper_pp_c, mean(pp_c_results$b_sex_cond_upper))
} else {
meta_base_estimate_upper_pp_c <<- c(meta_base_estimate_upper_pp_c, mean(pp_c_results$b_base_upper[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_upper_pp_c <<- c(meta_sex_estimate_upper_pp_c, mean(pp_c_results$b_sex_upper[pp_c_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_upper_pp_c <<- c(meta_cond_estimate_upper_pp_c, mean(pp_c_results$b_cond_upper[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_upper_pp_c <<- c(meta_sex_cond_estimate_upper_pp_c, mean(pp_c_results$b_sex_cond_upper[pp_c_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_upper_pp_c_pb_sym <<- c(meta_base_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_upper))
meta_sex_estimate_upper_pp_c_pb_sym <<- c(meta_sex_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_upper))
meta_cond_estimate_upper_pp_c_pb_sym <<- c(meta_cond_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_upper))
meta_sex_cond_estimate_upper_pp_c_pb_sym <<- c(meta_sex_cond_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_upper))
} else {
meta_base_estimate_upper_pp_c_pb_sym <<- c(meta_base_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_upper_pp_c_pb_sym <<- c(meta_sex_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_upper_pp_c_pb_sym <<- c(meta_cond_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_upper_pp_c_pb_sym <<- c(meta_sex_cond_estimate_upper_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_upper_pp_c_pb_asym <<- c(meta_base_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_upper))
meta_sex_estimate_upper_pp_c_pb_asym <<- c(meta_sex_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_upper))
meta_cond_estimate_upper_pp_c_pb_asym <<- c(meta_cond_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_upper))
meta_sex_cond_estimate_upper_pp_c_pb_asym <<- c(meta_sex_cond_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_upper))
} else {
meta_base_estimate_upper_pp_c_pb_asym <<- c(meta_base_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_upper_pp_c_pb_asym <<- c(meta_sex_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_upper_pp_c_pb_asym <<- c(meta_cond_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_upper_pp_c_pb_asym <<- c(meta_sex_cond_estimate_upper_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
}
# Lower
if (pp_final_expt_only == FALSE) {
meta_base_estimate_lower_pp_l <<- c(meta_base_estimate_lower_pp_l, mean(pp_l_results$b_base_lower))
meta_sex_estimate_lower_pp_l <<- c(meta_sex_estimate_lower_pp_l, mean(pp_l_results$b_sex_lower))
meta_cond_estimate_lower_pp_l <<- c(meta_cond_estimate_lower_pp_l, mean(pp_l_results$b_cond_lower))
meta_sex_cond_estimate_lower_pp_l <<- c(meta_sex_cond_estimate_lower_pp_l, mean(pp_l_results$b_sex_cond_lower))
} else {
meta_base_estimate_lower_pp_l <<- c(meta_base_estimate_lower_pp_l, mean(pp_l_results$b_base_lower[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_lower_pp_l <<- c(meta_sex_estimate_lower_pp_l, mean(pp_l_results$b_sex_lower[pp_l_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_lower_pp_l <<- c(meta_cond_estimate_lower_pp_l, mean(pp_l_results$b_cond_lower[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_lower_pp_l <<- c(meta_sex_cond_estimate_lower_pp_l, mean(pp_l_results$b_sex_cond_lower[pp_l_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_lower_pp_l_pb_sym <<- c(meta_base_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_lower))
meta_sex_estimate_lower_pp_l_pb_sym <<- c(meta_sex_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_lower))
meta_cond_estimate_lower_pp_l_pb_sym <<- c(meta_cond_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_lower))
meta_sex_cond_estimate_lower_pp_l_pb_sym <<- c(meta_sex_cond_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_lower))
} else {
meta_base_estimate_lower_pp_l_pb_sym <<- c(meta_base_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_lower_pp_l_pb_sym <<- c(meta_sex_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_lower_pp_l_pb_sym <<- c(meta_cond_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_lower_pp_l_pb_sym <<- c(meta_sex_cond_estimate_lower_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_lower_pp_l_pb_asym <<- c(meta_base_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_lower))
meta_sex_estimate_lower_pp_l_pb_asym <<- c(meta_sex_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_lower))
meta_cond_estimate_lower_pp_l_pb_asym <<- c(meta_cond_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_lower))
meta_sex_cond_estimate_lower_pp_l_pb_asym <<- c(meta_sex_cond_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_lower))
} else {
meta_base_estimate_lower_pp_l_pb_asym <<- c(meta_base_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_lower_pp_l_pb_asym <<- c(meta_sex_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_lower_pp_l_pb_asym <<- c(meta_cond_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_lower_pp_l_pb_asym <<- c(meta_sex_cond_estimate_lower_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_lower_pp_c <<- c(meta_base_estimate_lower_pp_c, mean(pp_c_results$b_base_lower))
meta_sex_estimate_lower_pp_c <<- c(meta_sex_estimate_lower_pp_c, mean(pp_c_results$b_sex_lower))
meta_cond_estimate_lower_pp_c <<- c(meta_cond_estimate_lower_pp_c, mean(pp_c_results$b_cond_lower))
meta_sex_cond_estimate_lower_pp_c <<- c(meta_sex_cond_estimate_lower_pp_c, mean(pp_c_results$b_sex_cond_lower))
} else {
meta_base_estimate_lower_pp_c <<- c(meta_base_estimate_lower_pp_c, mean(pp_c_results$b_base_lower[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_lower_pp_c <<- c(meta_sex_estimate_lower_pp_c, mean(pp_c_results$b_sex_lower[pp_c_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_lower_pp_c <<- c(meta_cond_estimate_lower_pp_c, mean(pp_c_results$b_cond_lower[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_lower_pp_c <<- c(meta_sex_cond_estimate_lower_pp_c, mean(pp_c_results$b_sex_cond_lower[pp_c_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_lower_pp_c_pb_sym <<- c(meta_base_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_lower))
meta_sex_estimate_lower_pp_c_pb_sym <<- c(meta_sex_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_lower))
meta_cond_estimate_lower_pp_c_pb_sym <<- c(meta_cond_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_lower))
meta_sex_cond_estimate_lower_pp_c_pb_sym <<- c(meta_sex_cond_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_lower))
} else {
meta_base_estimate_lower_pp_c_pb_sym <<- c(meta_base_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_lower_pp_c_pb_sym <<- c(meta_sex_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_lower_pp_c_pb_sym <<- c(meta_cond_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_lower_pp_c_pb_sym <<- c(meta_sex_cond_estimate_lower_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_estimate_lower_pp_c_pb_asym <<- c(meta_base_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_lower))
meta_sex_estimate_lower_pp_c_pb_asym <<- c(meta_sex_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_lower))
meta_cond_estimate_lower_pp_c_pb_asym <<- c(meta_cond_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_lower))
meta_sex_cond_estimate_lower_pp_c_pb_asym <<- c(meta_sex_cond_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_lower))
} else {
meta_base_estimate_lower_pp_c_pb_asym <<- c(meta_base_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_estimate_lower_pp_c_pb_asym <<- c(meta_sex_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_estimate_lower_pp_c_pb_asym <<- c(meta_cond_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_estimate_lower_pp_c_pb_asym <<- c(meta_sex_cond_estimate_lower_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
}
# uncertainty
if (pp_final_expt_only == FALSE) {
meta_base_uncertainty_pp_l <<- c(meta_base_uncertainty_pp_l, mean(pp_l_results$b_base_upper - pp_l_results$b_base_lower))
meta_sex_uncertainty_pp_l <<- c(meta_sex_uncertainty_pp_l, mean(pp_l_results$b_sex_upper - pp_l_results$b_sex_lower))
meta_cond_uncertainty_pp_l <<- c(meta_cond_uncertainty_pp_l, mean(pp_l_results$b_cond_upper - pp_l_results$b_cond_lower))
meta_sex_cond_uncertainty_pp_l <<- c(meta_sex_cond_uncertainty_pp_l, mean(pp_l_results$b_sex_cond_upper - pp_l_results$b_sex_cond_lower))
} else {
meta_base_uncertainty_pp_l <<- c(meta_base_uncertainty_pp_l, mean(pp_l_results$b_base_upper[pp_l_results$expt == n_experiments_per_repeat] - pp_l_results$b_base_lower[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_uncertainty_pp_l <<- c(meta_sex_uncertainty_pp_l, mean(pp_l_results$b_sex_upper[pp_l_results$expt == n_experiments_per_repeat] - pp_l_results$b_sex_lower[pp_l_results$expt == n_experiments_per_repeat]))
meta_cond_uncertainty_pp_l <<- c(meta_cond_uncertainty_pp_l, mean(pp_l_results$b_cond_upper[pp_l_results$expt == n_experiments_per_repeat] - pp_l_results$b_cond_lower[pp_l_results$expt == n_experiments_per_repeat]))
meta_sex_cond_uncertainty_pp_l <<- c(meta_sex_cond_uncertainty_pp_l, mean(pp_l_results$b_sex_cond_upper[pp_l_results$expt == n_experiments_per_repeat] - pp_l_results$b_sex_cond_lower[pp_l_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_uncertainty_pp_l_pb_sym <<- c(meta_base_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_upper - pp_l_pb_sym_results$b_base_lower))
meta_sex_uncertainty_pp_l_pb_sym <<- c(meta_sex_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_upper - pp_l_pb_sym_results$b_sex_lower))
meta_cond_uncertainty_pp_l_pb_sym <<- c(meta_cond_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_upper - pp_l_pb_sym_results$b_cond_lower))
meta_sex_cond_uncertainty_pp_l_pb_sym <<- c(meta_sex_cond_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_upper - pp_l_pb_sym_results$b_sex_cond_lower))
} else {
meta_base_uncertainty_pp_l_pb_sym <<- c(meta_base_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_base_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat] - pp_l_pb_sym_results$b_base_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_uncertainty_pp_l_pb_sym <<- c(meta_sex_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat] - pp_l_pb_sym_results$b_sex_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_uncertainty_pp_l_pb_sym <<- c(meta_cond_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_cond_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat] - pp_l_pb_sym_results$b_cond_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_uncertainty_pp_l_pb_sym <<- c(meta_sex_cond_uncertainty_pp_l_pb_sym, mean(pp_l_pb_sym_results$b_sex_cond_upper[pp_l_pb_sym_results$expt == n_experiments_per_repeat] - pp_l_pb_sym_results$b_sex_cond_lower[pp_l_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_uncertainty_pp_l_pb_asym <<- c(meta_base_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_upper - pp_l_pb_asym_results$b_base_lower))
meta_sex_uncertainty_pp_l_pb_asym <<- c(meta_sex_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_upper - pp_l_pb_asym_results$b_sex_lower))
meta_cond_uncertainty_pp_l_pb_asym <<- c(meta_cond_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_upper - pp_l_pb_asym_results$b_cond_lower))
meta_sex_cond_uncertainty_pp_l_pb_asym <<- c(meta_sex_cond_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_upper - pp_l_pb_asym_results$b_sex_cond_lower))
} else {
meta_base_uncertainty_pp_l_pb_asym <<- c(meta_base_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_base_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat] - pp_l_pb_asym_results$b_base_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_uncertainty_pp_l_pb_asym <<- c(meta_sex_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat] - pp_l_pb_asym_results$b_sex_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_uncertainty_pp_l_pb_asym <<- c(meta_cond_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_cond_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat] - pp_l_pb_asym_results$b_cond_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_uncertainty_pp_l_pb_asym <<- c(meta_sex_cond_uncertainty_pp_l_pb_asym, mean(pp_l_pb_asym_results$b_sex_cond_upper[pp_l_pb_asym_results$expt == n_experiments_per_repeat] - pp_l_pb_asym_results$b_sex_cond_lower[pp_l_pb_asym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_uncertainty_pp_c <<- c(meta_base_uncertainty_pp_c, mean(pp_c_results$b_base_upper - pp_c_results$b_base_lower))
meta_sex_uncertainty_pp_c <<- c(meta_sex_uncertainty_pp_c, mean(pp_c_results$b_sex_upper - pp_c_results$b_sex_lower))
meta_cond_uncertainty_pp_c <<- c(meta_cond_uncertainty_pp_c, mean(pp_c_results$b_cond_upper - pp_c_results$b_cond_lower))
meta_sex_cond_uncertainty_pp_c <<- c(meta_sex_cond_uncertainty_pp_c, mean(pp_c_results$b_sex_cond_upper - pp_c_results$b_sex_cond_lower))
} else {
meta_base_uncertainty_pp_c <<- c(meta_base_uncertainty_pp_c, mean(pp_c_results$b_base_upper[pp_c_results$expt == n_experiments_per_repeat] - pp_c_results$b_base_lower[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_uncertainty_pp_c <<- c(meta_sex_uncertainty_pp_c, mean(pp_c_results$b_sex_upper[pp_c_results$expt == n_experiments_per_repeat] - pp_c_results$b_sex_lower[pp_c_results$expt == n_experiments_per_repeat]))
meta_cond_uncertainty_pp_c <<- c(meta_cond_uncertainty_pp_c, mean(pp_c_results$b_cond_upper[pp_c_results$expt == n_experiments_per_repeat] - pp_c_results$b_cond_lower[pp_c_results$expt == n_experiments_per_repeat]))
meta_sex_cond_uncertainty_pp_c <<- c(meta_sex_cond_uncertainty_pp_c, mean(pp_c_results$b_sex_cond_upper[pp_c_results$expt == n_experiments_per_repeat] - pp_c_results$b_sex_cond_lower[pp_c_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_uncertainty_pp_c_pb_sym <<- c(meta_base_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_upper - pp_c_pb_sym_results$b_base_lower))
meta_sex_uncertainty_pp_c_pb_sym <<- c(meta_sex_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_upper - pp_c_pb_sym_results$b_sex_lower))
meta_cond_uncertainty_pp_c_pb_sym <<- c(meta_cond_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_upper - pp_c_pb_sym_results$b_cond_lower))
meta_sex_cond_uncertainty_pp_c_pb_sym <<- c(meta_sex_cond_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_upper - pp_c_pb_sym_results$b_sex_cond_lower))
} else {
meta_base_uncertainty_pp_c_pb_sym <<- c(meta_base_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_base_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat] - pp_c_pb_sym_results$b_base_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_uncertainty_pp_c_pb_sym <<- c(meta_sex_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat] - pp_c_pb_sym_results$b_sex_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_cond_uncertainty_pp_c_pb_sym <<- c(meta_cond_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_cond_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat] - pp_c_pb_sym_results$b_cond_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_uncertainty_pp_c_pb_sym <<- c(meta_sex_cond_uncertainty_pp_c_pb_sym, mean(pp_c_pb_sym_results$b_sex_cond_upper[pp_c_pb_sym_results$expt == n_experiments_per_repeat] - pp_c_pb_sym_results$b_sex_cond_lower[pp_c_pb_sym_results$expt == n_experiments_per_repeat]))
}
if (pp_final_expt_only == FALSE) {
meta_base_uncertainty_pp_c_pb_asym <<- c(meta_base_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_upper - pp_c_pb_asym_results$b_base_lower))
meta_sex_uncertainty_pp_c_pb_asym <<- c(meta_sex_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_upper - pp_c_pb_asym_results$b_sex_lower))
meta_cond_uncertainty_pp_c_pb_asym <<- c(meta_cond_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_upper - pp_c_pb_asym_results$b_cond_lower))
meta_sex_cond_uncertainty_pp_c_pb_asym <<- c(meta_sex_cond_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_upper - pp_c_pb_asym_results$b_sex_cond_lower))
} else {
meta_base_uncertainty_pp_c_pb_asym <<- c(meta_base_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_base_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat] - pp_c_pb_asym_results$b_base_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_uncertainty_pp_c_pb_asym <<- c(meta_sex_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat] - pp_c_pb_asym_results$b_sex_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_cond_uncertainty_pp_c_pb_asym <<- c(meta_cond_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_cond_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat] - pp_c_pb_asym_results$b_cond_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
meta_sex_cond_uncertainty_pp_c_pb_asym <<- c(meta_sex_cond_uncertainty_pp_c_pb_asym, mean(pp_c_pb_asym_results$b_sex_cond_upper[pp_c_pb_asym_results$expt == n_experiments_per_repeat] - pp_c_pb_asym_results$b_sex_cond_lower[pp_c_pb_asym_results$expt == n_experiments_per_repeat]))
}
}
}
compile_meta_results <- function() {
meta_base_estimate_pp_l_p <- exp(meta_base_estimate_pp_l)/(1+exp(meta_base_estimate_pp_l))
meta_sex_estimate_pp_l_p <- exp(meta_sex_estimate_pp_l+meta_base_estimate_pp_l)/(1+exp(meta_sex_estimate_pp_l+meta_base_estimate_pp_l)) - meta_base_estimate_pp_l_p
meta_cond_estimate_pp_l_p <- exp(meta_cond_estimate_pp_l+meta_base_estimate_pp_l)/(1+exp(meta_cond_estimate_pp_l+meta_base_estimate_pp_l)) - meta_base_estimate_pp_l_p
meta_sex_cond_estimate_pp_l_p <- exp(meta_sex_cond_estimate_pp_l + meta_sex_estimate_pp_l + meta_cond_estimate_pp_l + meta_base_estimate_pp_l)/(1+exp(meta_sex_cond_estimate_pp_l + meta_sex_estimate_pp_l + meta_cond_estimate_pp_l + meta_base_estimate_pp_l)) - (meta_base_estimate_pp_l_p + meta_sex_estimate_pp_l_p + meta_cond_estimate_pp_l_p)
meta_base_estimate_pp_l_pb_sym_p <- exp(meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_base_estimate_pp_l_pb_sym))
meta_sex_estimate_pp_l_pb_sym_p <- exp(meta_sex_estimate_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_sex_estimate_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)) - meta_base_estimate_pp_l_pb_sym_p
meta_cond_estimate_pp_l_pb_sym_p <- exp(meta_cond_estimate_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_cond_estimate_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)) - meta_base_estimate_pp_l_pb_sym_p
meta_sex_cond_estimate_pp_l_pb_sym_p <- exp(meta_sex_cond_estimate_pp_l_pb_sym + meta_sex_estimate_pp_l_pb_sym + meta_cond_estimate_pp_l_pb_sym + meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_sex_cond_estimate_pp_l_pb_sym + meta_sex_estimate_pp_l_pb_sym + meta_cond_estimate_pp_l_pb_sym + meta_base_estimate_pp_l_pb_sym)) - (meta_base_estimate_pp_l_pb_sym_p + meta_sex_estimate_pp_l_pb_sym_p + meta_cond_estimate_pp_l_pb_sym_p)
meta_base_estimate_pp_l_pb_asym_p <- exp(meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_base_estimate_pp_l_pb_asym))
meta_sex_estimate_pp_l_pb_asym_p <- exp(meta_sex_estimate_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_sex_estimate_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)) - meta_base_estimate_pp_l_pb_asym_p
meta_cond_estimate_pp_l_pb_asym_p <- exp(meta_cond_estimate_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_cond_estimate_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)) - meta_base_estimate_pp_l_pb_asym_p
meta_sex_cond_estimate_pp_l_pb_asym_p <- exp(meta_sex_cond_estimate_pp_l_pb_asym + meta_sex_estimate_pp_l_pb_asym + meta_cond_estimate_pp_l_pb_asym + meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_sex_cond_estimate_pp_l_pb_asym + meta_sex_estimate_pp_l_pb_asym + meta_cond_estimate_pp_l_pb_asym + meta_base_estimate_pp_l_pb_asym)) - (meta_base_estimate_pp_l_pb_asym_p + meta_sex_estimate_pp_l_pb_asym_p + meta_cond_estimate_pp_l_pb_asym_p)
meta_base_estimate_pp_c_p <- exp(meta_base_estimate_pp_c)/(1+exp(meta_base_estimate_pp_c))
meta_sex_estimate_pp_c_p <- exp(meta_sex_estimate_pp_c+meta_base_estimate_pp_c)/(1+exp(meta_sex_estimate_pp_c+meta_base_estimate_pp_c)) - meta_base_estimate_pp_c_p
meta_cond_estimate_pp_c_p <- exp(meta_cond_estimate_pp_c+meta_base_estimate_pp_c)/(1+exp(meta_cond_estimate_pp_c+meta_base_estimate_pp_c)) - meta_base_estimate_pp_c_p
meta_sex_cond_estimate_pp_c_p <- exp(meta_sex_cond_estimate_pp_c + meta_sex_estimate_pp_c + meta_cond_estimate_pp_c + meta_base_estimate_pp_c)/(1+exp(meta_sex_cond_estimate_pp_c + meta_sex_estimate_pp_c + meta_cond_estimate_pp_c + meta_base_estimate_pp_c)) - (meta_base_estimate_pp_c_p + meta_sex_estimate_pp_c_p + meta_cond_estimate_pp_c_p)
meta_base_estimate_pp_c_pb_sym_p <- exp(meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_base_estimate_pp_c_pb_sym))
meta_sex_estimate_pp_c_pb_sym_p <- exp(meta_sex_estimate_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_sex_estimate_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)) - meta_base_estimate_pp_c_pb_sym_p
meta_cond_estimate_pp_c_pb_sym_p <- exp(meta_cond_estimate_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_cond_estimate_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)) - meta_base_estimate_pp_c_pb_sym_p
meta_sex_cond_estimate_pp_c_pb_sym_p <- exp(meta_sex_cond_estimate_pp_c_pb_sym + meta_sex_estimate_pp_c_pb_sym + meta_cond_estimate_pp_c_pb_sym + meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_sex_cond_estimate_pp_c_pb_sym + meta_sex_estimate_pp_c_pb_sym + meta_cond_estimate_pp_c_pb_sym + meta_base_estimate_pp_c_pb_sym)) - (meta_base_estimate_pp_c_pb_sym_p + meta_sex_estimate_pp_c_pb_sym_p + meta_cond_estimate_pp_c_pb_sym_p)
meta_base_estimate_pp_c_pb_asym_p <- exp(meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_base_estimate_pp_c_pb_asym))
meta_sex_estimate_pp_c_pb_asym_p <- exp(meta_sex_estimate_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_sex_estimate_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)) - meta_base_estimate_pp_c_pb_asym_p
meta_cond_estimate_pp_c_pb_asym_p <- exp(meta_cond_estimate_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_cond_estimate_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)) - meta_base_estimate_pp_c_pb_asym_p
meta_sex_cond_estimate_pp_c_pb_asym_p <- exp(meta_sex_cond_estimate_pp_c_pb_asym + meta_sex_estimate_pp_c_pb_asym + meta_cond_estimate_pp_c_pb_asym + meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_sex_cond_estimate_pp_c_pb_asym + meta_sex_estimate_pp_c_pb_asym + meta_cond_estimate_pp_c_pb_asym + meta_base_estimate_pp_c_pb_asym)) - (meta_base_estimate_pp_c_pb_asym_p + meta_sex_estimate_pp_c_pb_asym_p + meta_cond_estimate_pp_c_pb_asym_p)
meta_base_uncertainty_pp_l_p <- exp(meta_base_estimate_upper_pp_l)/(1+exp(meta_base_estimate_upper_pp_l)) - exp(meta_base_estimate_lower_pp_l)/(1+exp(meta_base_estimate_lower_pp_l))
meta_sex_uncertainty_pp_l_p <- exp(meta_sex_estimate_upper_pp_l+meta_base_estimate_pp_l)/(1+exp(meta_sex_estimate_upper_pp_l+meta_base_estimate_pp_l)) - exp(meta_sex_estimate_lower_pp_l+meta_base_estimate_pp_l)/(1+exp(meta_sex_estimate_lower_pp_l+meta_base_estimate_pp_l))
meta_cond_uncertainty_pp_l_p <- exp(meta_cond_estimate_upper_pp_l+meta_base_estimate_pp_l)/(1+exp(meta_cond_estimate_upper_pp_l+meta_base_estimate_pp_l)) - exp(meta_cond_estimate_lower_pp_l+meta_base_estimate_pp_l)/(1+exp(meta_cond_estimate_lower_pp_l+meta_base_estimate_pp_l))
meta_sex_cond_uncertainty_pp_l_p <- exp(meta_sex_cond_estimate_upper_pp_l + meta_sex_estimate_pp_l + meta_cond_estimate_pp_l +meta_base_estimate_pp_l)/(1+exp(meta_sex_cond_estimate_upper_pp_l + meta_sex_estimate_pp_l + meta_cond_estimate_pp_l +meta_base_estimate_pp_l)) - exp(meta_sex_cond_estimate_lower_pp_l + meta_sex_estimate_pp_l + meta_cond_estimate_pp_l +meta_base_estimate_pp_l)/(1+exp(meta_sex_cond_estimate_lower_pp_l + meta_sex_estimate_pp_l + meta_cond_estimate_pp_l +meta_base_estimate_pp_l))
meta_base_uncertainty_pp_l_pb_sym_p <- exp(meta_base_estimate_upper_pp_l_pb_sym)/(1+exp(meta_base_estimate_upper_pp_l_pb_sym)) - exp(meta_base_estimate_lower_pp_l_pb_sym)/(1+exp(meta_base_estimate_lower_pp_l_pb_sym))
meta_sex_uncertainty_pp_l_pb_sym_p <- exp(meta_sex_estimate_upper_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_sex_estimate_upper_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)) - exp(meta_sex_estimate_lower_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_sex_estimate_lower_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym))
meta_cond_uncertainty_pp_l_pb_sym_p <- exp(meta_cond_estimate_upper_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_cond_estimate_upper_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)) - exp(meta_cond_estimate_lower_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_cond_estimate_lower_pp_l_pb_sym+meta_base_estimate_pp_l_pb_sym))
meta_sex_cond_uncertainty_pp_l_pb_sym_p <- exp(meta_sex_cond_estimate_upper_pp_l_pb_sym + meta_sex_estimate_pp_l_pb_sym + meta_cond_estimate_pp_l_pb_sym +meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_sex_cond_estimate_upper_pp_l_pb_sym + meta_sex_estimate_pp_l_pb_sym + meta_cond_estimate_pp_l_pb_sym +meta_base_estimate_pp_l_pb_sym)) - exp(meta_sex_cond_estimate_lower_pp_l_pb_sym + meta_sex_estimate_pp_l_pb_sym + meta_cond_estimate_pp_l_pb_sym +meta_base_estimate_pp_l_pb_sym)/(1+exp(meta_sex_cond_estimate_lower_pp_l_pb_sym + meta_sex_estimate_pp_l_pb_sym + meta_cond_estimate_pp_l_pb_sym +meta_base_estimate_pp_l_pb_sym))
meta_base_uncertainty_pp_l_pb_asym_p <- exp(meta_base_estimate_upper_pp_l_pb_asym)/(1+exp(meta_base_estimate_upper_pp_l_pb_asym)) - exp(meta_base_estimate_lower_pp_l_pb_asym)/(1+exp(meta_base_estimate_lower_pp_l_pb_asym))
meta_sex_uncertainty_pp_l_pb_asym_p <- exp(meta_sex_estimate_upper_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_sex_estimate_upper_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)) - exp(meta_sex_estimate_lower_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_sex_estimate_lower_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym))
meta_cond_uncertainty_pp_l_pb_asym_p <- exp(meta_cond_estimate_upper_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_cond_estimate_upper_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)) - exp(meta_cond_estimate_lower_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_cond_estimate_lower_pp_l_pb_asym+meta_base_estimate_pp_l_pb_asym))
meta_sex_cond_uncertainty_pp_l_pb_asym_p <- exp(meta_sex_cond_estimate_upper_pp_l_pb_asym + meta_sex_estimate_pp_l_pb_asym + meta_cond_estimate_pp_l_pb_asym +meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_sex_cond_estimate_upper_pp_l_pb_asym + meta_sex_estimate_pp_l_pb_asym + meta_cond_estimate_pp_l_pb_asym +meta_base_estimate_pp_l_pb_asym)) - exp(meta_sex_cond_estimate_lower_pp_l_pb_asym + meta_sex_estimate_pp_l_pb_asym + meta_cond_estimate_pp_l_pb_asym +meta_base_estimate_pp_l_pb_asym)/(1+exp(meta_sex_cond_estimate_lower_pp_l_pb_asym + meta_sex_estimate_pp_l_pb_asym + meta_cond_estimate_pp_l_pb_asym +meta_base_estimate_pp_l_pb_asym))
meta_base_uncertainty_pp_c_p <- exp(meta_base_estimate_upper_pp_c)/(1+exp(meta_base_estimate_upper_pp_c)) - exp(meta_base_estimate_lower_pp_c)/(1+exp(meta_base_estimate_lower_pp_c))
meta_sex_uncertainty_pp_c_p <- exp(meta_sex_estimate_upper_pp_c+meta_base_estimate_pp_c)/(1+exp(meta_sex_estimate_upper_pp_c+meta_base_estimate_pp_c)) - exp(meta_sex_estimate_lower_pp_c+meta_base_estimate_pp_c)/(1+exp(meta_sex_estimate_lower_pp_c+meta_base_estimate_pp_c))
meta_cond_uncertainty_pp_c_p <- exp(meta_cond_estimate_upper_pp_c+meta_base_estimate_pp_c)/(1+exp(meta_cond_estimate_upper_pp_c+meta_base_estimate_pp_c)) - exp(meta_cond_estimate_lower_pp_c+meta_base_estimate_pp_c)/(1+exp(meta_cond_estimate_lower_pp_c+meta_base_estimate_pp_c))
meta_sex_cond_uncertainty_pp_c_p <- exp(meta_sex_cond_estimate_upper_pp_c + meta_sex_estimate_pp_c + meta_cond_estimate_pp_c +meta_base_estimate_pp_c)/(1+exp(meta_sex_cond_estimate_upper_pp_c + meta_sex_estimate_pp_c + meta_cond_estimate_pp_c +meta_base_estimate_pp_c)) - exp(meta_sex_cond_estimate_lower_pp_c + meta_sex_estimate_pp_c + meta_cond_estimate_pp_c +meta_base_estimate_pp_c)/(1+exp(meta_sex_cond_estimate_lower_pp_c + meta_sex_estimate_pp_c + meta_cond_estimate_pp_c +meta_base_estimate_pp_c))
meta_base_uncertainty_pp_c_pb_sym_p <- exp(meta_base_estimate_upper_pp_c_pb_sym)/(1+exp(meta_base_estimate_upper_pp_c_pb_sym)) - exp(meta_base_estimate_lower_pp_c_pb_sym)/(1+exp(meta_base_estimate_lower_pp_c_pb_sym))
meta_sex_uncertainty_pp_c_pb_sym_p <- exp(meta_sex_estimate_upper_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_sex_estimate_upper_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)) - exp(meta_sex_estimate_lower_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_sex_estimate_lower_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym))
meta_cond_uncertainty_pp_c_pb_sym_p <- exp(meta_cond_estimate_upper_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_cond_estimate_upper_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)) - exp(meta_cond_estimate_lower_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_cond_estimate_lower_pp_c_pb_sym+meta_base_estimate_pp_c_pb_sym))
meta_sex_cond_uncertainty_pp_c_pb_sym_p <- exp(meta_sex_cond_estimate_upper_pp_c_pb_sym + meta_sex_estimate_pp_c_pb_sym + meta_cond_estimate_pp_c_pb_sym +meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_sex_cond_estimate_upper_pp_c_pb_sym + meta_sex_estimate_pp_c_pb_sym + meta_cond_estimate_pp_c_pb_sym +meta_base_estimate_pp_c_pb_sym)) - exp(meta_sex_cond_estimate_lower_pp_c_pb_sym + meta_sex_estimate_pp_c_pb_sym + meta_cond_estimate_pp_c_pb_sym +meta_base_estimate_pp_c_pb_sym)/(1+exp(meta_sex_cond_estimate_lower_pp_c_pb_sym + meta_sex_estimate_pp_c_pb_sym + meta_cond_estimate_pp_c_pb_sym +meta_base_estimate_pp_c_pb_sym))
meta_base_uncertainty_pp_c_pb_asym_p <- exp(meta_base_estimate_upper_pp_c_pb_asym)/(1+exp(meta_base_estimate_upper_pp_c_pb_asym)) - exp(meta_base_estimate_lower_pp_c_pb_asym)/(1+exp(meta_base_estimate_lower_pp_c_pb_asym))
meta_sex_uncertainty_pp_c_pb_asym_p <- exp(meta_sex_estimate_upper_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_sex_estimate_upper_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)) - exp(meta_sex_estimate_lower_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_sex_estimate_lower_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym))
meta_cond_uncertainty_pp_c_pb_asym_p <- exp(meta_cond_estimate_upper_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_cond_estimate_upper_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)) - exp(meta_cond_estimate_lower_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_cond_estimate_lower_pp_c_pb_asym+meta_base_estimate_pp_c_pb_asym))
meta_sex_cond_uncertainty_pp_c_pb_asym_p <- exp(meta_sex_cond_estimate_upper_pp_c_pb_asym + meta_sex_estimate_pp_c_pb_asym + meta_cond_estimate_pp_c_pb_asym +meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_sex_cond_estimate_upper_pp_c_pb_asym + meta_sex_estimate_pp_c_pb_asym + meta_cond_estimate_pp_c_pb_asym +meta_base_estimate_pp_c_pb_asym)) - exp(meta_sex_cond_estimate_lower_pp_c_pb_asym + meta_sex_estimate_pp_c_pb_asym + meta_cond_estimate_pp_c_pb_asym +meta_base_estimate_pp_c_pb_asym)/(1+exp(meta_sex_cond_estimate_lower_pp_c_pb_asym + meta_sex_estimate_pp_c_pb_asym + meta_cond_estimate_pp_c_pb_asym +meta_base_estimate_pp_c_pb_asym))
return(data.frame(meta_n_repeats,meta_n_experiments_per_repeat, meta_n_participants_per_experiment,
meta_n_trials_per_participant, meta_n_people,
meta_true_base, meta_true_sex, meta_true_cond, meta_true_sex_cond,
pub_pp_l,pub_pp_l_pb_sym, pub_pp_l_pb_asym, pub_pp_c, pub_pp_c_pb_sym, pub_pp_c_pb_asym, meta_var_pop,
meta_base_estimate_pp_l, meta_sex_estimate_pp_l, meta_cond_estimate_pp_l, meta_sex_cond_estimate_pp_l,
meta_base_estimate_pp_l_pb_sym, meta_sex_estimate_pp_l_pb_sym, meta_cond_estimate_pp_l_pb_sym, meta_sex_cond_estimate_pp_l_pb_sym,
meta_base_estimate_pp_l_pb_asym, meta_sex_estimate_pp_l_pb_asym, meta_cond_estimate_pp_l_pb_asym, meta_sex_cond_estimate_pp_l_pb_asym,
meta_base_estimate_pp_c, meta_sex_estimate_pp_c, meta_cond_estimate_pp_c, meta_sex_cond_estimate_pp_c,
meta_base_estimate_pp_c_pb_sym, meta_sex_estimate_pp_c_pb_sym, meta_cond_estimate_pp_c_pb_sym, meta_sex_cond_estimate_pp_c_pb_sym,
meta_base_estimate_pp_c_pb_asym, meta_sex_estimate_pp_c_pb_asym, meta_cond_estimate_pp_c_pb_asym, meta_sex_cond_estimate_pp_c_pb_asym,
meta_base_estimate_pp_l_p, meta_sex_estimate_pp_l_p, meta_cond_estimate_pp_l_p, meta_sex_cond_estimate_pp_l_p,
meta_base_estimate_pp_l_pb_sym_p, meta_sex_estimate_pp_l_pb_sym_p, meta_cond_estimate_pp_l_pb_sym_p, meta_sex_cond_estimate_pp_l_pb_sym_p,
meta_base_estimate_pp_l_pb_asym_p, meta_sex_estimate_pp_l_pb_asym_p, meta_cond_estimate_pp_l_pb_asym_p, meta_sex_cond_estimate_pp_l_pb_asym_p,
meta_base_estimate_pp_c_p, meta_sex_estimate_pp_c_p, meta_cond_estimate_pp_c_p, meta_sex_cond_estimate_pp_c_p,
meta_base_estimate_pp_c_pb_sym_p, meta_sex_estimate_pp_c_pb_sym_p, meta_cond_estimate_pp_c_pb_sym_p, meta_sex_cond_estimate_pp_c_pb_sym_p,
meta_base_estimate_pp_c_pb_asym_p, meta_sex_estimate_pp_c_pb_asym_p, meta_cond_estimate_pp_c_pb_asym_p, meta_sex_cond_estimate_pp_c_pb_asym_p,
meta_base_estimate_lower_pp_l, meta_sex_estimate_lower_pp_l, meta_cond_estimate_lower_pp_l, meta_sex_cond_estimate_lower_pp_l,
meta_base_estimate_lower_pp_l_pb_sym, meta_sex_estimate_lower_pp_l_pb_sym, meta_cond_estimate_lower_pp_l_pb_sym, meta_sex_cond_estimate_lower_pp_l_pb_sym,
meta_base_estimate_lower_pp_l_pb_asym, meta_sex_estimate_lower_pp_l_pb_asym, meta_cond_estimate_lower_pp_l_pb_asym, meta_sex_cond_estimate_lower_pp_l_pb_asym,
meta_base_estimate_lower_pp_c, meta_sex_estimate_lower_pp_c, meta_cond_estimate_lower_pp_c, meta_sex_cond_estimate_lower_pp_c,
meta_base_estimate_lower_pp_c_pb_sym, meta_sex_estimate_lower_pp_c_pb_sym, meta_cond_estimate_lower_pp_c_pb_sym, meta_sex_cond_estimate_lower_pp_c_pb_sym,
meta_base_estimate_lower_pp_c_pb_asym, meta_sex_estimate_lower_pp_c_pb_asym, meta_cond_estimate_lower_pp_c_pb_asym, meta_sex_cond_estimate_lower_pp_c_pb_asym,
meta_base_estimate_upper_pp_l, meta_sex_estimate_upper_pp_l, meta_cond_estimate_upper_pp_l, meta_sex_cond_estimate_upper_pp_l,
meta_base_estimate_upper_pp_l_pb_sym, meta_sex_estimate_upper_pp_l_pb_sym, meta_cond_estimate_upper_pp_l_pb_sym, meta_sex_cond_estimate_upper_pp_l_pb_sym,
meta_base_estimate_upper_pp_l_pb_asym, meta_sex_estimate_upper_pp_l_pb_asym, meta_cond_estimate_upper_pp_l_pb_asym, meta_sex_cond_estimate_upper_pp_l_pb_asym,
meta_base_estimate_upper_pp_c, meta_sex_estimate_upper_pp_c, meta_cond_estimate_upper_pp_c, meta_sex_cond_estimate_upper_pp_c,
meta_base_estimate_upper_pp_c_pb_sym, meta_sex_estimate_upper_pp_c_pb_sym, meta_cond_estimate_upper_pp_c_pb_sym, meta_sex_cond_estimate_upper_pp_c_pb_sym,
meta_base_estimate_upper_pp_c_pb_asym, meta_sex_estimate_upper_pp_c_pb_asym, meta_cond_estimate_upper_pp_c_pb_asym, meta_sex_cond_estimate_upper_pp_c_pb_asym,
meta_base_uncertainty_pp_l, meta_sex_uncertainty_pp_l, meta_cond_uncertainty_pp_l, meta_sex_cond_uncertainty_pp_l,
meta_base_uncertainty_pp_l_pb_sym, meta_sex_uncertainty_pp_l_pb_sym, meta_cond_uncertainty_pp_l_pb_sym, meta_sex_cond_uncertainty_pp_l_pb_sym,
meta_base_uncertainty_pp_l_pb_asym, meta_sex_uncertainty_pp_l_pb_asym, meta_cond_uncertainty_pp_l_pb_asym, meta_sex_cond_uncertainty_pp_l_pb_asym,
meta_base_uncertainty_pp_c, meta_sex_uncertainty_pp_c, meta_cond_uncertainty_pp_c, meta_sex_cond_uncertainty_pp_c,
meta_base_uncertainty_pp_c_pb_sym, meta_sex_uncertainty_pp_c_pb_sym, meta_cond_uncertainty_pp_c_pb_sym, meta_sex_cond_uncertainty_pp_c_pb_sym,
meta_base_uncertainty_pp_c_pb_asym, meta_sex_uncertainty_pp_c_pb_asym, meta_cond_uncertainty_pp_c_pb_asym, meta_sex_cond_uncertainty_pp_c_pb_asym,
meta_base_uncertainty_pp_l_p, meta_sex_uncertainty_pp_l_p, meta_cond_uncertainty_pp_l_p, meta_sex_cond_uncertainty_pp_l_p,
meta_base_uncertainty_pp_l_pb_sym_p, meta_sex_uncertainty_pp_l_pb_sym_p, meta_cond_uncertainty_pp_l_pb_sym_p, meta_sex_cond_uncertainty_pp_l_pb_sym_p,
meta_base_uncertainty_pp_l_pb_asym_p, meta_sex_uncertainty_pp_l_pb_asym_p, meta_cond_uncertainty_pp_l_pb_asym_p, meta_sex_cond_uncertainty_pp_l_pb_asym_p,
meta_base_uncertainty_pp_c_p, meta_sex_uncertainty_pp_c_p, meta_cond_uncertainty_pp_c_p, meta_sex_cond_uncertainty_pp_c_p,
meta_base_uncertainty_pp_c_pb_sym_p, meta_sex_uncertainty_pp_c_pb_sym_p, meta_cond_uncertainty_pp_c_pb_sym_p, meta_sex_cond_uncertainty_pp_c_pb_sym_p,
meta_base_uncertainty_pp_c_pb_asym_p, meta_sex_uncertainty_pp_c_pb_asym_p, meta_cond_uncertainty_pp_c_pb_asym_p, meta_sex_cond_uncertainty_pp_c_pb_asym_p))
}
tidy_workspace <- function() {
rm(meta_n_repeats,meta_n_experiments_per_repeat, meta_n_participants_per_experiment,
meta_n_trials_per_participant, meta_n_people,
meta_true_base, meta_true_sex, meta_true_cond, meta_true_sex_cond,
pub_pp_l,pub_pp_l_pb_sym, pub_pp_l_pb_asym, pub_pp_c, pub_pp_c_pb_sym, pub_pp_c_pb_asym, meta_var_pop,
meta_base_estimate_pp_l, meta_sex_estimate_pp_l, meta_cond_estimate_pp_l, meta_sex_cond_estimate_pp_l,
meta_base_estimate_pp_l_pb_sym, meta_sex_estimate_pp_l_pb_sym, meta_cond_estimate_pp_l_pb_sym, meta_sex_cond_estimate_pp_l_pb_sym,
meta_base_estimate_pp_l_pb_asym, meta_sex_estimate_pp_l_pb_asym, meta_cond_estimate_pp_l_pb_asym, meta_sex_cond_estimate_pp_l_pb_asym,
meta_base_estimate_pp_c, meta_sex_estimate_pp_c, meta_cond_estimate_pp_c, meta_sex_cond_estimate_pp_c,
meta_base_estimate_pp_c_pb_sym, meta_sex_estimate_pp_c_pb_sym, meta_cond_estimate_pp_c_pb_sym, meta_sex_cond_estimate_pp_c_pb_sym,
meta_base_estimate_pp_c_pb_asym, meta_sex_estimate_pp_c_pb_asym, meta_cond_estimate_pp_c_pb_asym, meta_sex_cond_estimate_pp_c_pb_asym,
meta_base_estimate_pp_l_p, meta_sex_estimate_pp_l_p, meta_cond_estimate_pp_l_p, meta_sex_cond_estimate_pp_l_p,
meta_base_estimate_pp_l_pb_sym_p, meta_sex_estimate_pp_l_pb_sym_p, meta_cond_estimate_pp_l_pb_sym_p, meta_sex_cond_estimate_pp_l_pb_sym_p,
meta_base_estimate_pp_l_pb_asym_p, meta_sex_estimate_pp_l_pb_asym_p, meta_cond_estimate_pp_l_pb_asym_p, meta_sex_cond_estimate_pp_l_pb_asym_p,
meta_base_estimate_pp_c_p, meta_sex_estimate_pp_c_p, meta_cond_estimate_pp_c_p, meta_sex_cond_estimate_pp_c_p,
meta_base_estimate_pp_c_pb_sym_p, meta_sex_estimate_pp_c_pb_sym_p, meta_cond_estimate_pp_c_pb_sym_p, meta_sex_cond_estimate_pp_c_pb_sym_p,
meta_base_estimate_pp_c_pb_asym_p, meta_sex_estimate_pp_c_pb_asym_p, meta_cond_estimate_pp_c_pb_asym_p, meta_sex_cond_estimate_pp_c_pb_asym_p,
meta_base_estimate_lower_pp_l, meta_sex_estimate_lower_pp_l, meta_cond_estimate_lower_pp_l, meta_sex_cond_estimate_lower_pp_l,
meta_base_estimate_lower_pp_l_pb_sym, meta_sex_estimate_lower_pp_l_pb_sym, meta_cond_estimate_lower_pp_l_pb_sym, meta_sex_cond_estimate_lower_pp_l_pb_sym,
meta_base_estimate_lower_pp_l_pb_asym, meta_sex_estimate_lower_pp_l_pb_asym, meta_cond_estimate_lower_pp_l_pb_asym, meta_sex_cond_estimate_lower_pp_l_pb_asym,
meta_base_estimate_lower_pp_c, meta_sex_estimate_lower_pp_c, meta_cond_estimate_lower_pp_c, meta_sex_cond_estimate_lower_pp_c,
meta_base_estimate_lower_pp_c_pb_sym, meta_sex_estimate_lower_pp_c_pb_sym, meta_cond_estimate_lower_pp_c_pb_sym, meta_sex_cond_estimate_lower_pp_c_pb_sym,
meta_base_estimate_lower_pp_c_pb_asym, meta_sex_estimate_lower_pp_c_pb_asym, meta_cond_estimate_lower_pp_c_pb_asym, meta_sex_cond_estimate_lower_pp_c_pb_asym,
meta_base_estimate_upper_pp_l, meta_sex_estimate_upper_pp_l, meta_cond_estimate_upper_pp_l, meta_sex_cond_estimate_upper_pp_l,
meta_base_estimate_upper_pp_l_pb_sym, meta_sex_estimate_upper_pp_l_pb_sym, meta_cond_estimate_upper_pp_l_pb_sym, meta_sex_cond_estimate_upper_pp_l_pb_sym,
meta_base_estimate_upper_pp_l_pb_asym, meta_sex_estimate_upper_pp_l_pb_asym, meta_cond_estimate_upper_pp_l_pb_asym, meta_sex_cond_estimate_upper_pp_l_pb_asym,
meta_base_estimate_upper_pp_c, meta_sex_estimate_upper_pp_c, meta_cond_estimate_upper_pp_c, meta_sex_cond_estimate_upper_pp_c,
meta_base_estimate_upper_pp_c_pb_sym, meta_sex_estimate_upper_pp_c_pb_sym, meta_cond_estimate_upper_pp_c_pb_sym, meta_sex_cond_estimate_upper_pp_c_pb_sym,
meta_base_estimate_upper_pp_c_pb_asym, meta_sex_estimate_upper_pp_c_pb_asym, meta_cond_estimate_upper_pp_c_pb_asym, meta_sex_cond_estimate_upper_pp_c_pb_asym,
meta_base_uncertainty_pp_l, meta_sex_uncertainty_pp_l, meta_cond_uncertainty_pp_l, meta_sex_cond_uncertainty_pp_l,
meta_base_uncertainty_pp_l_pb_sym, meta_sex_uncertainty_pp_l_pb_sym, meta_cond_uncertainty_pp_l_pb_sym, meta_sex_cond_uncertainty_pp_l_pb_sym,
meta_base_uncertainty_pp_l_pb_asym, meta_sex_uncertainty_pp_l_pb_asym, meta_cond_uncertainty_pp_l_pb_asym, meta_sex_cond_uncertainty_pp_l_pb_asym,
meta_base_uncertainty_pp_c, meta_sex_uncertainty_pp_c, meta_cond_uncertainty_pp_c, meta_sex_cond_uncertainty_pp_c,
meta_base_uncertainty_pp_c_pb_sym, meta_sex_uncertainty_pp_c_pb_sym, meta_cond_uncertainty_pp_c_pb_sym, meta_sex_cond_uncertainty_pp_c_pb_sym,
meta_base_uncertainty_pp_c_pb_asym, meta_sex_uncertainty_pp_c_pb_asym, meta_cond_uncertainty_pp_c_pb_asym, meta_sex_cond_uncertainty_pp_c_pb_asym,
meta_base_uncertainty_pp_l_p, meta_sex_uncertainty_pp_l_p, meta_cond_uncertainty_pp_l_p, meta_sex_cond_uncertainty_pp_l_p,
meta_base_uncertainty_pp_l_pb_sym_p, meta_sex_uncertainty_pp_l_pb_sym_p, meta_cond_uncertainty_pp_l_pb_sym_p, meta_sex_cond_uncertainty_pp_l_pb_sym_p,
meta_base_uncertainty_pp_l_pb_asym_p, meta_sex_uncertainty_pp_l_pb_asym_p, meta_cond_uncertainty_pp_l_pb_asym_p, meta_sex_cond_uncertainty_pp_l_pb_asym_p,
meta_base_uncertainty_pp_c_p, meta_sex_uncertainty_pp_c_p, meta_cond_uncertainty_pp_c_p, meta_sex_cond_uncertainty_pp_c_p,
meta_base_uncertainty_pp_c_pb_sym_p, meta_sex_uncertainty_pp_c_pb_sym_p, meta_cond_uncertainty_pp_c_pb_sym_p, meta_sex_cond_uncertainty_pp_c_pb_sym_p,
meta_base_uncertainty_pp_c_pb_asym_p, meta_sex_uncertainty_pp_c_pb_asym_p, meta_cond_uncertainty_pp_c_pb_asym_p, meta_sex_cond_uncertainty_pp_c_pb_asym_p,
b_base, b_bases, b_cond, b_conds, b_sex, b_sexs, b_sex_cond, b_sex_conds,
pos = ".GlobalEnv")
}
prepare_for_simulation <- function() {
b_base <<- b_bases[i]
b_sex <<- b_sexs[j]
b_cond <<- b_conds[k]
b_sex_cond <<- b_sex_conds[l]
meta_true_base <<- c(meta_true_base, rep(b_base, n_repeats))
meta_true_sex <<- c(meta_true_sex, rep(b_sex, n_repeats))
meta_true_cond <<- c(meta_true_cond, rep(b_cond, n_repeats))
meta_true_sex_cond <<- c(meta_true_sex_cond, rep(b_sex_cond, n_repeats))
print(paste("running simulation with parameters: b_base: ", b_base,
", b_sex: ", b_sex,
", b_cond: ", b_cond,
", b_sex_cond: ", b_sex_cond,
sep=" "))
}
tidy_chain <- function(edges, edge){
new_edge <- edge
for (i in 1:nrow(edge)){
cite <- edges %>% filter(to == edge$from[i]) #filter all the studies the node cites
if(nrow(cite)>0){ #if the cited study cites anyone
for (c in 1:nrow(cite)){
if(cite$from[c] %in% edge$from){ #if a cited study cites the same as the node
new_edge <- new_edge[!(new_edge$from == cite$from[c]),] #remove the study it cites
}
}
}
}
return(new_edge)
}