简体   繁体   中英

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.

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 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).

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:

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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