MicroStrategy ONE

WeightedCov (Weighted Covariance)

Covariance is used to examine the relationship between two data sets. For instance, the covariance can be used to examine whether an increase in income is related to higher education levels. A covariance greater or less than zero indicates a relationship, while a value of zero indicates no relationship.

A weighted covariance allows you to apply a weight, or relative significance to each value comparison. Covariance comparisons with a higher value for their weight are considered as more significant when compared to the other value comparisons.

To determine the covariance of two values without applying a weight to the comparisons, see Covariance.

Syntax

WeightedCov <FactID> (Argument1, Argument2, Weight)

Where:

  • Argument1 and Argument2 are attributes, facts, or metrics representing lists of numbers for comparison. A covariance is calculated on these values to determine the level of association between the two values.
  • Weight is an attribute, fact, or metric representing a list of numbers to define the weight of each comparison.
  • FactID is a parameter that forces a calculation to take place on a fact table that contains the selected fact.

Expression

  • x and y are the Argument1 and Argument2 values being compared.
  • w is the weight applied to each comparison.
  • = average value of x
  • = average value of y

Usage Notes

The following are invalid conditions:

  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.
  • If Argument1 and Argument2 have a different number of data points, an error is returned.
  • If either Argument1 or Argument2 is empty, an error is returned.

Example

Your company keeps employee statistics including their overall satisfaction with their job and role at the company, as well as their performance score. While these are both important statistics, it can also be beneficial to know how closely related these two statistics are. Knowing this information can help determine if an employee's satisfaction with their job is related to their performance.

A report including both the covariance and weighted covariance of these statistics, is shown below for employees at the executive level:

The expressions for these calculations are as follows:

  • Covariance:

    Covariance([Avg. Performance Score], [Avg. Satisfaction Score]) {Level , ~ }

  • Weighted Covariance:

    WeightedCov([Avg. Performance Score], [Avg. Satisfaction Score], Tenure) {Level, ~}

Both the covariance and weighted covariance indicate that employee satisfaction and performance are positively related, meaning that when one increases so does the other. The weighted covariance includes an employee's tenure into the covariance calculation. This means that more significance is given to covariance comparisons for employees that have been with the company longer.

For the executive level employees, factoring in tenure results in a smaller relationship between satisfaction and performance. This type of analysis can be crucial in determining how performance can be improved or maintained both for new hires and long tenured employees.