createCoefficientExpanderList: Create a coefficient expander list

Description Usage Arguments Details Value Examples

View source: R/ExpandSumToZeroCoefs.R

Description

Create a coefficient expander list

Usage

1
2
createCoefficientExpanderList(expandedCoefNames,
  shouldMakeBigMatrix = TRUE)

Arguments

expandedCoefNames

- character vector of expanded coef names (available from e.g. make_rsSumDmxFrom_srDtb object) a e.g. c("C|d", "V|a",... "C_d:V_a: ...., C|b:V|a:y")

shouldMakeBigMatrix

- should a big exoander matrix be created or just the list of component matrices

shouldReturnBigMatrix

default FALSE. If true, RM_bigMat component returned

Details

Given an character vector of expanded (indicator) coefficient names for a HMNL, this function creates a result list consisting of familyNames would include "C", "V", C:V", "C:V:y" result$XM_list a list of expansion matrices for expanding sum-to-zero k-1 levels per factor contrast coefficients to sum-to-zero indicator coefficients (all k levels per factor) and optionally result$XM_bigMat a large (ncoefExpanded x ncoefContrast) matrix with non-zero blocks constisting of

Value

result: a list with components familyNames, XM_list and optionally XM_bigMat

result : a list with conponents: $familyNames the family names of groups of coefficients. EG $XM_list a list of expansion matrices for expanding sum-to-zero k-1 levels per factor contrast coefficients to sum-to-zero indicator coefficients (all k levels per factor) Note the column names will contain only factors not covaraites! $XM_bigMat (optionally) a large (ncoefExpanded x ncoefContrast) matrix with non-zero blocks constisting of

Examples

1
2
3
4
5
6
tlist=createCoefficientExpanderList(c("C|b",  "C|d",  "V|a",  "V|i",
  "V|u",  "C|b:V|a",   "C|d:V|a",  "C|b:V|i",  "C|d:V|i",  "C|b:V|u",
   "C|d:V|u",  "C|b:F1", "C|d:F1",  "V|a:F2",  "V|i:F2",  "V|u:F2",
    "C|b:cond|1",  "C|d:cond|1","C|b:cond|2",  "C|d:cond|2",
     "C|b:cond|3",  "C|d:cond|3"), shouldMakeBigMatrix=TRUE)
print(str(tlist))

tnearey/bhmnl documentation built on Nov. 5, 2019, 10:55 a.m.