View source: R/teaching_utils.R
rcorr | R Documentation |
generate two correlated variables
rcorr(mux = 0, muy = 0, n, sdx = 1, sdy = 1, r)
mux |
mean of the first variable (x), default to 0 |
muy |
mean of the second variable (y), default to 0 |
n |
sample size |
sdx |
standard deviation of the first variable (x), default to 1 |
sdy |
standard deviation of the second variable (y), default to 1 |
r |
the correlation between x and y |
a dataframe
rcorr(n = 100, r = 0.6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.