Description Usage Arguments Value Author(s) Examples
View source: R/design_assessment.R
Generates squares and/or two-way interactions (pairwise products) of the columns of a data frame.
1 2 3 4 5 6 | make_sq_inter(
data_frame,
is_square = TRUE,
is_inter = TRUE,
keep_marginal = TRUE
)
|
data_frame |
Data frame containing the variables whose squares and interactions are to be created. |
is_square |
If |
is_inter |
If |
keep_marginal |
If |
A data frame containing the squares and/or pairwise products of data_frame
.
Ambarish Chattopadhyay, Carl N. Morris and Jose R. Zubizarreta.
1 2 3 4 5 6 | # Consider a data frame with N = 12 units and 2 covariates.
data_frame_sample = data.frame(male = c(rep(1,6),rep(0,6)),
age = c(20,30,40,40,50,60,20,30,40,40,50,60))
# Get a data frame with all possible squares and first order interactions.
make_sq_inter(data_frame = data_frame_sample, is_square = TRUE,
is_inter = TRUE, keep_marginal = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.