-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMetaCorrect.html
More file actions
838 lines (740 loc) · 47.9 KB
/
MetaCorrect.html
File metadata and controls
838 lines (740 loc) · 47.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
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<title>How Effective are Methods of Correction for Publication Bias?</title>
<script src="site_libs/header-attrs-2.14/header-attrs.js"></script>
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/flatly.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<link href="site_libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">code{white-space: pre;}</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}
</style>
<style type="text/css">
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #adb5bd;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script type="text/javascript">
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.tab('show');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
</head>
<body>
<div class="container-fluid main-container">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-bs-toggle="collapse" data-target="#navbar" data-bs-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">The Social Science Knowledge Accumulation Initiative</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="Interventions.html">Evidence on Interventions</a>
</li>
<li>
<a href="Theories.html">Evidence on Theories</a>
</li>
<li>
<a href="methods.html">Methods</a>
</li>
<li>
<a href="about.html">About</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div id="header">
<h1 class="title toc-ignore">How Effective are Methods of Correction for Publication Bias?</h1>
</div>
<p><a href="https://chabefer.github.io/STCI/sec-meta.html#publication-bias-and-site-selection-bias">Publication bias</a> generates <a href="Pvalues.html">adverse aggregate outcomes for science</a>. There are several attempts at solving the issue of publication bias, noth before (ex-ante) and after (ex-post) publication of the results. Ex ante, one solution to fight publication bias is to commit to a pre-analysis plan before seeing the data and to commit to publish the results of every analysis whatever their results, a solution generally called pre-registration. Ex-post, <a href="https://chabefer.github.io/STCI/sec-meta.html#detection-of-and-correction-for-publication-bias">several methods</a> have been proposed to try to recover the true effect from data plagued by publication bias. A key question is whether these methods are able to do what they were designed for, namely to correct for publication bias. In <a href="https://www.gwern.net/docs/statistics/bias/2019-kvarven.pdf">an innovative and insightful paper</a> <a href="https://www.nature.com/articles/s41562-019-0787-z">published by Nature Human Behavior</a>, Kvarven, Stromland and Johannesson have proposed a deceptively simple but extremely efficient way to test for the validity of ex-post methods of correction for publication bias. Their idea is simply to compare what is obtained when implementing correction ex-post to the estimate obtained by using ex-ante methods. In order to implement their approach, they gather data from 11 meta-analysis of published results in psychology and compare them with the results of pre-registered replications of the same effects. The interpretation of the results is <a href="https://economistjourney.blogspot.com/2020/01/how-large-is-publication-bias-and-can.html">subject to debate</a>, but there seems to be a good grounds for concluding that, of the three methods compared, two fail to decrease bias in any way (Trim-and-Fill and selection models), while one is able to reach unbiasedness and to significantly decrease prediction error (FAT-PET-PEESE). In this article, I reproduce their results and extend them to methods of correction for publication bias that did not consider (namely the most recent version of FAT-PET-PEESE and p-curving).</p>
<div id="performance-of-alternative-methods-of-correction-for-publication-bias" class="section level1">
<h1>Performance of alternative methods of correction for publication bias</h1>
</div>
<div id="analysis-of-each-separate-dataset" class="section level1">
<h1>Analysis of each separate dataset</h1>
<p>In this section, we look at each dataset separately. We start by downloading the aggregated dataset where a lot of information is stored already.</p>
<pre class="r"><code># download dataset from SQL server
Aggregate <- dbReadTable(Kvarven.db,"Aggregate")</code></pre>
<div id="belle-dataset" class="section level2">
<h2>Belle dataset</h2>
<pre class="r"><code># download dataset from SQL server
Belle <- dbReadTable(Kvarven.db,"Belle")
# get the comment associated with the study, so that we know what it is about
Belle.description <- dbGetQuery(Kvarven.db,"
SELECT table_comment
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema='Kvarven'
AND table_name='Belle';")
# get the original study, the meta-analysis and the replication
Belle.papers <- Aggregate %>%
filter(str_detect(metaanalysis,"Belle")==TRUE) %>%
select(original,replication,metaanalysis)</code></pre>
<p>The Belle dataset is a Dataset for the meta-analysis of self-concept maintenance originally studied by Mazar et al. (2008). The original study is by Mazar et al. (2008). The meta-analysis is by Belle & Cantarelli (2017). The replication is by NA. The fact that the identity of the replicator is unknown was already the case in the original Kvarven study.</p>
<div id="fat-pet-peese" class="section level3">
<h3>FAT-PET-PEESE</h3>
<p>In this section, we are looking at how the Belle dataset behaves with the <a href="https://chabefer.github.io/STCI/sec-meta.html#detection-of-and-correction-for-publication-bias">FAT-PET-PEESE method of Stanley and Docouliagos</a>. There are three ways that we can FAT-PET-PEESE: using a Fixed Effects (FE) meta-analysis, a Random Effects (RE) meta-analysis and Weighted Least Squares (WLS). Recently, <a href="https://doi.org/10.1002/jrsm.1211">Stanley and Docouliago</a> have argued that the WLS approach was the best one. WLS obtains the same estimated effect size as FE, but it computes its estimate of the standard error by taking into account inter-study variability, as RE does.</p>
<pre class="r"><code># weights for WLS estimator
Belle <- Belle %>%
mutate(weightsWLS=(1/v)/(sum(1/v)))
# WLS Meta estimator
Belle.WLS.Meta <- lm(d~1,weights = weightsWLS,data=Belle)
# WLS FAT PET estimator
Belle.WLS.FAT.PET <- lm(d~sed,weights = weightsWLS,data=Belle)
# WLS PEESE estimator
Belle.WLS.PEESE <- lm(d~v,weights = weightsWLS,data=Belle)
# FE Meta Estimator
Belle.FE.Meta <- rma(yi=d,vi=v,data=Belle,method="FE")
# FE FAT PET estimator
Belle.FE.FAT.PET <- rma(d~sed,vi=v,data=Belle,method="FE")
# FE PEESE estimator
Belle.FE.PEESE <- rma(d~v,vi=v,data=Belle,method="FE")
# RE Meta Estimator
Belle.RE.Meta <- rma(yi=d,vi=v,data=Belle,method="REML")
# RE FAT PET estimator
Belle.RE.FAT.PET <- rma(d~sed,vi=v,data=Belle,method="REML")
# RE PEESE estimator
Belle.RE.PEESE <- rma(d~v,vi=v,data=Belle,method="REML")
# plot of results
colors <- c("MetaAnalysisOriginal"="red","Replication"="blue","MetaAnalysisWLS"="green","MetaAnalysisRE"="purple")
lines <- c("FATPETWLS"="solid","PEESEWLS"="dashed","FATPETRE"="dotted","PEESERE"="dotdash")
ggplot(Belle,aes(x=sed,y=d))+
geom_point()+
xlim(0,0.5)+
ylim(-0.1,1)+
theme_bw()+
xlab("Standard error")+
ylab("Effect size")+
geom_hline(aes(yintercept=Aggregate %>%
filter(str_detect(metaanalysis,"Belle")==TRUE) %>%
select(meta_s) %>%
as.numeric(),colour="MetaAnalysisOriginal"))+
geom_hline(aes(yintercept=Aggregate %>%
filter(str_detect(metaanalysis,"Belle")==TRUE) %>%
select(replication_s) %>%
as.numeric(),colour="Replication")) +
geom_hline(aes(yintercept=coef(Belle.WLS.Meta)[[1]],colour="MetaAnalysisWLS"))+
geom_hline(aes(yintercept=coef(Belle.RE.Meta)[[1]],colour="MetaAnalysisRE"))+
stat_function(fun=function(x){coef(Belle.WLS.FAT.PET)[1] + coef(Belle.WLS.FAT.PET)[2]*x},aes(linetype="FATPETWLS"),color="black")+
stat_function(fun=function(x){coef(Belle.WLS.PEESE)[1] + coef(Belle.WLS.PEESE)[2]*x^2},aes(linetype="PEESEWLS"),color="black")+
stat_function(fun=function(x){coef(Belle.RE.FAT.PET)[1] + coef(Belle.RE.FAT.PET)[2]*x},aes(linetype="FATPETRE"),color="black")+
stat_function(fun=function(x){coef(Belle.RE.PEESE)[1] + coef(Belle.RE.PEESE)[2]*x^2},aes(linetype="PEESERE"),color="black")+
scale_colour_manual("Estimate",values = colors)+
scale_linetype_manual("Method",values = lines)</code></pre>
<div class="figure" style="text-align: center">
<img src="MetaCorrect_files/figure-html/BellePEESE-1.png" alt="FAT-PET-PEESE estimation for the Belle dataset" width="20%" />
<p class="caption">
FAT-PET-PEESE estimation for the Belle dataset
</p>
</div>
<p>Figure @ref(fig:BellePEESE) shows the result of the FAT-PET-PEESE analysis applied to the Belle dataset. This data set is characterized by severe publication bias, since the estimated meta-analytical effect is of 0.43 while the effect estimated after the pre-registered replications is of -0.04.</p>
<p>How does FAT-PET-PEESE perform? Let’s focus on the WLS results. The FAT test detects funnel asymmetry: we see that the slope of the FATPETWLS curve is downward sloping, indicating that less precise results have larger effect sizes. The slope of the FAT-PET curve is equal to 2.47 <span class="math inline">\(\pm\)</span> 2.66 The p-value of the one-sided test that this value is zero against the alternative assumption that it is positive is equal to 0.03 when using the normal approximation to the distribution of the parameter. So we reject the absence of publication bias.</p>
<p>Now, what is the FAT-PET-PEESE estimate corrected for publication bias? It depends on whether the PET estimate is different from zero or not. If it is not, then the PET estimate is the publication bias corrected estimate. If the PET estimate is different from zero, we look at the PEESE estimate. The PET estimate is of -0.08 <span class="math inline">\(\pm\)</span> 0.54. This obviously is not significantly different from zero, and thus becomes our preferred estimate of the treatment effect. Despite is large imprecision, this estimate is in reality extremely close to the truth of -0.04.</p>
<p>Let’s send the results to the SQL dataset. I’m going to send the results in the SKY database using as a benchmark the summary table of results in the original Kvarven dataset.</p>
<pre class="r"><code># send the table with the main initial data
dbWriteTable(SKY.db,"MetaCorrect",Aggregate %>% select(id,original,replication,metaanalysis,replication_s,meta_s,ser,sem),row.names=FALSE,overwrite=TRUE)
# explain name of variable
dbSendQuery(SKY.db,"
ALTER TABLE `SKY`.`MetaCorrect`
CHANGE COLUMN `original` `original` TEXT NULL DEFAULT NULL COMMENT 'Name of the original paper.' ,
CHANGE COLUMN `replication` `replication` TEXT NULL DEFAULT NULL COMMENT 'Name of the replication paper.' ,
CHANGE COLUMN `metaanalysis` `metaanalysis` TEXT NULL DEFAULT NULL COMMENT 'Name of the meta-analysis paper.' ,
CHANGE COLUMN `replication_s` `replication_s` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated in the replication.' ,
CHANGE COLUMN `meta_s` `meta_s` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated in the meta-analysis.' ,
CHANGE COLUMN `ser` `ser` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect size (Cohen d) estimated in the replication.' ,
CHANGE COLUMN `sem` `sem` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect size (Cohen d) estimated in the meta-analysis.' ,
COMMENT = 'Results of the methods correcting for publication bias.' ;")
# create a new column in the SQL table for the results of FATPETPEESE
dbSendQuery(SKY.db,"
ALTER TABLE `SKY`.`MetaCorrect`
ADD COLUMN `fatpetpeese_s` DOUBLE NULL DEFAULT NULL AFTER `meta_s`,
ADD COLUMN `sef` DOUBLE NULL DEFAULT NULL AFTER `sem`
;")
# comment on the names of the new column
dbSendQuery(SKY.db,"
ALTER TABLE `SKY`.`MetaCorrect`
CHANGE COLUMN `fatpetpeese_s` `fatpetpeese_s` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated with FATPETPEESE',
CHANGE COLUMN `sef` `sef` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect size (Cohen d) estimated with FATPETPEESE'
;")
# sending the Belle results to the new SQL table in SKY
dbSendQuery(SKY.db,paste("
UPDATE `SKY`.`MetaCorrect`
SET
`fatpetpeese_s` = ",coef(Belle.WLS.FAT.PET)[[1]],",
`sef` = ",sqrt(diag(vcov(Belle.WLS.FAT.PET)))[[1]],"
WHERE
SUBSTRING_INDEX(metaanalysis,' ',1)='Belle'
;",sep=""))</code></pre>
<p><strong>It would be great to recover the original individual replication estimates to enrich Figure @ref(fig:BellePEESE).</strong></p>
</div>
<div id="p-curving" class="section level3">
<h3>P-curving</h3>
<p><a href="https://chabefer.github.io/STCI/sec-meta.html#detection-of-and-correction-for-publication-bias">P-curving</a> uses the distribution of the statistically significant p-values to test for the existence of a real effect and to correct for it. The first step in a p-curving analysis is to generate p-values (in generate for the two-sided t-test of absence of effect) and to derive the distribution of the significant p-values. In the absence of any impact, the significant p-values should be distributed uniformly. In the presence of a real effect, the distribution of the significant p-values should exhibit a peak at lower p-values. In case there are Questionable Research Practices, the distribution of significant p-values exhibits a peak close to 0.05. Let’s see what happens.</p>
<pre class="r"><code># create the p-values for the two-sided t-test that the effect size is zero
Belle <- Belle %>%
mutate(
tstat = d/sed,
pvalue= 2*(1-pnorm(tstat)))
# function that generates the proportion of significant pvalues in two half intervals
p_value_prop <- function(pvalues){
pvaluessig <- pvalues[pvalues<=0.05]
p.upper <- ifelse(pvaluessig>0.025,1,0)
p.lower <- ifelse(pvaluessig<=0.025,1,0)
p.upper.prop <- sum(p.upper)/length(pvaluessig)
p.lower.prop <- sum(p.lower)/length(pvaluessig)
return(c(p.lower.prop, p.upper.prop))
}
prop_pval <- p_value_prop(Belle$pvalue)
intervals <- c("[0,0.025]","[0.025,0.05]")
ggplot(, aes(x = intervals, prop_pval)) +
geom_bar(stat="identity", fill="steelblue") +
theme_minimal() +
scale_x_discrete() +
geom_text(aes(label=round(prop_pval, 2)), vjust=1.6, color="white", size=3.5) +
labs(x = "Intervals", y = "Proportion")</code></pre>
<div class="figure" style="text-align: center">
<img src="MetaCorrect_files/figure-html/BellePcurve-1.png" alt="Simple p-curve for the Belle dataset" width="75%" />
<p class="caption">
Simple p-curve for the Belle dataset
</p>
</div>
<p>Figure @ref(fig:BellePcurve) shows that, from a p-curve perspective, there does seem to be genuine evidence of an effect in this meta-analysis. Let’s look at the full distribution of the p-values and compare it to a flat p-curve and a p-curve with a true effect.</p>
<pre class="r"><code>MDE.var <- function(alpha=0.05,kappa=0.33,varE=1){
return((qnorm(kappa)+qnorm(1-alpha/2))*sqrt(varE))
}
ppCurvePower <- function(p1,p2,alpha=0.05,kappa=0.33,varE=1){
return((pnorm(MDE.var(alpha=alpha,kappa=kappa)-qnorm(1-p2/2))
-pnorm(MDE.var(alpha=alpha,kappa=kappa)-qnorm(1-p1/2)))/kappa)
}
pCurve.hist <- function(pvalues,power=.33){
pvaluessig <- pvalues[pvalues<=0.05]
dens1 <- sum(ifelse(abs(pvaluessig-0.005)<0.005,1,0)/length(pvaluessig))
dens2 <- sum(ifelse(abs(pvaluessig-0.015)<0.005,1,0)/length(pvaluessig))
dens3 <- sum(ifelse(abs(pvaluessig-0.025)<0.005,1,0)/length(pvaluessig))
dens4 <- sum(ifelse(abs(pvaluessig-0.035)<0.005,1,0)/length(pvaluessig))
dens5 <- sum(ifelse(abs(pvaluessig-0.045)<0.005,1,0)/length(pvaluessig))
dens <- c(dens1,dens2,dens3,dens4,dens5)
p.hist.1 <- cbind(c(0.01,0.02,0.03,0.04,0.05),dens)
p.hist.1 <- as.data.frame(p.hist.1)
colnames(p.hist.1) <- c('p','density')
p.hist.1$Data <- c("Observed")
p.hist.2 <- cbind(c(0.01,0.02,0.03,0.04,0.05),0.2)
p.hist.2 <- as.data.frame(p.hist.2)
colnames(p.hist.2) <- c('p','density')
p.hist.2$Data <- c("Uniform")
dens331 <- ppCurvePower(0,0.01)
dens332 <- ppCurvePower(0.01,0.02)
dens333 <- ppCurvePower(0.02,0.03)
dens334 <- ppCurvePower(0.03,0.04)
dens335 <- ppCurvePower(0.04,0.05)
dens33 <- c(dens331,dens332,dens333,dens334,dens335)
p.hist.3 <- cbind(c(0.01,0.02,0.03,0.04,0.05),dens33)
p.hist.3 <- as.data.frame(p.hist.3)
colnames(p.hist.3) <- c('p','density')
p.hist.3$Data <- c("Power33")
p.hist <- rbind(p.hist.1,p.hist.2,p.hist.3)
return(p.hist)
}
p.hist <- pCurve.hist(Belle$pvalue)
p.hist$Data <- factor(p.hist$Data,levels=c("Observed","Uniform","Power33"))
ggplot(data=p.hist, aes(x=p, y=density, color=Data)) +
geom_point() +
geom_line() +
theme_bw()</code></pre>
<div class="figure" style="text-align: center">
<img src="MetaCorrect_files/figure-html/BellePcurveFull-1.png" alt="Full p-curve for the Belle dataset" width="75%" />
<p class="caption">
Full p-curve for the Belle dataset
</p>
</div>
<p>Figure @ref(fig:BellePcurveFull) suggests confirms that, for the p-curve approach, there is evidence in favor of a genuine true effect, close to the effect that would give 33% power. Let’s see whether a formal test confirms that.</p>
<pre class="r"><code>pp.test <- function(pvalues,alter='True'){
pvaluessig <- pvalues[pvalues<=0.05]
pp <- pvaluessig/0.05
if (alter=='QRP'){
pp <- 1 - pp
}
Fpp <- -2*sum(log(pp)) # Chi-square statistic
dfChis <- 2*length(pvaluessig)
pChisquare.Fpp <- pchisq(Fpp,dfChis,lower.tail=F) # Corresponding p-value
qChisquare.5 <- qchisq(0.05,dfChis,lower.tail=F)
return(c(pChisquare.Fpp,Fpp,dfChis,qChisquare.5))
}
# Only including p-values in [0,0.05] interval.
#I checked that I did in fact got rid of them all by contrasting with excel file since sample is small.
pp.ex.sig.True <- pp.test(Belle$pvalue) # p-value close to 0, Chi statistic of 275.1
pp.ex.sig.QRP <- pp.test(Belle$pvalue, alter = 'QRP') # p-value of 0.993 and Chi statistic of 12.75</code></pre>
<p>The p-value for the null hypothesis that there is no effect is of 0.01, 41.95, 22, 33.92 while the p-value for the null that there are QRPs is of 0.93, 13.18, 22, 33.92. Clearly, p-curves seems to detect a true effect here.</p>
<p>Finally, let’s implement the p-curve correction for publication bias.</p>
<pre class="r"><code>ppCurveEst <- function(thetac,thetak,sigmak,alpha=0.05){
return((pnorm((thetac-thetak)/sigmak)/pnorm(thetac/sigmak-qnorm(1-alpha/2))))
}
#KS statistic
KS.stat.unif <- function(vector){
return(ks.test(x=vector,y=punif)$statistic)
}
ppCurve.Loss.KS <- function(thetac,thetak,sigmak,alpha=0.05){
ppvalues <- ppCurveEst(thetac=thetac,thetak=thetak,sigmak=sigmak,alpha=alpha)
return(KS.stat.unif(ppvalues))
}
#Estimating thetac that minimizes the KS distance by brute grid search first
# will program the optimize function after
ppCurveEstES <- function(thetak,sigmak,thetacl,thetach,alpha=0.05,ngrid=100){
# keep significant coefficients and standard errors
thetaksig <- thetak[2*(1-pnorm(thetak/sigmak))<=0.05]
sigmaksig <- sigmak[2*(1-pnorm(thetak/sigmak))<=0.05]
# break thetac values in a grid
thetac.grid <- seq(from=thetacl,to=thetach,length.out=ngrid)
# computes the ppcurve for each point of the grid: outputs a matrix where columns are the ppcurves at each values of thetac
ppCurve.grid <- sapply(thetac.grid,ppCurveEst,thetak=thetaksig,sigmak=sigmaksig,alpha=alpha)
# compute KS stat for each value of thetac (over columns)
KS.grid <- apply(ppCurve.grid,2,KS.stat.unif)
# computes the value of thetac for which the KS stat is minimum (match identifies the rank of the min in the KSgrid)
min.theta.c <- thetac.grid[match(min(KS.grid),KS.grid)]
# optimizes over KS stat to find value of thetac that minimizes the KS stat
thetahat <- optimize(ppCurve.Loss.KS,c(min.theta.c-0.1,min.theta.c+0.1),thetak=thetaksig,sigmak=sigmaksig,alpha=alpha)
# returns the optimal thetac, the grid of thetac, the KS stats on the grid, for potential plot, and the ecdf of ppvalues at the optimum theta for graph against the uniform
return(list(thetahat$minimum,thetac.grid,KS.grid,ecdf(ppCurve.grid[,match(min(KS.grid),KS.grid)])))
}
test <- ppCurveEstES(thetak=Belle$d,sigmak = Belle$sed ,thetacl=0,thetach=10,alpha=0.05,ngrid=50)</code></pre>
<p>The p-curve bias-corrected estimate is of 0.27. Lower than the meta-analytic estimate but still pretty far off.</p>
<p>Let’s send the results to the SQL dataset.</p>
<pre class="r"><code># create a new column in the SQL table for the results of Pcurve
dbSendQuery(SKY.db,"
ALTER TABLE `SKY`.`MetaCorrect`
ADD COLUMN `pcurve_s` DOUBLE NULL DEFAULT NULL AFTER `fatpetpeese_s`
;")
# comment on the names of the new column
dbSendQuery(SKY.db,"
ALTER TABLE `SKY`.`MetaCorrect`
CHANGE COLUMN `pcurve_s` `pcurve_s` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated with Pcurve'
;")
# sending the Belle results to the new SQL table in SKY
dbSendQuery(SKY.db,paste("
UPDATE `SKY`.`MetaCorrect`
SET
`pcurve_s` = ",test[[1]],"
WHERE
SUBSTRING_INDEX(metaanalysis,' ',1)='Belle'
;",sep=""))</code></pre>
</div>
</div>
</div>
<div id="data" class="section level1">
<h1>Data</h1>
<p>The data comes from the <a href="https://osf.io/8qvgp/">OSF webpage of the Kvarven et al paper</a>. In this section, I download the original data and send it to SKY’s SQL server. In order to so, I’ve had to <a href="https://osf.io/vsnu5/">fork the original project</a>, because the <code>osfr</code> package would not connect me to the original project. This is not optimal since I will miss future potential updates of the project.</p>
<pre class="r"><code># Authentication on OSF (provide your own OSF authentication key here)
#osf_auth(OSFauth)
# path of forked project on OSF
#OSFid <- "vsnu5"
# finding the project on OSF
#kvarven.project <- osf_retrieve_node(paste("https://osf.io",OSFid,sep="/"))
# dowloading data in working directory
#osf_download(osf_ls_files(kvarven.project)[1,])
# extracting data
#unzip(osf_ls_files(kvarven.project)[[1,1]])
# this returns an error message since the name of one of the files to unzip contains a character in central European DOS Latin 2 encoding ("ü")
# I've had to extract manually the files and then to change the name of the file to "u" so that no similar problem happens.</code></pre>
<pre class="r"><code># summary file with main results of meta-analysis and replications
# path to access the file
path <- "./Corrected data May 2020/"
# uploading the file
data.tot <- read_excel(paste(path,"Dataset.xls",sep=""))
# correcting one character that messes up in SQL
data.tot$metaanalysis[[2]] <- "Kuhberger (1998)"
# taking out unnecessary lines and columns
data.tot <- as.data.frame(data.tot[1:15,1:21])
# sending to SQL
dbWriteTable(Kvarven.db,"Aggregate",data.tot,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,"
ALTER TABLE `Kvarven`.`Aggregate`
CHANGE COLUMN `row_names` `id` SMALLINT(2) NULL DEFAULT NULL COMMENT 'Id of the study' ,
CHANGE COLUMN `original` `original` TEXT NULL DEFAULT NULL COMMENT 'Name of the original paper.' ,
CHANGE COLUMN `replication` `replication` TEXT NULL DEFAULT NULL COMMENT 'Name of the replication paper.' ,
CHANGE COLUMN `metaanalysis` `metaanalysis` TEXT NULL DEFAULT NULL COMMENT 'Name of the meta-analysis paper.' ,
CHANGE COLUMN `effecto` `effecto` DOUBLE NULL DEFAULT NULL COMMENT 'Effect estimated in the original meta-analysis (in original units). (I guess)' ,
CHANGE COLUMN `originalinc` `originalinc` TINYINT(1) NULL DEFAULT NULL COMMENT 'Is the original study included in the meta-analysis? (1= yes, 0= No)' ,
CHANGE COLUMN `replication_inc` `replication_inc` TINYINT(1) NULL DEFAULT NULL COMMENT 'Is the replication included in the meta-analysis? (1= yes, 0= No)' ,
CHANGE COLUMN `noconvert` `noconvert` TINYINT(1) NULL DEFAULT NULL COMMENT 'I do not know what this means.' ,
CHANGE COLUMN `publi` `publi` TINYINT(1) NULL DEFAULT NULL COMMENT 'Has the replication been published? (1= yes, 0= no) (I guess)' ,
CHANGE COLUMN `tausqrm` `tausqrm` TINYINT(1) NULL DEFAULT NULL COMMENT 'Inter-study variability in the original meta-analysis (I guess).' ,
CHANGE COLUMN `originalu` `originalu` TINYINT(1) NULL DEFAULT NULL COMMENT 'I do not know what this means.' ,
CHANGE COLUMN `replication_s` `replication_s` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated in the replication.' ,
CHANGE COLUMN `meta_s` `meta_s` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated in the meta-analysis.' ,
CHANGE COLUMN `ser` `ser` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect size (Cohen d) estimated in the replication.' ,
CHANGE COLUMN `sem` `sem` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect size (Cohen d) estimated in the meta-analysis.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the difference in estimated effect size (Cohen d) between the meta-analysis and the replication.' ,
CHANGE COLUMN `weight` `weight` TINYINT(1) NULL DEFAULT NULL COMMENT 'I do not know what that means.' ,
CHANGE COLUMN `ml` `ml` TINYINT(1) NULL DEFAULT NULL COMMENT 'I do not know what that means.' ,
CHANGE COLUMN `threepsm` `threepsm` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) estimated using the selection model method.' ,
CHANGE COLUMN `threepsmse` `threepsmse` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect size (Cohen d) estimated using the selection model method.' ,
CHANGE COLUMN `diff` `diff` DOUBLE NULL DEFAULT NULL COMMENT 'Difference in estimated effect size (Cohen d) between the meta-analysis and the replication. (I guess)' ,
CHANGE COLUMN `seo` `seo` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the effect estimated in the original meta-analysis (in original units). (I guess)' ,
COMMENT = 'Table with the aggregate data of the Kvarven paper.' ;")
# Files for individual studies
# path to files
path <- "./Corrected data May 2020/Meta/"
# names of the datasets
files <- c("Belle","Blanken","Coles","DeCoster","Felts","Hagger","Henriksson","Kivikangas","Kuhberger","Meissner","Miles","Rabelo","Rand","Roth","Schimmack")
# separators used in the data files
sep.data <- c(",",rep(";",8),",",rep(";",5))
# Belle dataset
Belle <- read.csv(paste(path,files[1],".csv",sep=""),sep=sep.data[1])
dbWriteTable(Kvarven.db,files[1],Belle %>% select("d","v","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Belle`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of self-concept maintenance originally studied by Mazar et al. (2008)' ;")
# Blanken dataset
Blanken <- read.csv(paste(path,files[2],".csv",sep=""),sep=sep.data[2])
dbWriteTable(Kvarven.db,files[2],Blanken %>% select("d","var","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Blanken`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `var` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of moral credentials and the expression of prejudice originally studied by Monin & Miller (2001)' ;")
# Coles dataset
Coles <- read.csv(paste(path,files[3],".csv",sep=""),sep=sep.data[3])
dbWriteTable(Kvarven.db,files[3],Coles,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Coles`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `es` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `se` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of the facial feedback hypothesis originally studied by Strack et al. (1988)' ;")
# DeCoster dataset
DeCoster <- read.csv(paste(path,files[4],".csv",sep=""),sep=sep.data[4])
dbWriteTable(Kvarven.db,files[4],DeCoster %>% select("d","v","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`DeCoster`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of the category accessibility hypothesis originally studied by Srull et al. (1979)' ;")
# Felts dataset
Felts <- read.csv(paste(path,files[5],".csv",sep=""),sep=sep.data[5])
dbWriteTable(Kvarven.db,files[5],Felts %>% select("d","v","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Felts`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of the dissociation between moral judgments and justifications originally studied by Hauser et al. (2007)' ;")
# Hagger dataset
Hagger <- read.csv(paste(path,files[6],".csv",sep=""),sep=sep.data[6])
dbWriteTable(Kvarven.db,files[6],Hagger %>% select("d","v","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Hagger`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of Methylphenidate and effort-induced depletion of regulatory control originally studied by Sripada et al. (2014)' ;")
# Henriksson dataset
Henriksson <- read.csv(paste(path,files[7],".csv",sep=""),sep=sep.data[7])
dbWriteTable(Kvarven.db,files[7],Henriksson,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Henriksson`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of incidental environmental anchors originally studied by Critcher & Gilovich (2008)' ;")
# Kivikangas dataset
Kivikangas <- read.csv(paste(path,files[8],".csv",sep=""),sep=sep.data[8])
dbWriteTable(Kvarven.db,files[8],Kivikangas,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Kivikangas`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `SE` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of the moral foundations of liberals and conservatives originally studied by Graham et al. (2009)' ;")
# Kuhberger dataset
Kuhberger <- read.csv(paste(path,files[9],".csv",sep=""),sep=sep.data[9])
dbWriteTable(Kvarven.db,files[9],Kuhberger,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Kuhberger`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of the framing of decisions originally studied by Tversky & Kahneman (1981)' ;")
# Meissner dataset
Meissner <- read.csv(paste(path,files[10],".csv",sep=""),sep=sep.data[10])
dbWriteTable(Kvarven.db,files[10],Meissner %>% select("d","v","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Meissner`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of the verbal overshadowing of visual memories originally studied by Schooler & Engstler-Schooler (1990)' ;")
# Miles dataset
Miles <- read.csv(paste(path,files[11],".csv",sep=""),sep=sep.data[11])
dbWriteTable(Kvarven.db,files[11],Miles %>% select("d","v","sed"),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Miles`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of elaboration and the imagined contact effect originally studied by Husnu & Crisp (2010)' ;")
# Rabelo dataset
Rabelo <- read.csv(paste(path,files[12],".csv",sep=""),sep=sep.data[12])
dbWriteTable(Kvarven.db,files[12],Rabelo,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Rabelo`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of weight as an embodiment of importance originally studied by Jostmann et al. (2009)' ;")
# Rand dataset
Rand <- read.csv(paste(path,files[13],".csv",sep=""),sep=sep.data[13])
dbWriteTable(Kvarven.db,files[13],Rand,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Rand`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of spontaneous giving and calculated greed originally studied by Rand et al. (2012)' ;")
# Roth dataset
Roth <- read.csv(paste(path,files[14],".csv",sep=""),sep=sep.data[14])
dbWriteTable(Kvarven.db,files[14],Roth,overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Roth`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `d` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `v` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `sed` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of instructional manipulation checks and satisficing originally studied by Oppenheimer et al. (2009)' ;")
# Schimmack dataset
Schimmack <- read.csv(paste(path,files[15],".csv",sep=""),sep=sep.data[15])
dbWriteTable(Kvarven.db,files[15],Schimmack %>% select(q,Var.q.,SE.q.),overwrite=TRUE,row.names=TRUE)
dbSendQuery(Kvarven.db,
"ALTER TABLE `Kvarven`.`Schimmack`
CHANGE COLUMN `row_names` `id` SMALLINT(4) NULL DEFAULT NULL COMMENT 'Id of the result' ,
CHANGE COLUMN `q` `d` DOUBLE NULL DEFAULT NULL COMMENT 'Effect size (Cohen d) in units of standard deviation.' ,
CHANGE COLUMN `Var.q.` `v` DOUBLE NULL DEFAULT NULL COMMENT 'Variance of the estimated effect size.' ,
CHANGE COLUMN `SE.q.` `sed` DOUBLE NULL DEFAULT NULL COMMENT 'Standard error of the estimated effect size.' ,
COMMENT = 'Dataset for the meta-analysis of assimilation and contrast effects originally studied by Schwarz et al. (1991)' ;")</code></pre>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open');
});
});
</script>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>