trend and r2

praise praise praise_city1 at HOTMAIL.COM
Wed Nov 15 21:36:43 EST 2006


Hello,

I don't know why it is zero (because the script was extracted from GRADSUSR
archives).
But I have extracted the data (in ASCII) and verified the regression slopes
in Excel.

The results (both slope and intercept)  from GrADS and excel agreed.

MC


>From: Jiande Wang <jiande at ATMOS.UMD.EDU>
>Reply-To: GRADSUSR at LIST.CINECA.IT
>To: GRADSUSR at LIST.CINECA.IT
>Subject: Re: trend and r2
>Date: Wed, 15 Nov 2006 13:32:43 -0500
>
>Hi,
>   I just felt it strange on the script: "xvar = yvar*0 + 1", why
>time it with a zero? is it a typo?
>
>Thanks.
>Jiande
>
>
>  2006, praise praise wrote:
>
>>Dear Grads users,
>>
>>I know that the Trends or Slopes of a field can be computed as
>>follows
>>(extracted from GRADSUSR archives).
>>However, how can I modify to find out the r^2 (ie to determine the
>>significance of the trend or slope)?
>>Thanks
>>
>>MC
>>=====================================================================
>>'open file'
>>'set lon 88'
>>'set lat 0'
>>'set t 1 24' * assuming this is the time limit
>>*** 'define yvar = aave(...)'
>>
>>'d yvar'
>>
>>* make a variable 1, 2, ..., 24 to calculate m and c of y = mx + c
>>'xvar = yvar*0 + 1'
>>'xvar = const(xvar,1,-u)'
>>'xvar = 25 - sum(xvar,t+0,t=24)'
>>
>>'set t 1'
>>
>>'define p = sum(xvar,t=1,t=24)'
>>'define q = sum(yvar,t=1,t=24)'
>>'define r = sum(xvar*yvar,t=1,t=24)'
>>'define s = sum(xvar*xvar,t=1,t=24)'
>>
>>'define rn = ave(xvar*yvar,t=1,t=24)'
>>'define n = r/rn'
>>* amp is the slope or trend
>>'define amp =  (n*r - p*q)/(n*s - p*p)' * this is m
>>'define ave = (q - amp*p)/n' * this is c
>>==================================================
>>
>>_________________________________________________________________
>>MSN Tool Bar 幫你刪除惱人的廣告 ! http://toolbar.msn.com.hk
>>

_________________________________________________________________
Hotmail Extra Storage讓你獲得10MB 額外儲存空間,請即申請!
http://join.msn.com/?pgmarket=zh-hk



More information about the gradsusr mailing list