R squared is calculated as the ratio of the variance explained by the model to the total variance of the data. Mathematically, it can be expressed as: \[ R^2 = 1 - \frac{SS_{res}}{SS_{tot}} \] where \( SS_{res} \) is the sum of squares of residuals and \( SS_{tot} \) is the total sum of squares. In catalysis, these sums are derived from the differences between observed and predicted reaction rates or product concentrations.