rvalues {rvalues} | R Documentation |
R-values
Description
Given data on a collection of units, this function computes r-values which are percentiles constructed to maximize the agreement between the reported percentiles and the percentiles of the effect of interest. Additional details about r-values are provided below and can also be found in the listed references.
Usage
rvalues(data, family = gaussian, hypers = "estimate", prior = "conjugate",
alpha.grid = NULL, ngrid = NULL, smooth = "none", control = list())
Arguments
data |
A data frame or a matrix with the number of rows equal to the number of sampling units. The first column should contain the main estimates, and the second column should contain the nuisance terms. |
family |
An argument which determines the sampling distribution; this could be either
|
hypers |
values of the hyperparameters; only meaningful when the conjugate prior is used; if set to "estimate", the hyperparameters are found through maximum likelihood; if not set to "estimate" the user should supply a vector of length two. |
prior |
the form of the prior; either |
alpha.grid |
a numeric vector of points in (0,1); this grid is used in the discrete approximation of r-values |
ngrid |
number of grid points for alpha.grid; only relevant when |
smooth |
either |
control |
a list of control parameters for estimation of the prior; only used when the prior is nonparametric |
Details
The r-value computation assumes the following two-level sampling model
~
and
~
, for
,
with parameters of interest
, effect size estimates
,
and nuisance terms
. The form of
is determined
by the
family
argument. When family = gaussian
, it is assumed that
~ N(
.
When
family = binomial
, the represent the number of successes
and number of trials respectively, and it is assumed that
~
Binomial
. When
family = poisson
, the should be
counts, and it is assumed that
~ Poisson(
.
The distribution of the effect sizes may be a parametric distribution
that is conjugate to the corresponding
family
argument,
or it may be estimated nonparametrically. When it is desired that be
parametric (i.e.,
prior = "conjugate"
), the default is to estimate the
hyperparameters (i.e., hypers = "estimate"
), but these may be supplied by the
user as a vector of length two. To estimate nonparametrically, one
should use
prior = "nonparametric"
(see npmle
for
further details about nonparametric estimation of ).
The r-value, , assigned to the ith case of interest is determined by
inf[
]
where
is the posterior probability that
exceeds the threshold
,
and
is the upper-
th quantile associated
with the marginal distribution of
(i.e.,
Similarly,
the threshold
is the upper-
th quantile of
(i.e.,
).
Value
An object of class "rvals" which is a list containing at least the following components:
main |
a data frame containing the r-values, the r-value rankings along with the rankings from several other common procedures |
aux |
a list containing other extraneous information |
rvalues |
a vector of r-values |
Author(s)
Nicholas C. Henderson and Michael A. Newton
References
Henderson, N.C. and Newton, M.A. (2016). Making the cut: improved ranking and selection for large-scale inference. J. Royal Statist. Soc. B., 78(4), 781-804. doi: 10.1111/rssb.12131 https://arxiv.org/abs/1312.5776
See Also
rvaluesMCMC
, PostSummaries
, Valpha
Examples
## Not run:
### Binomial example with Beta prior:
data(fluEnrich)
flu.rvals <- rvalues(fluEnrich, family = binomial)
hist(flu.rvals$rvalues)
### look at the r-values for indices 10 and 2484
fig_indices <- c(10,2484)
fluEnrich[fig_indices,]
flu.rvals$rvalues[fig_indices]
### Gaussian sampling distribution with nonparametric prior
### Use a maximum of 5 iterations for the nonparam. estimate
data(hiv)
hiv.rvals <- rvalues(hiv, prior = "nonparametric")
## End(Not run)