[ncl-talk] confidence interval on a regression line

debasish mazumder debasish at ucar.edu
Tue May 5 11:57:27 MDT 2015


Hi All,

I am trying to plot  confidence interval on a regression line (like 
attached image)

I have x and y two variables.

x varies between -0.07 and 0.06
y varies between -0.8 and  0.5

I followed following steps:

step 1:  rc   = regline (x,y)

step 2: yReg = rc*x + rc at yintercept ; regression line

step 3: /a = rc at rstd/ * 2.048 ; where /t/ for 0.975 and 28 degrees of 
freedom is 2.048 [table look-up].

step 4: confidence interval  rc1 = rc+a and rc2 = rc-a

step 5: confidence interval around regression line
            yReg_1 = rc1*x + rc at yintercept
            yReg_2 = rc2*x + rc at yintercept

But I am not getting the expected plot. Moreover yReg_1 and yReg_2 
intersect each other.
Could you please point out what I am doing wrong.

with regards
-Debasish





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150505/f34360cd/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image019.png
Type: image/png
Size: 9991 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150505/f34360cd/attachment.png 


More information about the ncl-talk mailing list