<div dir="ltr">Hi Michael,<div>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.</div>
<div><br></div><div>Otherwise, the defining nino34anom part makes sense and is similar to what I did.</div><div><br></div><div>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).</div>
<div><br></div><div>Thanks</div><div>Steve Mc</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 10, 2014 at 12:40 PM, Corey Gabriel <span dir="ltr"><<a href="mailto:cjgabriel7@gmail.com" target="_blank">cjgabriel7@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello GrADS Forum:<div><br></div><div>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.</div>
<div><br></div><div>It seems reasonable to use sea surface temperature and time as the independent and dependent variables.</div><div> <br></div><div><br></div><div><div>Here is my code (important parts bolded and annotated)</div>
<div><br></div><div>xdfopen MIROCESMG43_24.ctl</div><div>set grads off</div><div>set display color white</div><div>set datawarn off</div><div>set y 1<br></div><div>set z 1</div><div>set t 1 1020</div><div>define nino34 = aave(sst, lon=190, lon=240, lat=-5, lat=5)</div>
<div>set t 1 12<br></div><div>define nino34clim=(ave(nino34,t+0,t=1020,12))</div><div>modify nino34clim seasonal</div><div>set y 1</div><div>set z 1 </div><div>set t 1 1020</div><div><b>nino34anom=nino34-nino34clim<br></b></div>
<div><i># Remove all but the anomaly from the SST over the region</i></div><div><b>define tt=t</b></div><div><i>#Rename t (time) as 'tt' so that it can be used as the dependent variable in the tregr function</i></div>
<div><b>coeff= tregr(nino34anom,tt,t=1,t=1020)</b></div><div><i>#Coeff is the output of the tregr function (see documentation page). </i></div><div><b>nino34detrend = nino34anom - tt* coeff</b></div><div><b>d nino34detrend</b></div>
</div><div><br></div><div>Any assistance would be greatly appreciated!</div><div><br></div><div>Thanks,</div><div>Corey</div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
<pre>***************************************************
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.
***************************************************