rweibullcor: Generate a vector from a Weibull distribution correlated with...

Description Usage Arguments Details Value Author(s) Examples

View source: R/correlatedsamplers.R

Description

Allow user to draw from a Weibull distribution correlated with a user specified vector

Usage

1
rweibullcor(x, rho, na.rm = FALSE)

Arguments

x

variable to draw from

rho

correlation coefficient between x and result of function

na.rm

a logical indicating whether to fit the distribution excluding missing values or to fail on missing values

Details

Rough estimate

Value

a vector of the same length as x drawn from a normal distribution correlated with x at the level of rho

Author(s)

Jared E. Knowles

Examples

1
2
3
4
5
x <- rnorm(1000)
y <- rweibullcor(x, 0.2)
cor(x,y) # very close to 0.2
mean(y) 
sd(y)  

jknowles/datasynthR documentation built on May 19, 2019, 11:42 a.m.