rcorr: rcorr

View source: R/teaching_utils.R

rcorrR Documentation

rcorr

Description

generate two correlated variables

Usage

rcorr(mux = 0, muy = 0, n, sdx = 1, sdy = 1, r)

Arguments

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

Value

a dataframe

Examples

rcorr(n = 100, r = 0.6)

filippogambarota/filippoR documentation built on March 6, 2023, 4:22 a.m.