filterConfounders: Filters out the effect of known confounders. This is done by...

View source: R/F_filterConfounders.R

filterConfoundersR 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,
  allowMissingness,
  naId
)

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

allowMissingness

A boolean, are missing values present

naId

The numeric index of the missing values in X

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


CenterForStatistics-UGent/RCM documentation built on April 24, 2023, 8:26 p.m.