Skip to content

dalejbarr/forsterUVA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R package forsterUVA

Background

This package contained reprocessed data and refactored code from the investigation by the University of Amsterdam (UvA) of the scientific integrity of publications by Jens Forster. The forsterUVA package tidies up the source data and provides standard package documentation to make the analyses reproducible.

A PDF of the UvA report by Peeters, Klassen, and van de Weil can be downloaded here.

The original R scripts on which the package is based can be downloaded in a single zip file, which is available here.

The package contains three main tables: pubs, studies, and study_stats. These were extracted from the original scripts. The table findings has the results of the statistical investigation from the original report. The findings can be reproduced using the functions deltaF.linear() and evi.val().

Installation

You need to have the add-on package devtools installed to be able to install forsterUVA.

library("devtools")

install_github("dalejbarr/forsterUVA")

Working with the package

Below are scripts showing how to reproduce the analyses in two different ways:

  1. using functions in base R, or
  2. using the add-on package dplyr.

Reproducing analyses using base R

Stats for individual studies

library("forsterUVA")
 
## calculate delta F p-value and V statistic for ea study
ss2 <- merge(studies, study_stats, c("pub", "study"))
ss2$pdF <- apply(as.matrix(ss2[, -c(1:2)]), 1, deltaFp)
ss2$V <- apply(as.matrix(ss2[, -c(1:2)]), 1, eviVal)

dat <- ss2[, c("pub", "study", "pdF", "V")]
head(transform(dat, pdF = round(pdF, 4), V = round(V, 1)), 10)
pubstudypdFV
D.JF.L09.JESPexp1.WA.NS.B10.93365.5
D.JF.L09.JESPexp1.WA.NS.B20.49271.1
D.JF.L09.JESPexp1.WA.NS.B30.46091
D.JF.L09.JESPexp1.WA.S.B10.86473.2
D.JF.L09.JESPexp1.WA.S.B20.0011
D.JF.L09.JESPexp1.WA.S.B30.04921
D.JF.L09.JESPexp1.WU.NS.B10.93736.3
D.JF.L09.JESPexp1.WU.NS.B20.88173.7
D.JF.L09.JESPexp1.WU.NS.B30.54551.2
D.JF.L09.JESPexp1.WU.S.B10.84621.5

Stats for individual publications

## overall stats for each publication
pubdata <- merge(ss2, pubs, c("pub"))
pubsplit <- split(pubdata, pubdata$pub)

pubs2 <- data.frame(pub = names(pubsplit), stringsAsFactors = FALSE)
pubs2$p <- unlist(lapply(pubsplit, combine_pdF))
pubs2$V_prod <- unlist(lapply(pubsplit, combine_V))
pubs2$n_studies <- unlist(lapply(pubsplit, nrow))
dat <- transform(merge(pubs2, pubs, by = "pub"),
                 p = round(p, 4), V_prod = round(V_prod, 4))
dat[order(dat$section, dat$pub), c("pub", "section", "p", "V_prod", "n_studies")]
pubsectionpV_prodn_studies
Hagtvedtcontrol0.30251.63842
Huntcontrol0.777611
Jiacontrol0.691111
Kantencontrol0.42361.7562
Lerougecontrol0.441114.87724
Malkoccontrol0.09525.25581
Polmancontrol0.37851.33691
Rookcontrol0.52621.69332
Smithcontrol0.29958.59487
L.JF09.JPSPJF_co, Amsterdam03131919618
WCY.JF11.JESPJF_co, Amsterdam0.681111
D.JF.L09.JESPJF_co, Bremen / Würzburg0.2544930785.467917
D.JF.LR10.PSPBJF_co, Bremen / Würzburg0.999540.737213
K.JF.D10.SPPSJF_co, Bremen / Würzburg0.01224025.80138
L.JF09.CSJF_co, Bremen / Würzburg0.108812.78416
FG.JF12.MPJF_co, others0.95617.76618
JF.D12.JESPJF_first0.0053250357.408412
JF.D12.SPPSJF_first04227517188560.1319
JF.EO09.PSPBJF_first2e-042958.29395
JF.LK08.JPSPJF_first0.626315888.18820
JF.LS09.JEPGJF_first0.0023723685.401720
JF09.JEPGJF_solo0538966994609.49821
JF10.EJSPJF_solo0.002565.02632
JF11.JEPGJF_solo0nil18

Reproducing analyses using dplyr

Stats for individual studies

library("forsterUVA")
library("dplyr")

grouped_data <- studies %>%
    inner_join(study_stats, c("pub", "study")) %>%
    group_by(pub, study)

## calculate p-value for delta F test for each study
dfp <- grouped_data %>% do(deltaFp(., TRUE)) %>% ungroup()

## calculate evidential value (V statistic) for each study
evi <- grouped_data %>% do(eviVal(., TRUE)) %>% ungroup()

## print out
dfp %>%
    inner_join(evi, c("pub", "study")) %>%
    mutate(pdF = round(pdF, 4), V = round(V, 1)) %>%
    head(10)
pubstudypdFV
D.JF.L09.JESPexp1.WA.NS.B10.93365.5
D.JF.L09.JESPexp1.WA.NS.B20.49271.1
D.JF.L09.JESPexp1.WA.NS.B30.46091
D.JF.L09.JESPexp1.WA.S.B10.86473.2
D.JF.L09.JESPexp1.WA.S.B20.0011
D.JF.L09.JESPexp1.WA.S.B30.04921
D.JF.L09.JESPexp1.WU.NS.B10.93736.3
D.JF.L09.JESPexp1.WU.NS.B20.88173.7
D.JF.L09.JESPexp1.WU.NS.B30.54551.2
D.JF.L09.JESPexp1.WU.S.B10.84621.5

Stats for individual publications

pub_groups <- dfp %>%
    inner_join(evi, c("pub", "study")) %>%
    inner_join(pubs, c("pub")) %>%
    group_by(pub, section)

## overall p value for each publication
p_vals <- pub_groups %>% do(combine_pdF(., TRUE)) %>% ungroup()

## overall V value for each publication
V_vals <- pub_groups %>% do(combine_V(., TRUE)) %>% ungroup()

## number of studies for each publication
n_studies <- pub_groups %>% summarize(n_studies = n()) %>% ungroup()

p_vals %>%
    inner_join(V_vals) %>%
    inner_join(n_studies) %>%
    mutate(p = round(p, 4), V_prod = round(V_prod, 1)) %>%
    arrange(section, pub)
pubsectionpV_prodn_studies
L.JF09.JPSPJF_co, Amsterdam03131919618
WCY.JF11.JESPJF_co, Amsterdam0.681111
D.JF.L09.JESPJF_co, Bremen / Würzburg0.2544930785.517
D.JF.LR10.PSPBJF_co, Bremen / Würzburg0.999540.713
K.JF.D10.SPPSJF_co, Bremen / Würzburg0.01224025.88
L.JF09.CSJF_co, Bremen / Würzburg0.108812.86
FG.JF12.MPJF_co, others0.95617.88
JF.D12.JESPJF_first0.0053250357.412
JF.D12.SPPSJF_first04227517188560.119
JF.EO09.PSPBJF_first2e-042958.35
JF.LK08.JPSPJF_first0.626315888.220
JF.LS09.JEPGJF_first0.0023723685.420
JF09.JEPGJF_solo0538966994609.521
JF10.EJSPJF_solo0.0025652
JF11.JEPGJF_solo0nil18
Hagtvedtcontrol0.30251.62
Huntcontrol0.777611
Jiacontrol0.691111
Kantencontrol0.42361.82
Lerougecontrol0.441114.94
Malkoccontrol0.09525.31
Polmancontrol0.37851.31
Rookcontrol0.52621.72
Smithcontrol0.29958.67

About

Reproducing UvA Analyses of Jens Förster Studies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages