ji.cov.ds: Computes the covariance of a vector or matrix

Description Usage Arguments Value Author(s) Examples

Description

Compute the covariance of x and y if these are vectors. If x and y are matrices then the covariances between the columns of x and the columns of y are computed.

Usage

1
2
  ji.cov.ds(x, y = NULL,
    method = c("pearson", "kendall", "spearman"))

Arguments

x

a numeric vector, matrix or data frame.

y

NULL (default) or a vector, matrix or data frame with compatible dimensions to x

method

a character string indicating which covariance is to be computed

Value

a covariance of x and y (or between columns of x and columns of y)

Author(s)

Isaeva, J.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# load the file that contains the login details
library(opal)
data(logindata)

# login and assign a numeric variable to R
myvar <- list("LAB_TSC","LAB_TRIG")
opals <- datashield.login(logins=logindata,assign=TRUE,variables=myvar)

# compute the covariance of LAB_TSC and LAB_TRIG
stat.cov <- datashield.aggregate(opals, quote(ji.cov.ds(D$LAB_TSC,D$LAB_TRIG)))

# compute the covariance matrix of concatenated vectors (LAB_TSC and LAB_TRIG)
datashield.assign(opals, 'dummy', quote(cbind(D$LAB_TSC,D$LAB_TRIG)))
stat.cov = datashield.aggregate(opals, quote(ji.cov.ds(dummy)))

## End(Not run)

datashield/ji.dev.sv documentation built on May 14, 2019, 7:53 p.m.