Git Product home page Git Product logo

sim_es-inflation-by-pub-bias's Introduction

sim_ES-inflation-by-pub-bias

This is an R script for a minimal simulation of the influence of extreme publication bias (only significant results get published) on effect sizes. I wrote this for a workshop on open science I gave at the University of Göttingen on 9th June 2017.

The first part of the script ("adjust these values", line 11-16) lets you pick a true effect size (d) and sample size (n - this is actually the group size for the two-group experiments we will simulate). After setting these, run the script down to line 61. This will simulate 10,000 two-sample t-tests with the group size you just entered, drawing from a population in which the effect size you entered is true.

Running line 65 and 66 will give you two outputs: dmin is the smallest significant effect size from the 10,000 effects you simulated. If this number is larger than the true effect size you set at the beginning, it means that you had less than 50% power to detect the true effect size (because your sample size was too small). dmean is the average of the effects that came up significant.

The last two lines of code, line 70 and 71, will give you two plots: dallplot will show you all the effects you simulated. You will see a normal distribution centred around the true effect size you set at the beginning. The true effect is marked by a red vertical line. dsigplot shows you the same plot but takes away all the effects that were not significant. If the studies you simulated were underpowered (less than 50% power for the true effect size), the red line will now be standing alone in empty space. If you are running the script in RStudio, you can use the small arrows at the top of the plot panel to switch back and forth between the two plot to see the immediate effect of extreme publication bias (suppressing all non-significant effects).

This simulation shows how publication bias inflates effect sizes: Unless power is high, significant effects tend to overestimate the true effect size. Only looking at significant effects will give us a distorted view of the true effect.

sim_es-inflation-by-pub-bias's People

Contributors

amscheel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.