create_pop {fastpos}R Documentation

Creates a population with a specified correlation.

Description

The correlation will be exactly the one specified. The used method is described here: https://stats.stackexchange.com/questions/15011/generate-a-random-variable-with-a-defined-correlation-to-an-existing-variables/15040#15040

Usage

create_pop(rho, size)

Arguments

rho

Population correlation.

size

Population size.

Value

Two-dimensional population matrix with a specific correlation.

Examples

pop <- create_pop(rho = 0.5, size = 1e6)
cor(pop)

[Package fastpos version 0.5.1 Index]