Learn R Programming

IHW (version 1.0.2)

groups_by_filter: Stratify hypotheses based on increasing value of the covariate

Description

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

Usage

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

Run this code
 covariates <- runif(100)
 groups <- groups_by_filter(covariates,10)
 table(groups)

Run the code above in your browser using DataLab