sim_cor {radiant.model} | R Documentation |
Simulate correlated normally distributed data
Description
Simulate correlated normally distributed data
Usage
sim_cor(n, rho, means, sds, exact = FALSE)
Arguments
n |
The number of values to simulate (i.e., the number of rows in the simulated data) |
rho |
A vector of correlations to apply to the columns of the simulated data. The number of values should be equal to one or to the number of combinations of variables to be simulated |
means |
A vector of means. The number of values should be equal to the number of variables to simulate |
sds |
A vector of standard deviations. The number of values should be equal to the number of variables to simulate |
exact |
A logical that indicates if the inputs should be interpreted as population of sample characteristics |
Value
A data.frame with the simulated data
Examples
sim <- sim_cor(100, .74, c(0, 10), c(1, 5), exact = TRUE)
cor(sim)
sim_summary(sim)
[Package radiant.model version 1.6.6 Index]