**To**:**siva <sivamtech07@xxxxxxxxxxxxxx>****Subject**:**Re: [ferret_users] Trend error and significance****From**:**Peter Szabo <szabpet83@xxxxxxxxx>**- Date: Mon, 10 Aug 2009 10:46:33 +0200
- Cc: ferret_users@xxxxxxxx, yangxing zheng <yangxingz@xxxxxxxxx>
- 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:cc:content-type; bh=Ha3lZfZTeaqwFAnfKx8BHsEx4Is5UVEvZlhX3FPWSBA=; b=vDT1HSfwPbGvTe5vfhzRsy9vg/fXaf9eV7dyRMalMhrC0w550zgKF1BL1YYMfy9Lsm 0WMYql9/kzdBuRDV/fbto3tm5ZmyOzNpK+o7uMqnw+4ZRuJrItECRTg4M0C8iHPDVAv5 tdGDiZba5rCmU+1xvZZKjrvMN6VB7PDbf18bc=
- 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 :cc:content-type; b=mXCemuDpJo2OtI2ZGHF3ZwYkXymTN9SRM6uDLUVtiWHOAG0xl1v98et1MVaPyEK5uK 61SPVQM8/BdY3Fv3b0CGzFE93s5W6PqPdpcvrya2/AZAN1UT6iqwvwp223cOXkpqDmqf irjTnRpadng83ZDMkigT47oNr+/UhgXSZO4Eg=
- In-reply-to: <601228.57538.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <20090807130433.43079.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <601228.57538.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: owner-ferret_users@xxxxxxxx

Hello Siva,

to create the trend of your data set, is rather easy: run the regresst operation and before that define p and q as it is said in the JNL.

yes? let p = t[gt=maxm] !suppose my var is maxm with 40 data points in time (its 1D)

yes? let q = maxm

yes? go regresst

yes? plot/vs p,qhat !plot the trendline

to have the significance as well is a bit more complex problem, which i solved with the following: i used the correlation to decide whether the trendline is significant or not using Student's t-test.

yes? let bigr=(rsquare^0.5)*(slope/abs(slope)) !the empirical correlation. the regresst counted its square and i want to decide whether the bigr is positive or negative using slope (its also created after regresst)

yes? let f=40-2 !the number of points is 40, and f is the degrees of freedom

yes? let ttest=((bigr)/((1-(bigr^2))^0.5))*(f^0.5) !this is a t-test value using correlation.

yes? list ttest

We need to look at the two-tailed (or one) t-table and find the desired critical t. If ttest is greater then the critical t-value the trend IS SIGNIFICANT.

yes? let sign=if abs(ttest) ge 1.69 then 1 !1.69 is the value of 90% confidence interval in the two-tailed t-test table.

If you needed more info about this issue, let me know.

Hope this helps (for others as well),

Peter

On Fri, Aug 7, 2009 at 5:51 PM, yangxing zheng <yangxingz@xxxxxxxxx> wrote:

Hi Siva,

I think David Wang has provided a method that posted couple months ago. I copy the message for you, as shown below:

-------------------------------------------

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.

--------------------------------------------------------------------------------

--- OnFri, 8/7/09, sivawrote:<sivamtech07@xxxxxxxxxxxxxx>

From: siva <sivamtech07@xxxxxxxxxxxxxx>

Subject: [ferret_users] Trend error and significance

To: ferret_users@xxxxxxxx

Date: Friday, August 7, 2009, 9:04 PMHi all,

I want to do trend analysis.

Actually i am able to get trend of a particular variable, using regresst.jnl. But there is no variable inside this JNL, defining trend error and confidence level of the trend.

Is there any function/JNL for getting these?

Thanks in advance..

Regards

S.Siva Reddy

Senior Research Fellow

UCESS/INCOIS

University of Hyderabad

Hyderabad

Mob:9908248120

**References**:**[ferret_users] Trend error and significance***From:*siva

**Re: [ferret_users] Trend error and significance***From:*yangxing zheng

- Previous by thread:
**Re: [ferret_users] Trend error and significance** - Next by thread:
**Re: Re: [ferret_users] Trend error and significance**

Contact Us

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement