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)# variationSxy(x, y)# covariation## Second example illustrating the na.rm optionx = c(1,2,NA,4)Sxy(x)Sxy(x, na.rm =TRUE)