[gradsusr] Linear Regression with GrADS (Temperature vs. Time)
Stephen McMillan
smcmillan at planalytics.com
Tue Jun 10 13:19:27 EDT 2014
Hi Michael,
I can see a major problem in this guy's thinking...using "time" as both the
independent variable and time variable. It doesn't make sense to do that
since time is already known...unless I'm totally missing what he's trying
to do.
Otherwise, the defining nino34anom part makes sense and is similar to what
I did.
It'll be interesting to see what sort of response he gets, but I can
imagine it'll be something along the lines of "where's your dependent
variable (besides time).
Thanks
Steve Mc
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/a4013037/attachment.html
More information about the gradsusr
mailing list