Last data update: 2014.03.03

R: Constructing named all possible interactions from a given set...
makellwayR Documentation

Constructing named all possible interactions from a given set of factors.

Description

makeallway takes a data frame of factors, each denoting a treatment level, and returns a matrix of 0's and 1's for all possible interactions.The current version can produce up to four way interactions.

Usage

makeallway(X, threshold = 0.999999, deletion = TRUE, make.reference = TRUE,
sparse.use = FALSE, nway)

Arguments

X

A matrix of data frame of treatments, each column interpreted as a factor.

threshold

Threshold to drop correlated columns.

deletion

Whether to automatically drop pairwise linearly dependent columns and columns of all 0's or 1's.

make.reference

Whether to make a reference matrix to check which columns are dropped when makeallway=TRUE.

sparse.use

Whether to use a sparse matrix or not.

nway

The order of interaction terms. All possible interactions up to this value are computed.

Details

Useful for construcing a matrix for FindIt with type="multiple". Takes a data frame of factors and returns a design matrix with all possible interactions. A named matrix of 0's and 1's, for every possible interaction, is returned. Pairwise linearly dependent columns and columns of all 0's or 1's are eliminated.

Value

FinalData

A named matrix of 0's and 1's.

reference

A matrix that keeps track of all columns and shows which columns are dropped.

Author(s)

Naoki Egami, Marc Ratkovic and Kosuke Imai.

Examples

#See the help page for FindIt() for an example.
	

Results