manyMeans: Selective inference for many normal means

Description Usage Arguments Details Value Author(s) References Examples

View source: R/funs.manymeans.R

Description

Computes p-values and confidence intervals for the largest k among many normal means

Usage

1
manyMeans(y, alpha=0.1, bh.q=NULL, k=NULL, sigma=1, verbose=FALSE)

Arguments

y

Vector of outcomes (length n)

alpha

Significance level for confidence intervals (target is miscoverage alpha/2 in each tail)

bh.q

q parameter for BH(q) procedure

k

Number of means to consider

sigma

Estimate of error standard deviation

verbose

Print out progress along the way? Default is FALSE

Details

This function compute p-values and confidence intervals for the largest k among many normal means. One can specify a fixed number of means k to consider, or choose the number to consider via the BH rule.

Value

mu.hat

Vector of length n containing the estimated signal sizes. If a sample element is not selected, then its signal size estimate is 0

selected.set

Indices of the vector y of the sample elements that were selected by the procedure (either BH(q) or top-K). Labelled "Selind" in output table.

pv

P-values for selected signals

ci

Confidence intervals

method

Method used to choose number of means

sigma

Value of error standard deviation (sigma) used

bh.q

BH q-value used

k

Desired number of means

threshold

Computed cutoff

call

The call to manyMeans

Author(s)

Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid

References

Stephen Reid, Jonathan Taylor, and Rob Tibshirani (2014). Post-selection point and interval estimation of signal sizes in Gaussian samples. arXiv:1405.3340.

Examples

1
2
3
4
5
6
set.seed(12345)
n = 100 
mu = c(rep(3,floor(n/5)), rep(0,n-floor(n/5))) 
y = mu + rnorm(n)
out = manyMeans(y, bh.q=0.1)
out

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: intervals

Attaching package: 'intervals'

The following object is masked from 'package:Matrix':

    expand

Loading required package: survival

Call:
manyMeans(y = y, bh.q = 0.1)

Standard deviation of noise sigma = 1.000

 SelInd  MuHat P-value LowConfPt UpConfPt
      1  3.555   0.002     1.765    5.230
      2  3.687   0.001     1.923    5.354
      3  2.743   0.019     0.741    4.530
      4  2.247   0.054     0.245    4.174
      5  3.577   0.002     1.791    5.250
      7  3.603   0.001     1.822    5.275
      8  2.515   0.032     0.485    4.359
      9  2.504   0.033     0.473    4.351
     11  2.734   0.020     0.730    4.523
     12  4.817   0.000     3.158    6.462
     13  3.320   0.004     1.474    5.015
     14  3.484   0.002     1.679    5.165
     16  3.800   0.001     2.055    5.462
     18  2.434   0.038     0.405    4.302
     19  4.113   0.000     2.409    5.766
     20  3.238   0.005     1.372    4.942
     42 -1.963   0.086    -3.995   -0.055
     60 -1.901   0.095    -3.959   -0.021
     74  1.870   0.099     0.004    3.940
     84  2.133   0.066     0.162    4.100

selectiveInference documentation built on Sept. 7, 2019, 9:02 a.m.