linear trend with monthly series

Eduardo Agosta Scarel eduardo.agosta at GMAIL.COM
Wed Jul 2 05:38:25 EDT 2008


Dear Folks,

I am trying to extimate linear trend in an interannual series of one-monthly
data from a multy-year monthly data file.
I can estimate properly the linear trend using the script below, if the data
file has the one-monthly data series previously separately. The problem is
when using the full monthly multy-year data file.

How can I just select one given month from the data , for instance June, and
estimate the linear trend for the June-series alone, having a multy-year
data file with all the months of the year?
I have tried using the function monmask (with argument 6), but I cannot
solve it properly.

Any suggestion I will much appreciate.

Eduardo.

reinit'
'sdfopen d:\anterior\era\mes.nc'
'set clopts -1 -1 0.16'
'set mproj sps'
k=70

'set grads off'
'set lev 'k''
'set mproj sps'
'set lat -90 0'
'set lon  -180 180'

'set lat -60'
'set lon  -180'
'set t 1 132'
* contruyo variable lineal 1, 2, ..., 276 to para calcular m y c de y = mx +
c
'xvar = 100*t*0 + 1'
'xvar = const(xvar,1,-u)'
'xvar = 133 - sum(xvar,t+0,t=132)'

'set lat -90 0'
'set lon  -180 180'
'set t 1'

'define coeff = tregr(xvar,100*t,t=1, t=132)'
'define tave = ave(100*t, t=1, t=132)'
'define xvarave = ave(xvar, t=1, t=132)'
'define trend = coeff*(xvar - xvarave) + tave'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080702/fcd4162c/attachment.html 


More information about the gradsusr mailing list