addInteractions: Add interaction terms for each pair of putative variables

Description Usage Arguments Value Examples

View source: R/semmsFuncs.R

Description

Create all the second-order polynomials Z_i*Z_j where Z_i are columns of the matrix Z (including Z_i*Z_i), and Z is an n (samples) by p (covariates)

Usage

1

Arguments

Z

a numeric matrix of putative variables, n (samples) by p (covariates).

Value

a matrix which includes the input matrix, Z, and all the two-way interactions.

Examples

1
2
3
Z <- addInteractions(matrix(c(1,2,3, 11,12,13), nrow = 2,
ncol = 3, byrow = TRUE,dimnames = list(c("row1", "row2"),
  c("C.1", "C.2", "C.3"))))

haimbar/SEMMS documentation built on Dec. 20, 2021, 2:44 p.m.