This function calculates the coefficient of determination (\(R^2\)) for a given model by comparing the sum of squared errors (SSE)
to the total sum of squares (SST).
Usage
calc_r2(model)
Value
A numeric value representing the \(R^2\) value of the model. Returns NA if the model is NULL.
Arguments
model
A fitted model object. The model must have resid() and fitted() methods to extract residuals and fitted values.