Page tree

Trifacta SaaS



Contents:

   

This example illustrates statistical functions that can be applied across two columns of values.

Functions:

ItemDescription
CORREL Function Computes the correlation coefficient between two columns. Source values can be of Integer or Decimal type.
COVAR Function Computes the covariance between two columns using the population method. Source values can be of Integer or Decimal type.
COVARSAMP Function Computes the covariance between two columns using the sample method. Source values can be of Integer or Decimal type.
ROUND Function Rounds input value to the nearest integer. Input can be an Integer, a Decimal, a column reference, or an expression. Optional second argument can be used to specify the number of digits to which to round.

Source:

The following table contains height in inches and weight in pounds for a set of students.

StudentheightInweightLbs
170134
267135
367147
467160
572136
673146
771135
863145
967138
1066138
1171161
1270131
1374131
1467157
1573161
1670133
1763132
1864153
1964156
2072154


Transformation:

You can use the following transformations to calculate the correlation co-efficient, the covariance, and the sampling method covariance between the two data columns:

Transformation Name New formula
Parameter: Formula type Single row formula
Parameter: Formula round(correl(heightIn, weightLbs), 3)
Parameter: New column name 'corrHeightAndWeight'

Transformation Name New formula
Parameter: Formula type Single row formula
Parameter: Formula round(covar(heightIn, weightLbs), 3)
Parameter: New column name 'covarHeightAndWeight'

Transformation Name New formula
Parameter: Formula type Single row formula
Parameter: Formula round(covarsamp(heightIn, weightLbs), 3)
Parameter: New column name 'covarHeightAndWeight-Sample'

Results:

StudentheightInweightLbscovarHeightAndWeight-SamplecovarHeightAndWeightcorrHeightAndWeight
170134-2.876-2.732-0.074
267135-2.876-2.732-0.074
367147-2.876-2.732-0.074
467160-2.876-2.732-0.074
572136-2.876-2.732-0.074
673146-2.876-2.732-0.074
771135-2.876-2.732-0.074
863145-2.876-2.732-0.074
967138-2.876-2.732-0.074
1066138-2.876-2.732-0.074
1171161-2.876-2.732-0.074
1270131-2.876-2.732-0.074
1374131-2.876-2.732-0.074
1467157-2.876-2.732-0.074
1573161-2.876-2.732-0.074
1670133-2.876-2.732-0.074
1763132-2.876-2.732-0.074
1864153-2.876-2.732-0.074
1964156-2.876-2.732-0.074
2072154-2.876-2.732-0.074

See Also for EXAMPLE - Two-Column Statistical Functions:

This page has no comments.