matrixmaker | R Documentation |
Takes a matrix of covariates and generates a new matrix that contains the original covariates, all one-way interaction terms, and all squared terms.
matrixmaker(mat)
mat |
n by k numeric matrix of covariates. |
n by (k*(k+1))/2 +1) matrix of covariates with original covariates, all one-way interaction terms, and all squared terms.
Jens Hainmueller
See getsquares
# create toy matrix mold <- replicate(3,rnorm(50)) colnames(mold) <- paste("x",1:3,sep="") head(mold) # create new matrix mnew <- matrixmaker(mold) head(mnew)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.