Sxy function

Variation and Covariation

Variation and Covariation

Calculates the variation of one variable or the covariation of two different variables.

Sxy(x, y = x, na.rm = FALSE)

Arguments

  • x: vector of one variable.
  • y: vector of another variable (optional). If specified then the covariation of x and y is calculated. If omitted then the variation of x is calculated.
  • na.rm: a logical value indicating whether NA values should be stripped before the computation proceeds.

Returns

The variaion of x or the covariation of x and y.

Examples

x = c(1, 2) y = c(4, 1) Sxy(x) # variation Sxy(x, y) # covariation ## Second example illustrating the na.rm option x = c(1, 2, NA, 4) Sxy(x) Sxy(x, na.rm = TRUE)
  • Maintainer: Soenke Hoffmann
  • License: GPL (>= 3)
  • Last published: 2024-12-20