Description Usage Arguments Value Examples
View source: R/dataGeneration.R
This function generates a dataset from an x > M > y model, where M may be of any size with any correlation matrix.
1 2 3 
n 
Sample size 
a 
Vector of a path coefficients within 0 and 1 
b 
Vector of b path coefficients within 0 and 1 
r2y 
Proportion of explained variance in y. Set to

dir 
Direct path from x to y 
Sigma 
Desired true covariance matrix between the mediators M 
residual 
Whether Sigma indicates residual or marginal covariance 
empirical 
Ensure observed data matrix has exactly the requested covmat (only if Sigma is specified) 
scaley 
Whether to standardise y (changes b path coefficients) 
forma 
Functional form of the a paths. Function that accepts a matrix as input and transforms each column to the desired form. 
formb 
Functional form of the b paths. Function that accepts a vector. 
A data frame with columns x, M.1  M.p, y
1 2 3 4 5 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.