groups_by_filter {IHW} | R Documentation

## 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

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

[Package IHW version 1.20.0 Index]