make_corr_mat: Makes correlation matrix to simulate data

Description Usage Arguments Examples

View source: R/NRejections.R

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

1
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 prop.corr * nY pairs)

Examples

1
2
3
4
5
6
make_corr_mat( nX = 1,
nY = 4,
rho.XX = 0,
rho.YY = 0.25,
rho.XY = 0,
prop.corr = 0.8 )

NRejections documentation built on July 9, 2020, 5:08 p.m.