From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18641 invoked by alias); 26 Sep 2007 16:20:08 -0000 Received: (qmail 18622 invoked by uid 22791); 26 Sep 2007 16:20:07 -0000 X-Spam-Check-By: sourceware.org Received: from rwcrmhc12.comcast.net (HELO rwcrmhc12.comcast.net) (204.127.192.82) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Sep 2007 16:20:04 +0000 Received: from hippogriff.homeunix.org ([24.8.97.215]) by comcast.net (rwcrmhc12) with ESMTP id <20070926161959m1200fdf33e>; Wed, 26 Sep 2007 16:19:59 +0000 Received: by hippogriff.homeunix.org (Postfix, from userid 1000) id 89F3831BE3; Wed, 26 Sep 2007 10:20:05 -0600 (MDT) Date: Wed, 26 Sep 2007 16:20:00 -0000 From: Patrick Alken To: gsl-discuss@sourceware.org Subject: Re: computing R-squared with gsl_multifit Message-ID: <20070926162005.GA27449@hippogriff.physics.drexel.edu> References: <20070925194628.GA22578@hippogriff.physics.drexel.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00044.txt.bz2 > A question: is the formula the same for both weighted and unweighted > fits? No, unfortunately. R^2 = 1 - chisq / Sum [ w_i * (y_i - mean(y))^2 ]. In the case of weighted data, the mean(y) is also a weighted mean: mean(y) = 1/sum [ w_i ] * sum [ w_i y_i ] I looked at the GNU R source to verify all this. > > -- > Brian Gough >