groups_by_filter: Stratify hypotheses based on increasing value of the...

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Hypotheses are stratified into nbins different strata of (approximately) equal size based on increasing value of the covariate

Usage

1
groups_by_filter(covariate, nbins, ties.method = "random", seed = NULL)

Arguments

covariate

Numeric vector of ordinal covariates based on which the stratification will be done.

nbins

Integer, number of groups/strata into which p-values will be split based on covariate.

ties.method

Character specifying how ties are treated, see rank function.

seed

Integer, specifies random seed to be used when ties.method=="random".

Value

A factor with nbins different levels, each entry corresponds to the stratum the i-th hypothesis was assigned to.

Examples

1
2
3
 covariates <- runif(100)
 groups <- groups_by_filter(covariates,10)
 table(groups)

IHW documentation built on Nov. 8, 2020, 7:44 p.m.