Zachary McCaw
Updated: 20-09-15
knitr::opts_chunk$set(cache = FALSE)
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.
```{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:
non_null
is the generative component, 1 if non-null, 0 if null. theta
is the estimated parameter. se
is the standard error of the estimated parameter. The true $\pi = 0.75$ and the true $\tau^{2} = 0.05$.
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)
The output of fit.WinCurse
is an object of class winCurse
with these slots.
@Assignments
containing the component assignments and normalized (0,1) assignment entropy. Higher entropy means the assignment is less certain. head(fit@Assignments)
@Estimates
containing the final parameter estimates:fit@Estimates
@Expectations
containing the posterior expected effect size given the observed effect size. The posterior expectations are shrunk towards zero. head(fit@Expectations)
@Responsibilities
containing the posterior probabilities of membership to the null and non-null components. head(fit@Responsibilities)
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.