# sim.cor: Simulate bivariate distribution with a specified correlation In miscor: Miscellaneous Functions for the Correlation Coefficient

## Description

This function simulates bivariate distribution with correaltion equal to `rho`, mean equal to `mean`, standard deviation equal to `sd`, skewness equal to `skewness`, and kurtosis equal to `kurtosis` by Fleishman polynomials. Note that that the specified skewness and kurtosis parameters have to be in line with kurtosis >= (skewnewss^2 - 2)

## Usage

 ```1 2``` ```sim.cor(n, rho, mean = c(0, 0), sd = c(1, 1), skewness = c(0, 0), kurtosis = c(0, 0)) ```

## Arguments

 `n` number of observations. `rho` correlation. `mean` mean vector. `sd` standard deviation vector. `skewness` skewness vector. `kurtosis` kurtosis vector.

## Value

Returns a data.frame with variables `x` and `y`.

## Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at,

## References

Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. New York: John Wiley & Sons.

## See Also

`test.cor`, `seqtest.cor`, `comptest.cor`,

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```#------------------------------------------------ # Bivariate distribution with rho = 0.3, n = 200 # x: skewness = 0, kurtosis = 0 # y: skewness = 0, kurtosis = 0 sim.cor(200, rho = 0.3) #----------------------------------------------- # Bivariate distribution with rho = 0.4, n = 500 # x: skewness = 0, kurtosis = 1.5 # y: skewness = 2, kurtosis = 7 sim.cor(500, rho = 0.4, skewness = c(0, 1.5), kurtosis = c(2, 7)) ```

miscor documentation built on May 1, 2019, 10:14 p.m.