Last updated: 2017-01-15

Code version: 92038b69c4d891ab8162d54630d341956dc6e573

First, we load the necessary libraries.

library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

Load and summarize the results of the data simulations.

load("../output/dsc-znull-files/res.znull.RData")
out <- ungroup(res %>% group_by(scenario,method) %>% 
                  summarise(gt0 = mean(logLR > 0)))
xtabs(gt0 ~ method + scenario,out)
                 scenario
method            znull.100 znull.1000
  ash.hu              0.440      0.748
  ash.hu.nw2          0.814      0.924
  ash.hu.s            0.938      0.912
  ash.hu.s.gmfine     0.932      0.908
  ash.n               0.470      0.642
  ash.n.nw2           0.570      0.736
  ash.n.s             0.484      0.514
  ash.n.s.gmfine      0.480      0.502
  ash.u               0.214      0.428
  ash.u.nw2           0.356      0.538
  ash.u.s             0.504      0.556
  ash.u.s.gmfine      0.502      0.554

Note that the ash.n.s conforms closely to the null expectation of 0.5 chi2_0 + 0.5 chi2_1 from Stram and Lee, Biometrics.

Conjecture: the uniform has the same asymptotic behaviour and the half uniform is like the sum of two of these?

From this a 95% procedure would need to check for logLR > 1.3528.

ggplot(res %>% filter(logLR > 0) %>% filter(grepl("ash.hu",method)),
       aes(sample = logLR)) + 
  facet_grid(scenario ~ method) +
  stat_qq(distribution = qchisq,dparams = list(df=1)) + 
  geom_abline() + 
  ggtitle("qqplot under null vs chisq-1; line slope=1")

ggplot(res %>% filter(logLR > 0) %>% filter(grepl("ash.u",method)),
       aes(sample = logLR)) + 
  facet_grid(scenario~method) +
  stat_qq(distribution = qchisq,dparams = list(df = 1)) + 
  geom_abline(intercept = 0,slope = 0.5) + 
  ggtitle("qqplot under null vs chisq-1; line slope=0.5")

ggplot(res %>% filter(logLR > 0) %>% filter(grepl("ash.n",method)),
       aes(sample = logLR)) + 
  facet_grid(scenario ~ method) +
  stat_qq(distribution = qchisq,dparams = list(df = 1)) + 
  geom_abline(intercept = 0,slope = 0.5) + 
  ggtitle("qqplot under null vs chisq-1; line slope=0.5")

Session information

sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.2

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_1.15.1  dplyr_0.5.0   ggplot2_2.2.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.8      magrittr_1.5     munsell_0.4.3    xtable_1.8-2    
 [5] colorspace_1.2-6 R6_2.2.0         stringr_1.1.0    plyr_1.8.4      
 [9] tools_3.3.2      grid_3.3.2       gtable_0.2.0     DBI_0.5-1       
[13] dscr_0.1.1       htmltools_0.3.5  yaml_2.1.14      lazyeval_0.2.0  
[17] rprojroot_1.1    digest_0.6.10    assertthat_0.1   tibble_1.2      
[21] shiny_0.14.2     reshape2_1.4.2   mime_0.5         evaluate_0.10   
[25] rmarkdown_1.3    labeling_0.3     stringi_1.1.2    scales_0.4.1    
[29] backports_1.0.4  httpuv_1.3.3