make_corr_mat {NRejections} | R Documentation |
Makes correlation matrix to simulate data
Description
Simulates a dataset with a specified number of standard MVN covariates and outcomes with a specified correlation structure. If the function returns an error stating that the correlation matrix is not positive definite, try reducing the correlation magnitudes.
Usage
make_corr_mat(nX, nY, rho.XX, rho.YY, rho.XY, prop.corr = 1)
Arguments
nX |
Number of covariates, including the one of interest |
nY |
Number of outcomes |
rho.XX |
Correlation between all pairs of Xs |
rho.YY |
Correlation between all pairs of Ys |
rho.XY |
Correlation between pairs of X-Y that are not null (see below) |
prop.corr |
Proportion of X-Y pairs that are non-null (non-nulls will be first |
Examples
make_corr_mat( nX = 1,
nY = 4,
rho.XX = 0,
rho.YY = 0.25,
rho.XY = 0,
prop.corr = 0.8 )
[Package NRejections version 1.2.0 Index]