The 2-Var Stats Command

Command Summary

Calculates some common statistics for two lists of data, and stores them to statistical variables. They're also displayed in a scrollable list, if done outside a program.

Command Syntax

2-Var Stats [list1, list2, [freqlist]]

Menu Location


  1. STAT to access the statistics menu
  2. LEFT to access the CALC submenu
  3. 2 to select 2-Var Stats, or use arrows

Calculator Compatibility


Token Size

1 byte

This command calculates a bunch of common (and a few uncommon) statistics for a pair of lists (it uses L1 and L2 by default, but you can use any list by supplying it as an argument). You have to store the lists to variables first, though, before calculating statistics for them. For example:

:2-Var Stats

The calculator treats the two lists as a list of ordered pairs. Some of the statistics calculated assume that this is the case, and the two lists are the same size: an error will occur if the lists don't match.

Like other statistical commands, you can use a frequency list as well, for cases where one element occurs more times than another (you can do this with a normal list, too, but that might be inconvenient when an element occurs very many times). There is only one frequency list for both data lists, and the frequency applies to the ordered pair formed by an element taken from each list. For example:

:2-Var Stats L1,L2,L3

is the frequency-list equivalent of:
:2-Var Stats

When you're running it from the home screen, 2-Var Stats will display the statistics; this won't happen if you do it inside a program. Either way, it will also store what it calculated to the statistics variables found in VARS>Statistics… The variables 2-Var Stats affects are:

  • $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\textrm{x}}$ is the mean (average) of the first list
  • Σx is the sum of the first list
  • Σx² is the sum of the squares of the first list
  • Sx is the sample standard deviation of the first list
  • σx is population standard deviation of the first list
  • minX is the minimum element of the first list
  • maxX is the maximum element of the first list
  • $\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\textrm{y}}$ is the mean (average) of the second list
  • Σy is the sum of the second list
  • Σy² is the sum of the squares of the second list
  • Sy is the sample standard deviation of the second list
  • σy is population standard deviation of the second list
  • minY is the minimum element of the second list
  • maxY is the maximum element of the second list
  • Σxy is the sum of products of each matching pair of elements in the lists
  • n is the number of elements in both lists

2-Var Stats will not work with "reserved" list names that the calculator uses internally. The only known such reserved list is the list RESID, and there's no reason to suspect there are any others. Ans, TblInput, and any expression which resolves to a list, are also not appropriate for this command: store all of these to a list before doing 2-Var Stats on them.

Advanced uses

If you consider the two lists to be vectors, then Σxy is their dot product, and Σx² and Σy² are the squares of their norms; math done with these and other statistics can produce the shortest (but not necessarily quickest) way to calculate many vector operations.


Aside from statistical analysis, 2-Var Stats can also be used when you want to use the values it calculates more than once. This will save on size, since, for example Σx takes up less space than sum(L1), but considering how many calculations 2-Var Stats makes, it will usually be slower.

Related Commands


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License