weitrix_confects: Top confident effects based on one or more contrasts of a...

Description Usage Arguments Details Value Examples

View source: R/testing.R

Description

This function provides topconfects-style testing of a linear model contrast, as well as a multi-contrast extension of this method for F-tests with effect sizes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
weitrix_confects(
  weitrix,
  design,
  coef = NULL,
  contrasts = NULL,
  effect = c("auto", "contrast", "sd", "cohen_f"),
  dispersion_est = c("ebayes_limma", "row", "none"),
  fdr = 0.05,
  step = NULL,
  full = FALSE
)

Arguments

weitrix

A weitrix object, or an object that can be converted to a weitrix with as_weitrix.

design

A formula in terms of colData(weitrix or a design matrix, which will be fitted to the weitrix on each row. Can also be a pre-existing Components object, in which case the existing fits (design$row) are used.

coef

Give either coef or contrasts but not both. If coef is given, it is converted into a set of contrasts that simply test each given coefficient. Coefficients can be specified by number of name.

contrasts

Give either coef or contrasts but not both. One or more contrasts of interest, i.e. specifications of linear combination of coefficients. Each contrast should be placed in a columns. The number of rows should match the number of coefficients.

effect

Effect to estimate and provide confidence bounds on. See description.

dispersion_est

Method of estimating per-row dispersion. See description.

fdr

False Discovery Rate to control for.

step

Granularity of effect sizes to test.

full

If TRUE, output some further columns related to the calculations.

Details

Based on the effect argument, the estimated effect may be:

Based on the dispersion_est argument, the estimated residual dispersion is estimated as:

In results from this function, whenever we talk about the mean, standard deviation explained, or typical observation error, this should be understood to be weighted. Standard deviation explained is in the same units as the observations, but its estimation is weighted by the weights, so in a row with some high weight observations and other low weight observations, estimated standard deviation explained will mostly be driven by the high weight observations.

Value

A topconfects result. The $table data frame contains columns:

Examples

1
2
3
4
5
# Simplest possible test
# Which rows have an average different from zero?
weitrix_confects(simwei, ~1, coef="(Intercept)")

# See vignettes for more substantial examples

weitrix documentation built on Nov. 8, 2020, 8:10 p.m.