Compute Winner's Curse Correction

Zachary McCaw
Updated: 20-09-15

knitr::opts_chunk$set(cache = FALSE)

Description

This package calculates the winner's curse correction using the model proposed by Turley et al (2018), implemented via the Expectation-Maximization algorithm. Also see MGMM for fitting Gaussian Mixture Models more generally.

Installation

```{R, eval = FALSE} devtools::install_github(repo = 'zrmacc/WinCurse')

## Model
See the model specification [here](https://github.com/zrmacc/WinCurse/blob/master/vignettes/Model.pdf). The parameters estimated by this package are the probability of membership to the null component $\pi$ and the variance component $\tau^{2}$ of the non-null component. 

## Examples

### Data

Example may be loaded via:

```{R}
library(WinCurse)
data(wc_data)
head(wc_data)

Here:

The true $\pi = 0.75$ and the true $\tau^{2} = 0.05$.

Estimation

To fit the winner's curse model:

fit <- fit.WinCurse(
  theta = wc_data$theta,
  se = wc_data$se,
  pi = 0.5,
  tau2 = 1,
  eps = 1e-12
)
show(fit)

Outputs

The output of fit.WinCurse is an object of class winCurse with these slots.

head(fit@Assignments)
fit@Estimates
head(fit@Expectations)
head(fit@Responsibilities)

Posterior Expectations

For pre-computed $\pi$ and $\tau^{2}$, the posterior expected effect size may be calculated via:

post_exp <- PostExp(
  theta = wc_data$theta,
  se = wc_data$se,
  pi = 0.75,
  tau2 = 0.05
)


zrmacc/WinCurse documentation built on April 2, 2021, 3:40 a.m.