StatsBase has coefficient of determination. StatsBase.jl includes many functions that were felt to be too little used for the base installation's Statistics.jl
From the docs of that package:
StatsAPI.r2
—
Function
r2(model::StatisticalModel)
r²(model::StatisticalModel)
Coefficient of determination (R-squared).
For a linear model, the R² is defined as ESS/TSS, with ESS the explained sum of squares and TSS the total sum of squares.
Particularly, instances of StatisticalModel implement the following methods.
StatsAPI.adjr2
—
Function
adjr2(model::StatisticalModel)
adjr²(model::StatisticalModel)
Adjusted coefficient of determination (adjusted R-squared).
For linear models, the adjusted R² is defined as 1 - (1 - (1-R^2)(n-1)/(n-p)), with R^2 the coefficient of determination, n the number of observations, and p the number of coefficients (including the intercept). This definition is generally known as the Wherry Formula I.