lmwEffectMatrices: Computes the effect matrices

View source: R/lmwEffectMatrices.R

lmwEffectMatricesR Documentation

Computes the effect matrices

Description

Estimates by OLS the effect matrices M^(_0), M^(_1), ...M^(_f), ...M^(_E) for the outcomes and design matrix provided in object resLmwModelMatrix and calculates the linked percentage of variances.

Usage

lmwEffectMatrices(resLmwModelMatrix, SS = TRUE, contrastList = NA)

Arguments

resLmwModelMatrix

A list of 5 elements from lmwModelMatrix.

SS

Logical. If FALSE, won't compute the percentage of variance for each effect.

contrastList

A list of contrast for each parameter. If NA, the function creates automatically the list by default.

Value

A list with the following elements:

lmwDataList

The initial object: a list with outcomes, design and formula.

modelMatrix

A nxK model matrix specifically encoded for the ASCA-GLM method.

modelMatrixByEffect

A list of p model matrices for each effect.

effectsNamesUnique

A character vector with the p names of the model effects, each repeated once.

effectsNamesAll

A character vector with the K names of the model effects ordered and repeated as the column names of the model matrix.

effectMatrices

A list of p effect matrices for each model effect.

predictedvalues

The nxm matrix of predicted outcome values.

residuals

The nxm matrix of model residuals.

parameters

The pxm matrix of the estimated parameters.

type3SS

A vector with the type III sum of squares for each model effect (If SS = TRUE).

variationPercentages

A vector with the percentage of variance for each model effect (If SS = TRUE).

varPercentagesPlot

A ggplot bar plot of the contributions of each model effect to the total variance (If SS = TRUE).

Examples

 data('UCH')
 resLmwModelMatrix <- lmwModelMatrix(UCH)
 lmwEffectMatrices(resLmwModelMatrix)


bgovaerts/LMWiRe documentation built on Sept. 17, 2022, 12:32 a.m.