简体   繁体   English

计算非线性回归的R ^ 2值

[英]Calculation of R^2 value for a non-linear regression

I would first like to say, that I understand that calculating an R^2 value for a non-linear regression isn't exactly correct or a valid thing to do. 我首先想说的是,我明白计算非线性回归的R ^ 2值并不完全正确或者是有效的事情。

However, I'm in a transition period of performing most of our work in SigmaPlot over to R and for our non-linear (concentration-response) models, colleagues are used to seeing an R^2 value associated with the model to estimate goodness-of-fit. 然而,我正处于将SigmaPlot中的大部分工作执行到R的过渡期,对于我们的非线性(浓度 - 响应)模型,同事习惯于查看与模型相关的R ^ 2值来估计优度-of配合。

SigmaPlot calculates the R^2 using 1-(residual SS/total SS), but in RI can't seem to extract the total SS (residual SS are reported in summary). SigmaPlot使用1-(残留SS /总SS)计算R ^ 2,但在RI中似乎无法提取总SS(残留SS在摘要中报告)。

Any help in getting this to work would be greatly appreciated as I try and move us into using a better estimator of goodness-of-fit. 当我尝试使用更好的适合度估算器时,我将非常感激任何帮助实现这一点。

Cheers. 干杯。

Instead of extracting the total SS, I've just calculated them: 我没有提取总SS,而是计算了它们:

test.mdl <- nls(ctrl.adj~a/(1((conc.calc/x0)^b)),
                data=dataSet,
                start=list(a=100,b=10,x0=40), trace=T);

1 - (deviance(test.mdl)/sum((ctrl.adj-mean(ctrl.adj))^2))

I get the same R^2 as when using SigmaPlot, so all should be good. 我得到与使用SigmaPlot时相同的R ^ 2,所以一切都应该是好的。

所以y的总变化就像(n-1)* var(y),并且未解释的比例我的模型是sum(residuals(fit)^2)所以做类似1-(sum(residuals(fit)^2)/((n-1)*var(y)) )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM