lastbin: Histogram estimator of p-value density evaluated at 1

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function reports the density estimate of the right most bin of histogram of p-values.

Usage

1
lastbin(p, bw = 0.2, trunc = TRUE)

Arguments

p

a numeric vector the p-values

bw

numeric, the bin width of histogram of p-values

trunc

logical, indicating if the resulting estimate should be truncated to within [0,1].

Details

This is a very fast and cheap estimate of p-value density at one, with a slight positive bias, because it is only an unbiased estimate of density at the bin center, not the right bin edge. But this is usually ignorable. The function is defined as:
function(p,bw=.2,trunc=TRUE) if(trunc)max(min(1,mean(p>=1-bw)/bw),0) else mean(p>=1-bw)/bw .

Value

a single numeric value as the estimate.

Author(s)

Long Qu

See Also

qvalue, histf1

Examples

1
2
set.seed(9992722)
lastbin(runif(5e5)^1.5) ##  [1] 0.69511

pi0 documentation built on July 9, 2017, 9:01 a.m.