sim_cor: Simulate correlated normally distributed data

Description Usage Arguments Value Examples

View source: R/simulater.R

Description

Simulate correlated normally distributed data

Usage

1
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

1
2
3
sim <- sim_cor(100, .74, c(0, 10), c(1, 5), exact = TRUE)
cor(sim)
sim_summary(sim)

radiant-rstats/radiant.model documentation built on Nov. 13, 2018, 7 a.m.