Осипов Денис
2012-Nov-11 05:36 UTC
[R] Plotting the regression curve with its confidence interval
Hello. How can I plot the regression curve with its confidence interval? I use nls(y~a*x^b), then plot(x,y), add curve with lines(x,predict(nls(y~a*x^b))). But I can't add to plot CI for my curve. Thanks in advance, Denis [[alternative HTML version deleted]]
David Winsemius
2012-Nov-11 07:33 UTC
[R] Plotting the regression curve with its confidence interval
On Nov 10, 2012, at 9:36 PM, ?????? ????? wrote:> Hello. > > How can I plot the regression curve with its confidence interval? > I use nls(y~a*x^b), then plot(x,y), add curve with lines(x,predict(nls(y~a*x^b))). But I can't add to plot CI for my curve.Have your read: ?predict.nls # ? -- David Winsemius, MD Alameda, CA, USA
Jim Lemon
2012-Nov-11 07:34 UTC
[R] Plotting the regression curve with its confidence interval
On 11/11/2012 04:36 PM, ?????? ????? wrote:> Hello. > > How can I plot the regression curve with its confidence interval? > I use nls(y~a*x^b), then plot(x,y), add curve with lines(x,predict(nls(y~a*x^b))). But I can't add to plot CI for my curve. >Hi Denis, If you know where you want the lines for the CI the dispersion function in the plotrix package will do what you want, use the type=l and border=1 arguments with fill=NA. Jim