getEffectParameters: Calculate Effect Parameter Matrix

View source: R/Main.R

getEffectParametersR Documentation

Calculate Effect Parameter Matrix

Description

From a matrix of cell means, the factors in the experiment, and information about which factor to test, creates a matrix of ANOVA effect parameters.

Usage

getEffectParameters(cellMeans, factors, testedFactors, dmFactors = NULL,
  contrastType = NULL, warnOnDrop = FALSE)

Arguments

cellMeans

A matrix of cell means. Each column is a cell and each row is a sample from the prior or posterior. The columns must correspond to the rows of factors.

factors

See testHypothesis.

testedFactors

See testHypothesis.

dmFactors

See testHypothesis.

contrastType

See testHypothesis.

warnOnDrop

Emit a warning if columns of the design matrix are dropped due to it not being full rank.

Details

The steps of the procedure:

  1. Calculate the design matrix, X. 1b. If design is not fully crossed, strip excess terms from X.

  2. If mu are cell means and beta are effect parameters, then mu = X * beta and beta = (X' * X)^-1 * X' * mu. Calculate S = (X' * X)^-1 * X'.

  3. Calculate beta = S * mu.

  4. Select out only the beta needed for the testedFactors, beta_s.

  5. Select the corresponding columns (and rows) in X, X_s.

  6. Complete the required effect parameters with X_s * beta_s. This is not the same as mu = X * beta because only subsets of X and beta are used.

Value

A matrix of effect parameters where each column is one parameter and each row is a sample from the prior or posterior (depending on what cellmeans was). The columns are named with factor level names.

See Also

See also summarizeEffectParameters and groupEffectParameters.


hardmanko/CMBBHT documentation built on June 9, 2022, 12:44 a.m.