[gradsusr] Linear Regression with GrADS (Temperature vs. Time)

Stephen McMillan smcmillan at planalytics.com
Tue Jun 10 13:37:21 EDT 2014


Corey and Forum,
My previous comments were intended for a local recipient--my apologies for
the inadvertent transmission!  Good luck in getting the help you requested.
Stephen


On Tue, Jun 10, 2014 at 12:40 PM, Corey Gabriel <cjgabriel7 at gmail.com>
wrote:

> Hello GrADS Forum:
>
> I have been trying to use GrADS to perform a linear regression for some
> time now.  My goal is to remove the linear trend in sea surface
> temperatures over time in  the NINO regions in the tropical Pacific so that
> I can diagnose El Nino and La Nina events without being confounded by the
> ongoing warming trend.
>
> It seems reasonable to use sea surface temperature and time as the
> independent and dependent variables.
>
>
> Here is my code (important parts bolded and annotated)
>
> xdfopen MIROCESMG43_24.ctl
> set grads off
> set display color white
> set datawarn off
> set y 1
> set z 1
> set t 1 1020
> define nino34 = aave(sst, lon=190, lon=240, lat=-5, lat=5)
> set t 1 12
> define nino34clim=(ave(nino34,t+0,t=1020,12))
> modify nino34clim seasonal
> set y 1
> set z 1
> set t 1 1020
>
> *nino34anom=nino34-nino34clim*
> *# Remove all but the anomaly from the SST over the region*
> *define tt=t*
> *#Rename t (time) as 'tt' so that it can be used as the dependent variable
> in the tregr function*
> *coeff= tregr(nino34anom,tt,t=1,t=1020)*
> *#Coeff is the output of the tregr function (see documentation page).  *
> *nino34detrend = nino34anom - tt* coeff*
> *d nino34detrend*
>
> Any assistance would be greatly appreciated!
>
> Thanks,
> Corey
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>

***************************************************
The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary. 

If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.
***************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140610/71326fd9/attachment.html 


More information about the gradsusr mailing list