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".
    • explain variation

      When we can make a better prediction of the outcome variable if we knew something about the explanatory variable; accounting for variation in the outcome variable by using variation in another variable.
    • unexplained variation

      Unexplained variation is everything included in the "other stuff" part of a word equation.
    • explanatory variable

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