optimal_group: Obtain optimal number of groups and degrees of freedom

Description Usage Arguments Details Value Author(s) Examples

View source: R/optimal_group.R

Description

A function to obtain the optimal number of groups and the spline degrees of freedom from the p-values and the filters by applying the smooting spline regression

Usage

1
2
3
optimal_group(group = 5L, pvalue, filter, h_breaks = 71L, m, m1,
  alpha = 0.05, mean_testEffect, effectType = c("continuous", "binary"),
  method = c("BH", "BON"))

Arguments

group

number of groups to be used to split the p-values, default is five

pvalue

a vector of pvalues of the test statistics

filter

a vector of filter statistics

h_breaks

number of breaks to be used for the histogram, default is 71

m

total number of tests

m1

number of true alternatve tests

alpha

significance level of the hypothesis test

mean_testEffect

mean test effect of the true alterantives

effectType

type of effect sizes; c("continuous", "binary")

method

type of methods is used to obtain the results; c("BH", "BON"), Benjemini-Hochberg or Bonferroni

Details

Optimal group and degrees of freedom of the spline regression is a vital parameter to maximize the number of rejections. This function uses smooting spline regresion to obtain that.

Value

the number of rejected tests and the corresponding Optimal number of groups and the degrees of freedom of the spline smo0thing

Author(s)

Mohamad S. Hasan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# generate pvalues and filter statistics
m = 10000
set.seed(3)
filters = runif(m, min = 0, max = 2.5)          # filter statistics
H = rbinom(m, size = 1, prob = 0.1)             # hypothesis true or false
tests = rnorm(m, mean = H * filters)            # Z-score
pvals = 1 - pnorm(tests)                        # pvalue

results <- optimal_group(group = 10, pvalue = pvals, filter = filters,
             h_breaks = 71, m = m, m1 = 8000, alpha = .05,
             mean_testEffect = 2.5, effectType = "continuous", method = "BH")

mshasan/empOPW documentation built on March 1, 2021, 4:19 a.m.