Socrata was acquired by Tyler Technologies in 2018 and is now the Data and Insights division of Tyler. The platform is still powered by the same software formerly known as Socrata but you will see references to Data & Insights going forward.

regr_r2(...)

regr_r2(...)

Returns the square of the correlation coefficient (r²)

Works with the following datatypes:

This function works with 2.1 endpoint(s). What does this mean? »

The regr_r2(...) function returns the correlation strength between two sets of numeric values (Numbers). For example, to fetch the square of the correlation coefficient between the typical number of hours assigned and their hourly rate for all employees in the City of Chicago:

https://data.cityofchicago.org/resource/tt4n-kn4t.json?$select=regr_r2(typical_hours,hourly_rate)

It can also be used in $group aggregations, like this one to get the correlation strength by full or part time status:

https://data.cityofchicago.org/resource/tt4n-kn4t.json?$select=full_or_part_time,regr_r2(typical_hours,hourly_rate)&$group=full_or_part_time