Statistics
Over One Variable
Elements that calculate different statistics with the self-descriptive names:
averagecalculates the arithmetic mean.standard_deviationsquare root of dispersion for a set of valuesdispersiondispersion for a set of values (Σ((x - x̅)^2) / n), , where n is the sample size and x̅ is the average value of xmedianmedian of a numeric data sampleentropycalculates Shannon entropy of a set of valuesskewskewness of a set of valueskurtosiskurtosis of a set of valuesquantileapproximate quantile of a numeric data sequence (havelevelargument from 0 to 1, 0.5 is median)
For example to calculate average reward:
average(of: Reward_Total)
Over Two Variables
Some statistics require 2 variables.
One variable is specified in of attribute, the other in with attribute, for example:
correlation(of: Reward_Total with: Block_GasUsed)
Elements that calculate different statistics with the self-descriptive names:
covariancevalue of Σ((x - x̅)(y - y̅)) / ncorrelationpearson correlation coefficient: Σ((x - x̅)(y - y̅)) / sqrt(Σ((x - x̅)^2) * Σ((y - y̅)^2))contingencycalculates the contingency coefficient, a value that measures the association between two columns in a table. The computation is similar to the cramersV function but with a different denominator in the square root. Note that this coefficient does not reach 1 even for a near-deterministic relationship — its maximum depends on the dimensions of the underlying table. On data wherecramersapproaches 1, this coefficient sits well below it. Do not read it on a 0–1 scale or compare it directly with Cramér's V; for association strength prefercramers_bias_correctedrank_correlationrank correlation coefficient of the ranks of x and y. The value of the correlation coefficient ranges from -1 to +1. The value close to +1 denotes a high linear relationship, and with an increase of one random variable, the second random variable also increases. The value close to -1 denotes a high linear relationship, and with an increase of one random variable, the second random variable decreases. The value close or equal to 0 denotes no relationship between the two random variables.cramersCramér's V (sometimes referred to as Cramér's phi) is a measure of association between two columns in a table. The result of the cramers function ranges from 0 (corresponding to no association between the variables) to 1 and can reach 1 only when each value is completely determined by the other. It may be viewed as the association between two variables as a percentage of their maximum possible variation.cramers_bias_correctedCramér's V is a measure of association between two columns in a table. The result of the cramersV function ranges from 0 (corresponding to no association between the variables) to 1 and can reach 1 only when each value is completely determined by the other. The function can be heavily biased, so this version of Cramér's V uses the bias correction.theils_correctedcalculates the Theil's U uncertainty coefficient, a value that measures the association between two columns in a table. A value of 0.0 indicates the absence of association, and the magnitude grows towards 1.0 as association strengthens.The metric is namedtheils_corrected, nottheilsQuerying
theilsfails withCannot query field "theils". Note also that a strong association returns a value near −1, not +1 — interpret magnitude, not sign.
The following are also available and are not listed above:
giniGini coefficient of the values — 0 is perfectly even, 1 is fully concentratedtheil_indexTheil index, an entropy-based concentration measureentropyShannon entropy of the value distribution, in bitsnakamotothe number of rows that together account forratioof the total ofof(takesratio, notif)skew,kurtosis,dispersion,median,quantiledistribution shape and position
You can use a condition on any of these metrics except
gini, nakamoto and theil_index, which do not accept an if argument.
Ready to run this in production?
Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.