filterConfounders {RCM} | R Documentation

## Filters out the effect of known confounders. This is done by fitting interactions of every taxon with the levels of the confounders. It returns a modified offset matrix for the remainder of the fitting procedure.

### Description

Filters out the effect of known confounders. This is done by fitting interactions of every taxon with the levels of the confounders. It returns a modified offset matrix for the remainder of the fitting procedure.

### Usage

    filterConfounders(muMarg, confMat, X, thetas, p, n, nleqslv.control,
      trended.dispersion, tol = 0.001, maxIt = 20)

### Arguments

`muMarg` | a nxp matrix, the current offset
`confMat` | a nxt confounder matrix
`X` | the nxp data matrix
`thetas` | a vector of length p with the current dispersion estimates
`p` | an integer, the number of columns of X
`n` | an integer, the number of rows of X
`nleqslv.control` | see nleqslv()
`trended.dispersion` | a vector of length p with trended dispersion estimates
`tol` | a scalar, the convergence tolerance
`maxIt` | maximum number of iterations Fits the negative binomial mean parameters and overdispersion parameters iteratively. Convergence is determined based on the L2-norm of the absolute change of mean parameters

### Value

a list with components:

`thetas` | new theta estimates
`NB_params` | The estimated parameters of the interaction terms

[Package RCM version 1.3.0 Index]