getR2pop | R Documentation |
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"))
obs |
Vector of observed values. |
pred |
Vector of predicted values. |
pop |
Vector of pop identifiers. |
type |
The type of R-squared to calculate: |
Returned R-squared might be negative. This indicates that the prediction is worse than using the mean.
If type="within"
, a list of 2 named vectors with R-squared and rmse for
each populaiton. Otherwise a scalar (the R-squared).
getR2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.