getCorrelationCoeficient: Get correlation coeficient between two numeric variable

Description Usage Arguments Value Examples

Description

Get correlation coeficient between two numeric variable

Usage

1
2
3
4
5
6
7
8
9
getCorrelationCoeficient(
  data,
  var1,
  var2,
  method = "pearson",
  exact = NULL,
  conf.level = 0.95,
  round = 3
)

Arguments

data

a data.frame, containing the data to use to compute the correlation coeficient

var1

a character vector of length one, containing the variable name of numeric variable in data

var2

a character vector of length one, containing the variable name of numeric variable in data

method

a character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman".

exact

a logical indicating whether an exact p-value should be computed. Used for Kendall's tau and Spearman's rho.

conf.level

confidence level for the returned confidence interval.

round

a numeric vector of length one, containing the number of digit for rounding

Value

a data.frame

Examples

1
2
3
data(mtcars)
cor <- getCorrelationCoeficient(data = mtcars, var1 = 'mpg', var2 = colnames(mtcars)[sapply(mtcars, is.numeric)])
cor <- do.call('rbind', cor)

rgriffier/statsBordeaux documentation built on Aug. 11, 2021, 9:59 a.m.