<div dir="ltr"><div>One approach:<br></div><div><br></div><div>[1] compute the climatological monthly means and then calculate the monthly anomalies: x(time,lat,lon)<br></div><div><pre>  xMonClm = <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/clmMonTLL.shtml"><strong>clmMonTLL</strong></a> (x)                  ; monthly climatology   (12,lat,lon)
  xMonAnom = <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/calcMonAnomTLL.shtml"><strong>calcMonAnomTLL</strong></a> (x,xMonClm)    ; (time,lat,lon);  (0,1,2)
</pre></div><div><br></div><div>[2]<strong> xDtrend = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dtrend_n.shtml">dtrend_n</a></strong>(xMonAnom,True,0)                ; trend returned as attribute</div><div>     printVarSummary(xDtrend)</div><div><br></div><div>======</div>NCL is not a statistics package. It does have some simple regression functions.<br><div><div><br></div><div><p>
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/regline.shtml"><strong>regline</strong></a>,
<a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/regline_stats.shtml"><strong>regline_stats</strong></a>,
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef.shtml"><strong>regCoef</strong></a>, <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml"><strong>regCoef_n</strong></a>,
<a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/reg_multlin_stats.shtml"><strong>reg_multlin_stats</strong></a></p><p><a href="https://www.ncl.ucar.edu/Document/Functions/Bootstrap/bootstrap_regcoef.shtml"><strong>bootstrap_regcoef</strong></a><br></p><p><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/equiv_sample_size.shtml"><strong></strong></a><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/rtest.shtml"><strong></strong></a>
</p></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 29, 2022 at 2:30 PM Debasish Hazra via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>I am analyzing 25 years monthly data (300 months) of a variable and would like to measure the trend of the variable from beginning to the end of the time. Questions are :</div><div>1. How do I remove the seasonal variability by using a 12-month running average prior to computing the linear trend. What function in NCL to be used.</div><div>2. Is there any weighted least square linear regression available in NCL to be used for regression and trend analysis ? <br></div><div><br></div><div>Appreciate your suggestions.</div><div>Thanks,</div><div>Deba<br></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>