create_pop: Creates a population with a specified correlation.

Description Usage Arguments Value Examples

View source: R/fastpos.R

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

1
create_pop(rho, size)

Arguments

rho

Population correlation.

size

Population size.

Value

Two-dimensional population matrix with a specific correlation.

Examples

1
2
pop <- create_pop(0.5, 100000)
cor(pop)

fastpos documentation built on Oct. 23, 2020, 7:12 p.m.