<div dir="ltr"><div>Dear Grads Community: </div><div><br></div><div>I am attempting to remove a linear trend from several time series.  (Figure attached).  I have tried many things, and I wrote a small block of similar code that I am using to try to draw the linear trend line.  </div>
<div><br></div><div>Any assistance would be greatly appreciated,</div><div><br></div><div>Thanks,</div><div>Corey</div><div><br></div><ol><li>set y 1
</li><li>set z 1
</li><li>set t 1 1753</li><li>define var1 = aave(sst, lon=-5, lon=5, lat=190, lat=240)
</li><li>define var2= ave(var1,t+0,t=1872,12))</li><li>d tregr(var1, var2, t=1, t=1753) [Result is the coefficient)</li><li><span style="font-size:12pt"><span><span style="font:7pt/normal &quot;Times New Roman&quot;;font-size-adjust:none;font-stretch:normal"><font color="#000000"> </font></span></span></span><span style="font-size:12pt"><font color="#000000">define coeff = tregr(var1, var2, t=1, t=1753)</font></span></li>
<li><span style="color:black;font-family:&quot;Courier New&quot;;font-size:12pt">d coeff * (var1-
var2) + var2</span></li><pre><br></pre></ol></div>