**To**:**ferret_users@xxxxxxxx****Subject**:**[ferret_users] Re: confidence interval for a linear regression****From**:**David Wang <climater@xxxxxxxxx>**- Date: Thu, 12 Mar 2009 15:47:35 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=F3O/TUl2FpgbFxs0YLTwFlTdUxCQaXUHwPxSvEdxWyg=; b=DJi6/9fTixjisofY+x4Fgn00FSH3JajZGAYVbzKf3RDOVFSWjRT4oTAKpoKEg31N0B 6zYH104ZwQ4ipAycIcC6Cf6XJMdJxLjBEMYYyNDC83zZ24TNEwa1XnyP6+SR4ctu+WOO UH3dEIRnLZqFc3NEaEMBslWyMNzLJCKC7HWmk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uaimAScWIkndUOcFnr0gtu7VSsFCrRqnB6j8dAOZEylHR9adVJ7Fv/uNyY8caqgLpr B5pv7+ulv6uTGQbvijDFi0xn2QCRNIOS7Zyq2tCCy71xQ1Lb2R7QqZUInuCqrK/b+1gQ nvrVkx8TU6+Z3LvT6SVxtRZ8tVHjshsxWK1ho=
- In-reply-to: <8be1369e0903051508u5d8bbcew109cedc81cca1e11@xxxxxxxxxxxxxx>
- References: <8be1369e0903051508u5d8bbcew109cedc81cca1e11@xxxxxxxxxxxxxx>
- Sender: owner-ferret_users@xxxxxxxx

BTW, there is a caveat that the approximation of 95% confidence interval by "two sigma" can only be used when the degree of freedom is sufficient large. This student's t-table makes it clear (t = slope/sigmab).

http://www.ncsu.edu/chemistry/resource/t-table.html

D.

On Thu, Mar 5, 2009 at 7:08 PM, David Wang <climater@xxxxxxxxx> wrote:

Hi Ferreters,

I recently wanted to calculate the 95% confidence interval for a linear regression by the way of regresst.jnl, and found it's quite straightforward. There is a question on this in the archive that remains unanswered (http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2006/msg00428.html). So I put forth my two cents here risking everybody has already known it.

The idea is that 95% confidence interval is about "two sigma" (http://en.wikipedia.org/wiki/Uncertainty#Measurements). So the problem boils down to estimating the sampling standard deviation of the regression slope. Following Wilks's book (statistical methods in atmospheric science, chapter 6.2), the sampling distribution for slope is Gaussian and its sampling standard deviation is given in the equation 6.18b. In Ferret, after regresst.jnl, issue the following two commands:

let >let sigmab = ((qvar/pvar-slope*slope)/(ones[t=@sum]-2))^0.5

And the 95% error bar is 2*sigmab. If the confidence interval at a different significance level (say, 90%) is desirable, one can simply go to the lookup table for the t-test and figure out how many "sigma" s/he needs.

HTH,

D.

--

life grows, death doesn't. there is no dress rehearsal.

--

life grows, death doesn't. there is no dress rehearsal.

**References**:**[ferret_users] confidence interval for a linear regression***From:*David Wang

- Previous by thread:
**[ferret_users] confidence interval for a linear regression** - Next by thread:
**[ferret_users] Reversing time axis**

Contact Us

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement