getBiCop_exact: Simulate bivariate normally distributed data with specified...

Description Usage Arguments Details

Description

The correlation between x and y will be exactly rho. If only fraction is given but not rho_sub, rho_sub will be set to rho.

Usage

1
2
getBiCop_exact(N, rho, rho_sub = NA, mu1 = 0, sd1 = 1, fraction = NA,
  distribution = "norm_norm")

Arguments

N

Sample size

rho

True correlation coefficient in the sample if rho_sub is not given, otherwise rho is the correlation in the rest of the sample that does not belong to the subset

rho_sub

Correlation in the subset

mu1

Mean of variable x (on log scale if type = "log_norm")

sd1

Standard deviation of variable x (on log scale if type = "log_norm")

fraction

Fraction of the returned data.frame that belongs to the subset. The subset consists of the first round(N * fraction) rows

type

The distributions of the two variables (columns). If "norm_norm" both are normally distributed, if "log_log" both are lognormally distributed, if type = "log_norm" x will be lognormally distributed and y standard normal.

Details

Code from http://stats.stackexchange.com/questions/15011/generate-a-random-variable-with-a-defined-correlation-to-an-existing-variable


Thie1e/subsetcor documentation built on May 9, 2019, 4:41 p.m.