PoweR (version 1.0.7)

calcFx: Empirical distribution function of p-values.

Description

This function computes, at given points, the value of the empirical distribution function of a sample of \(p\)-values.

Usage

calcFx(pval.mat, x = c(seq(0.001, 0.009, by = 0.001), seq(0.01, 0.985,by = 0.005),
       seq(0.99, 0.999, by = 0.001)))

Arguments

pval.mat

matrix whose each column contains a vector of p-values for a given test statistic. The column names of this matrix should be set to the names of the various test statistics considered, whereas the rownames should all be set to the name of the distribution under which the p-values have been computed. This matrix can be obtained using function many.pval.

x

vector of points at which to evaluate the empirical distribution function.

Value

An object of class Fx is returned, which contains a list whose components are:

Fx.mat

matrix whose ith column contains the values of the empirical distribution function (evaluated at the points in vector x) of the \(p\)-values of the ith test statistic.

x

same vector x as input.

law

name of the distribution under which the p-values have been computed. Should correspond to the row names of pval.mat.

statnames

names of the test statistics. Should correspond to the column names of pval.mat.

N

number of \(p\)-values used.

Details

See equation (2) in Lafaye de Micheaux and Tran (2014).

References

Pierre Lafaye de Micheaux, Viet Anh Tran (2016). PoweR: A Reproducible Research Tool to Ease Monte Carlo Power Simulation Studies for Goodness-of-fit Tests in R. Journal of Statistical Software, 69(3), 1--42. doi:10.18637/jss.v069.i03

See Also

many.pval, plot.pvalue, plot.discrepancy, plot.sizepower

Examples

Run this code
# NOT RUN {
stind <- c(43, 44, 42)   # Indices of test statistics.
alter <-list(stat43 = 3, stat44 = 3, stat42 = 3) # Type for each test.
# Several p-values computed under the null.
pnull <- many.pval(stat.indices = stind, law.index = 1,
                        n = 100, M = 10, N = 10, alter = alter,
                        null.dist = 1,
                        method = "direct")$pvals
xnull <- calcFx(pnull)
# }

Run the code above in your browser using DataLab