This example illustrates the following two-column statistical functions:
CORREL
- Correlation co-efficient between two columns. See CORREL Function.COVAR
- Calculates the covariance between two columns. See COVAR Function.COVARSAMP
- Calculates the covariance between two columns using the sample population method. See COVARSAMP Function.
Source:
The following table contains height in inches and weight in pounds for a set of students.
Student | heightIn | weightLbs |
---|---|---|
1 | 70 | 134 |
2 | 67 | 135 |
3 | 67 | 147 |
4 | 67 | 160 |
5 | 72 | 136 |
6 | 73 | 146 |
7 | 71 | 135 |
8 | 63 | 145 |
9 | 67 | 138 |
10 | 66 | 138 |
11 | 71 | 161 |
12 | 70 | 131 |
13 | 74 | 131 |
14 | 67 | 157 |
15 | 73 | 161 |
16 | 70 | 133 |
17 | 63 | 132 |
18 | 64 | 153 |
19 | 64 | 156 |
20 | 72 | 154 |
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:
Student | heightIn | weightLbs | covarHeightAndWeight-Sample | covarHeightAndWeight | corrHeightAndWeight |
---|---|---|---|---|---|
1 | 70 | 134 | 0.511 | 0.485 | 0.014 |
2 | 67 | 135 | 0.511 | 0.485 | 0.014 |
3 | 67 | 147 | 0.511 | 0.485 | 0.014 |
4 | 67 | 160 | 0.511 | 0.485 | 0.014 |
5 | 72 | 136 | 0.511 | 0.485 | 0.014 |
6 | 73 | 146 | 0.511 | 0.485 | 0.014 |
7 | 71 | 135 | 0.511 | 0.485 | 0.014 |
8 | 63 | 145 | 0.511 | 0.485 | 0.014 |
9 | 67 | 138 | 0.511 | 0.485 | 0.014 |
10 | 66 | 138 | 0.511 | 0.485 | 0.014 |
11 | 71 | 161 | 0.511 | 0.485 | 0.014 |
12 | 70 | 131 | 0.511 | 0.485 | 0.014 |
13 | 74 | 131 | 0.511 | 0.485 | 0.014 |
14 | 67 | 157 | 0.511 | 0.485 | 0.014 |
15 | 73 | 161 | 0.511 | 0.485 | 0.014 |
16 | 70 | 133 | 0.511 | 0.485 | 0.014 |
17 | 63 | 132 | 0.511 | 0.485 | 0.014 |
18 | 64 | 153 | 0.511 | 0.485 | 0.014 |
19 | 64 | 156 | 0.511 | 0.485 | 0.014 |
20 | 72 | 154 | 0.511 | 0.485 | 0.014 |
This page has no comments.