Learn R Programming

RSDA (version 2.0.8)

var: Generic function for the Variance

Description

Compute the symbolic variance.

Usage

var(x, ...)

# S3 method for default var(x, y = NULL, na.rm = FALSE, use, ...)

# S3 method for sym.data.table var(x, method = c("centers", "interval", "billard", "modal"), na.rm = FALSE, ...)

Arguments

x

The symbolic variable.

...

As in R median function.

y

NULL (default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient).

na.rm

logical. Should missing values be removed?

use

an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings 'everything', 'all.obs', 'complete.obs', 'na.or.complete', or 'pairwise.complete.obs'.

method

The method to be use.

Value

Return a real number.

References

Billard L. and Diday E. (2006). Symbolic data analysis: Conceptual statistics and data mining. Wiley, Chichester.

Rodriguez, O. (2000). Classification et Modeles Lineaires en Analyse des Donnees Symboliques. Ph.D. Thesis, Paris IX-Dauphine University.

Examples

Run this code
# NOT RUN {
data(example3)
sym.data<-example3
var(sym.data[,1])
var(sym.data[,2])
var(sym.data[,6])
var(sym.data[,6], method='interval')
var(sym.data[,6], method='billard')
var(sym.data[,3], method='modal')
# }

Run the code above in your browser using DataLab