[R] Computation of r.squared for weighted least squares linear models

Anindya Mozumdar r@dmuzom @end|ng |rom out|ook@com
Tue Jan 7 15:54:28 CET 2020

Dear Sebastian,

I was able to replicate the R^2 value of 0.993019 using the function provided as the second answer (by Julien Massardier) to the following question - https://stats.stackexchange.com/questions/83826/is-a-weighted-r2-in-robust-linear-model-meaningful-for-goodness-of-fit-analys

Thank you.


recently I posted a question about how R computes the value for the 

"r.squared" statistic internally for weighted least squares linear 

models on crossvalidated.com (see: 


including a minimal code example but unfortunately did not get an answer.

I would greatly appreciate if any of you who know the answer could reply 

either here or directly on my post on crossvalidated.

Thanks a lot in advance!


Sebastian Starke

Computational Science Group (FWCC)

Department of Information Services and Computing (FWC)

Building 312, Room 9

Phone: +49 - 351 - 260 3693

Helmholtz-Zentrum Dresden-Rossendorf e.V.


Vorstand: Prof. Dr. Dr. h. c. Roland Sauerbrey, Dr. Ulrich Breuer

Vereinsregister: VR 1693 beim Amtsgericht Dresden


R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see


PLEASE do read the posting guide 

and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list