maketwoway
takes a set of pre-treatment covariates and returns all sensible two-way interactions.
maketwoway(X, wts = 1, center = TRUE, deletion = TRUE, threshold = 0.99999,
frame.meanPre, predict = FALSE)
maketwoway
is called within predict.FindIt
.
maketwoway
is called within predict.FindIt
.
FindIt
. Takes a matrix and returns a matrix of two-way interactions. A named matrix with an intercept, all two-way interactions and square terms are returned. If center=TRUE
, interactions are formed by (1) centering, (2) scaling to sd 1, and (3) interacting.
Non-sensible interactions, such as interacting dummy variables for male and female, as well as squared terms for dummy variables, are not returned. A rescaling vector is returned, so that the columns of the standardized matrix can be returned to their original scale.
#See the help page for FindIt() for an example.
Run the code above in your browser using DataLab