Learn R Programming

simglm (version 0.8.0)

corr_variables: Function to correlate variables

Description

Inputs a matrix and other parameters and outputs a correlated matrix

Usage

corr_variables(mat, cor_vars, cov_param, standardize = TRUE)

Arguments

mat

A matrix of variables to correlate

cor_vars

A vector of correlations to specify, must be specified by row where the first element is the correlation between variable 1 and variable 2, second correlation is between variable 1 and variable 3, and so on.

cov_param

Variable specification similar to specifying fixed effects. See sim_reg for more details.

standardize

TRUE/FALSE flag indicating whether variables should be standardized prior to correlating (this is needed for accurate correlated variables)