Pools the within-group variances of x across the levels of group,
weighting each group by its degrees of freedom (n_i - 1), and returns the
square root. This is the within-group precision estimate: unlike a plain
sd(x) it is not inflated by systematic shifts between groups (e.g. batch
offsets or drift), so it is the appropriate spread for a batch-pooled %RSD.
Arguments
- x
a numeric vector
- group
a vector the same length as
xgiving the pooling group of each value (e.g.batch_id)- na.rm
logical, if
TRUEthen NA values inxare stripped before pooling- min_n
integer, the minimum number of non-missing values a group must have to contribute. Groups with fewer than
min_nare dropped; a group is always dropped below two values, which have no within-group variance. The default is2.