var()

var()

 The var() function computes the variance of a variable.

Example:

# Calculate the variance of Thumb
var(Fingers$Thumb)

# Alt: use 'data =' argument instead of '$' (produces same output)
var(~Thumb, data = Fingers)

Example output:

Output of var() function for Thumb

    • Related Articles

    • variance

      Variance is also called MS, Mean Square; approximated by the sum of squares (SS) divided by the degrees of freedom (i.e., n-1); the MSE from the empty model can be thought of as roughly the average squared deviation.
    • confounding variable

      Confounding variable is a variable that, though not measured, causes variation in both the explanatory variable and the outcome variable; also know as a "lurking variable" or a "third variable".
    • outcome variable

      Outcome variable is a variable whose variation we are trying to explain.
    • explanatory variable

      Explanatory variable is a variable we use to explain variation in an outcome variable.
    • categorical variable

      Categorical variable is a variable for which the values don’t tell us anything about quantity; the values simply tell us which category the object belongs to.