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.
filterConfounders(muMarg, confMat, X, thetas, p, n, nleqslv.control, trended.dispersion, tol = 0.001, maxIt = 20)
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 |
a list with components:
thetas |
new theta estimates |
NB_params |
The estimated parameters of the interaction terms |