[R] r-squared equivalent for locally-smoothed figures?

John Fox jfox at mcmaster.ca
Tue Feb 3 23:11:14 CET 2004


Dear Stuart,

Since residuals(mod) works for models fit by locfit(), you could calculate 
an analog to R^2 as 1 - (sum(residuals(mod)^2)/sum((y - mean(y))^2). I'm 
not sure whether you can get residuals from sm.

I hope that this helps,
  John

At 03:44 PM 2/3/2004 +0000, Stuart Leask wrote:
>Does anyone know a rough equivalent of the r-squared statistic for lines or
>surfaces fitted to data using local smoothing (eg. using the sm or locfit
>libraries)? I feel there must be some manner in which such locally-smoothed
>figures explain a fraction of the total squared error in the data...  Can
>such a fraction be obtained from locfit (or sm) objects?
>
>Stuart

____________________________
John Fox
Department of Sociology
McMaster University
email: jfox at mcmaster.ca
web: http://www.socsci.mcmaster.ca/jfox




More information about the R-help mailing list