getR2pop.Rd
Calculates R-squared values for each population. Can also compute modified total R-squared values, with data centered and/or scaled within populations. This can provide a more useful total fit estimate if the populations have very different local means.
getR2pop(obs, pred, pop, type = c("within", "centered", "scaled"))
Vector of observed values.
Vector of predicted values.
Vector of pop identifiers.
The type of R-squared to calculate: "within"
(default) gets
within-population, "centered"
gets across-population but with local means removed,
"scaled"
get across-population but with local scaling (local means removed and
rescaled to unit variance).
If type="within"
, a list of 2 named vectors with R-squared and rmse for
each populaiton. Otherwise a scalar (the R-squared).
Returned R-squared might be negative. This indicates that the prediction is worse than using the mean.