covar_pop
Function
The covar_pop function is used to return the population covariance of two numeric columns.
Syntax
covar_pop(col1, col2)
Parameters
| Parameter | Mandatory | Description |
|---|---|---|
| col1 | Yes | A column with numeric data type. Other types return NULL. |
| col2 | Yes | A column with numeric data type. Other types return NULL. |
Return Values
Returns a value of type DOUBLE.
Examples
- Calculate the population covariance between all items inventory and price. Example command:
select covar_pop(items,price) from warehouse;
Result:
_c0 1.242355
- Used with GROUP BY to group all items by warehouse (warehouseId) and calculate the population covariance between items inventory and price within the same group. Example command:
select warehouseId, covar_pop(items,price) from warehouse group by warehouseId;
Result:
warehouseId _c1 city1 1.13124 city2 1.13344 city3 1.53425
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot