match_quantiles: Quantile Matching

Description Usage Arguments Details Value Examples

View source: R/quantile_match.R

Description

Selects from list of vectors, items from each vector with same count and quantile distribution

Usage

1
match_quantiles(list_of_values, n_quantiles = 20)

Arguments

list_of_values

list of sets of values.

n_quantiles

number of quantiles used for matching (default=20 but check details)

Details

Splits the smallest set values into n_quantiles as defined. For each quantile gets a similar sized sample of values within this quantile from each element in list_of_values.

Value

list with 2 elements: indices for each element in list_of_values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
values1 <- rnorm(10000)
values2 <- rnorm(100,2,1)
values3 <- rnorm(1000,3,2)
summary(values1)
summary(values2)
summary(values3)

matched_idx <- match_quantiles(list(values1, values2, values3))
summary(values1[matched_idx[[1]]])
summary(values2[matched_idx[[2]]])
summary(values3[matched_idx[[3]]])

manschmi/RMetaTools documentation built on Dec. 14, 2021, 4:33 a.m.