Re: [R] lm: how to calculate rsquared of the predicted values?

From: Max Kuhn <>
Date: Sat, 8 Dec 2007 12:38:01 -0500

> 1. can I measure de R-squared value between the predicted(by the model) and
> real (observed) values.?
> 2. Measure the RMSE error .

There is a function in the caret package called postResample that will do that (even if you aren't using resampling).

As has been previously noted on this list, there are a number of formulas for R-squared. This function uses the square of the correlation between the observed and predicted. The next version of caret will offer a choice of formulas.



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 08 Dec 2007 - 17:43:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 08 Dec 2007 - 19:30:20 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.