Description Usage Arguments Value Examples
View source: R/gen_response_surface_x.R
A helper function for simulating the independent variables for a response surface. Automatically calculates the interaction and quadratic terms. For simplicities sake, assumes that variables have mean 0
1 | gen_response_surf_x(n, cov_mat, x_names = NULL)
|
n |
Number of observations to simulate. |
cov_mat |
Covariance matrix defining how X1 and X2 are related along with their scale. |
x_names |
Character vector of length two containing the names of X variables (optional) |
Data frame of IVs with requested column names.
1 2 3 4 5 6 7 8 | # Defining Correlation Matrix describing how x1 and x2 are related
# Covarince and variance of x1^2, x2^2, and x1*x2 follow from this matrix
cov_mat<-matrix(c(1, 0,
0, 1), byrow = TRUE, 2, 2)
# Generating data frame for response suface examining leaders and follower agreeableness
x_df<-gen_response_surf_x(1000, cov_mat, x_names = c("L_Agree", "F_Agree"))
x_df
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.