From: Christoph on 21 Jul 2010 09:16 Hi, does anyone know the best way to compute R squared and adjusted R squared values when running a regression with lscov? Thanks a lot!! Christoph
From: Greg Heath on 21 Jul 2010 23:21 On Jul 21, 1:16 pm, Christoph <ennobehr...(a)web.de> wrote: > Hi, > > does anyone know the best way to compute R squared and adjusted R squared values when running a regression with lscov? > > Thanks a lot!! > What candidates are you considering? Hope this helps. Greg
From: Peter Perkins on 22 Jul 2010 08:03 On 7/21/2010 1:16 PM, Christoph wrote: > does anyone know the best way to compute R squared and adjusted R squared values when running a regression with lscov? Christoph, it's straight-forward to compute those from their definitions. For example: b = lscov(X,y); sse = sum((y - X*b).^2); sst = sum((y - mean(y)).^2); rsq = 1 - sse/sst; You could also simplify this a bit using the MSE output, and the VAR function. If you have access to the Statistics Toolbox, both REGRESS and REGSTATS compute r-squared. Hope this helps.
From: Christoph on 23 Jul 2010 07:11 Thanks Peter! Just out of interest, how would you compute the R^2 with the mse output and the var function?
From: Peter Perkins on 23 Jul 2010 17:46 On 7/23/2010 11:11 AM, Christoph wrote: > Just out of interest, how would you compute the R^2 with the mse output and the var function? Well, MSE is SSE/(n-p), right? Similarly, VAR is SST/(n-1) (or n, depending on how you compute it). So, 1 - (mse*(n-p))/(var*(n-1)).
|
Pages: 1 Prev: MCRInstaller with another Matlab version Next: Create a Word document using Matlab |