<div dir="ltr"><div><br></div><div><br>[1] Minor comment: you do not have to set<br><br><div>ts1@_FillValue = 1e20</div><div>ts2@_FillValue = 1e20<br><br></div><div>ts1 and ts2 can have different _FillValue. NCL does not care.<br><br></div><div>[2] Did you look at the range for tmp2<font face="Calibri,sans-serif"><span><font color="#d24726">? Something is strange.<br> tmp2: min=0 max=304.18</font></span></font><br></div><div> <font face="Calibri,sans-serif"><span><font color="#d24726">tmp1: min=231.963 max=304.787<br><br></font></span></font></div><div><font face="Calibri,sans-serif"><span><font color="#d24726"> Likely, you should set: tmp2 = where (tmp2.eq.0, tmp2@_FillValue,tmp2)<br></font></span></font></div><div><br>[3] You did not include the value for Nx. This is one key to you problem. <br><br><div> Nx = num(.not.ismissing(ts1)) ; all gridpoints at all times (ntim*nlat*mlon)<br><br></div></div><div> This is a very large number. If there were no _FillValue: Nx= 360*90*180=5832000.<br> It will be less than that if there are _FillValue present. Still, it will be a large number. <br><br> 'escorc' is calculating the linear cross correlation coefficient. As noted in the documentation,<br>===<br> "The linear correlation coefficient (<b>r</b>) for <i>n</i> pairs of independent
observations can be tested <br> against the null hypothesis (ie.: no
correlation) using the statistic
<pre> tval = <b>r</b>*sqrt[ (<i>n</i>-2)/(1-<b>r</b>^2) ]
</pre>
<br> This statistic has a Student <i>t</i> distribution with
<i>n</i>-2 degrees of freedom.<br></div><div>===<br></div><div>Here 'n' is the number of ******independent****** values.</div><div><br>Look at the Student-t distribution. See table at: <br> <a href="http://en.wikipedia.org/wiki/Student%27s_t-distribution" target="_blank">http://en.wikipedia.org/wiki/Student%27s_t-distribution</a> <br>Look at the degrees of freedom... Your dof would be 5832000-1 (infinity).<br>Then look at the t-statistic Even with infinite dof the largest values are ~3.3<br>Punch line ... any value will be significant if you use dof=5832000-1<div><br>**********<br><br></div></div><div>[a] You should use the appropriate number of **time values**. ***If***every monthly time series value <br> were independent you would have ntim-2 degrees of freedom (360-2) NOT 5832000-2<br></div><div> degrees of freedom which is what you used. Assuming independence in time values, <br> the way to determine the Nx at each grid point would be.<br><br></div><div> Nx = dim_num_n(ts1,2) ; look at documentation. know what it does.<br><br></div><div> This is not appropriate for your application .... Why? see [b]<br></div><div><br></div><div>[b] More problematical ... If you have not removed the annual cycle, there is a *HIGH* <br> degree of auto-correlation within each series. Autocorrelation reduces the number <br></div><div> of independent values.<br><br> I would suggest using sst anomalies. This will reduce but not eliminate autocorrelation <br> One way to estimate dof in the presence of autocorrelation is NCL's<br><br> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/equiv_sample_size.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/equiv_sample_size.shtml</a><br><br></div><div> You will get two dof estimates. One for each data set. Pick the lesser and use it in rtest.<br><br></div><div>==========<br></div><div>To avoid constant email exchanges, I am including what I think will work.<br><br></div><div>PLEASE .. look and understand what is being done. The printVarSummary(...)<br></div><div>and printMinMax(...) are for *you* to look at ... not ncl-talk. <br><br></div><div>ncl-talk is not a statistical advising forum. Please talk with a colleague about<br></div><div>these statistical issues. <br><br></div><div>Finally, please send responses to ncl-talk only. PLEASE do not include<br></div><div>a personal salutation (Hi Dennis). Likely, there are many people who know more<br></div><div>statistics than me .<br><br>++++++++++++++++++<br>The following code could be simplified a bit if you had NCL v6.2.1 by using escorc_n<br> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/escorc_n.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/escorc_n.shtml</a><br>====<br><br>; Compute climatologies and anomalies. This removes the annual cycle. <br><br> tmp1Clm = clmMonTLL(tmp1)<br> tmp1Anom= calcMonAnomTLL(tmp1, tmp1Clm)<br> printVarSummary(tmp1Anom)<br><br> tmp2Clm = clmMonTLL(tmp2)<br> tmp2Anom= calcMonAnomTLL(tmp2, tmp2Clm)<br> printVarSummary(tmp2Anom)<br> <br>; For convenience, reorder and store the data<br><br> TMP1 = tmp1Anom(lat|:,lon|:,time|:)<br> TMP2 = tmp2Anom(lat|:,lon|:,time|:)<br><br> delete( [/tmp1Anom, tmp2Anom /] ) ; no longer needed<br><br>; Compute cross correlation coefficients at 0-lag<br><br> r = escorc( TMP1, TMP2 ) ; (nlat,mlon)<br> copy_VarCoords(TMP1(:,:,0),r)<br> r@long_name = "linear cross correlation"<br> printVarSummary(r)<br> <br>; Calculate degrees of freedom for each time series pair<br>; This estimates the dof in autocorrelated series. <br> <br> siglvl = 0.05<br> dof1 = equiv_sample_size (TMP1, siglvl,0)<br> dof2 = equiv_sample_size (TMP2, siglvl,0)<br> printMinMax(dof1, 0)<br> printMinMax(dof2, 0)<br> <br> ; For each grid point time series pair, choose the lesser abs value<br> <br> dof = where(abs(dof1).le.abs(dof2), dof1, dof2) <br> copy_VarCoords(r,dof)<br> dof@long_name = "degrees of freedom"<br> printVarSummary(dof)<br> printMinMax(dof,0)<br> <br> rsig = rtest( r, round(dof,3), 0)<br> rsig@long_name = "significance of r"<br> copy_VarCoords(r,rsig)<br> printMinMax(rsig, 0)<br><br></div></div><div><div><br></div><div><font face="Calibri,sans-serif"><span style="font-size:21px"><br></span></font></div><div><font face="Calibri,sans-serif"><span><font color="#d24726"><br></font></span></font> </div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 2:07 PM, Vanúcia Schumacher <span dir="ltr"><<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><font face="Calibri,sans-serif"><div style="color:rgb(0,0,0)"><span style="font-size:21px">Hi Dennis,</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"><br></span></div><div><span style="font-size:21px">The information follows:</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"><br></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Variable: tmp1</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Type: double</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Total Size: 46656000 bytes</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> 5832000 values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number of Dimensions: 3</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[TIME | 360] x [lat | 90] x [lon | 180]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> TIME: [527040..16260480]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lat: [-89.69999694824219..89.69999694824219]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lon: [ 0..359.7000122070312]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number Of Attributes: 5</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> remap :<span style="white-space:pre-wrap">        </span>remapped via ESMF_regrid_with_weights: Bilinear remapping</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> missing_value :<span style="white-space:pre-wrap">        </span>-9.999999999999999e+33</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> _FillValue :<span style="white-space:pre-wrap">        </span>-9.999999999999999e+33</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> long_name :<span style="white-space:pre-wrap">        </span>SST[GX=X2DEG,GY=Y2DEG]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> history :<span style="white-space:pre-wrap">        </span>From sst</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"><br></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Variable: tmp2</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Type: float</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Total Size: 23328000 bytes</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> 5832000 values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number of Dimensions: 3</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[time | 360] x [lat | 90] x [lon | 180]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> time: [15.5..10941.5]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lat: [-89.69999694824219..89.69999694824219]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lon: [ 0..359.7000122070312]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number Of Attributes: 12</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> remap :<span style="white-space:pre-wrap">        </span>remapped via ESMF_regrid_with_weights: Bilinear remapping</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> associated_files :<span style="white-space:pre-wrap">        </span>baseURL: <a href="http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation" target="_blank">http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation</a> gridspecFile: gridspec_ocean_fx_MRI-CGCM3_decadal1980_r0i0p0.nc areacello: areacello_fx_MRI-CGCM3_decadal1980_r0i0p0.nc</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> _FillValue :<span style="white-space:pre-wrap">        </span>1e+20</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> missing_value :<span style="white-space:pre-wrap">        </span>1e+20</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> history :<span style="white-space:pre-wrap">        </span>2011-08-15T19:52:20Z altered by CMOR: replaced missing value flag (-9.99e+33) with standard missing value (1e+20).</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> cell_measures :<span style="white-space:pre-wrap">        </span>area: areacello</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> cell_methods :<span style="white-space:pre-wrap">        </span>time: mean (interval: 20 minutes)</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> original_name :<span style="white-space:pre-wrap">        </span>tos</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> units :<span style="white-space:pre-wrap">        </span>K</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> comment :<span style="white-space:pre-wrap">        </span>"this may differ from ""surface temperature"" in regions of sea ice."</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> long_name :<span style="white-space:pre-wrap">        </span>Sea Surface Temperature</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> standard_name :<span style="white-space:pre-wrap">        </span>sea_surface_temperature</span></div><div><span style="font-size:21px">(0)<span style="color:rgb(0,0,0);white-space:pre-wrap">        </span><font color="#d24726">tmp2: min=0 max=304.18</font></span></div><div><span style="font-size:21px"><font color="#d24726">(0)<span style="white-space:pre-wrap">        </span>tmp1: min=231.963 max=304.787</font></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"><br></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Variable: ts1</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Type: double</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Total Size: 46656000 bytes</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> 5832000 values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number of Dimensions: 3</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[lat | 90] x [lon | 180] x [TIME | 360]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lat: [-89.69999694824219..89.69999694824219]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lon: [ 0..359.7000122070312]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> TIME: [527040..16260480]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number Of Attributes: 5</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> history :<span style="white-space:pre-wrap">        </span>From sst</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> long_name :<span style="white-space:pre-wrap">        </span>SST[GX=X2DEG,GY=Y2DEG]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> _FillValue :<span style="white-space:pre-wrap">        </span>-9.999999999999999e+33</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> missing_value :<span style="white-space:pre-wrap">        </span>-9.999999999999999e+33</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> remap :<span style="white-space:pre-wrap">        </span>remapped via ESMF_regrid_with_weights: Bilinear remapping</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"><br></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Variable: ts2</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Type: float</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Total Size: 23328000 bytes</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> 5832000 values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number of Dimensions: 3</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[lat | 90] x [lon | 180] x [time | 360]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lat: [-89.69999694824219..89.69999694824219]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lon: [ 0..359.7000122070312]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> time: [15.5..10941.5]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number Of Attributes: 12</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> standard_name :<span style="white-space:pre-wrap">        </span>sea_surface_temperature</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> long_name :<span style="white-space:pre-wrap">        </span>Sea Surface Temperature</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> comment :<span style="white-space:pre-wrap">        </span>"this may differ from ""surface temperature"" in regions of sea ice."</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> units :<span style="white-space:pre-wrap">        </span>K</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> original_name :<span style="white-space:pre-wrap">        </span>tos</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> cell_methods :<span style="white-space:pre-wrap">        </span>time: mean (interval: 20 minutes)</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> cell_measures :<span style="white-space:pre-wrap">        </span>area: areacello</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> history :<span style="white-space:pre-wrap">        </span>2011-08-15T19:52:20Z altered by CMOR: replaced missing value flag (-9.99e+33) with standard missing value (1e+20).</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> missing_value :<span style="white-space:pre-wrap">        </span>1e+20</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> _FillValue :<span style="white-space:pre-wrap">        </span>1e+20</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> associated_files :<span style="white-space:pre-wrap">        </span>baseURL: <a href="http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation" target="_blank">http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation</a> gridspecFile: gridspec_ocean_fx_MRI-CGCM3_decadal1980_r0i0p0.nc areacello: areacello_fx_MRI-CGCM3_decadal1980_r0i0p0.nc</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> remap :<span style="white-space:pre-wrap">        </span>remapped via ESMF_regrid_with_weights: Bilinear remapping</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">warning:escorc: Non-fatal conditions encountered in series or xstd equals zero.</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Possibly, all values of a series are constant.</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">warning:escorc: Most likely, one or more series consisted of all constant values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"><br></span></div><div><span style="font-size:21px">Variable: <font color="#5133ab">ccr</font></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Type: double</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Total Size: 129600 bytes</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> 16200 values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number of Dimensions: 2</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[lat | 90] x [lon | 180]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lat: [-89.69999694824219..89.69999694824219]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lon: [ 0..359.7000122070312]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number Of Attributes: 1</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> _FillValue :<span style="white-space:pre-wrap">        </span>1.000000020040877e+20</span></div><div><span style="font-size:21px">(0)<span style="color:rgb(0,0,0);white-space:pre-wrap">        </span><font color="#5133ab">ccr: min=-0.386039 max=0.986473</font></span></div><div><span style="font-size:21px"><font color="#5133ab"><br></font></span></div><div><div><span style="font-size:21px">Variable: Nx</span></div><div><span style="font-size:21px">Type: integer</span></div><div><span style="font-size:21px">Total Size: 4 bytes</span></div><div><span style="font-size:21px"> 1 values</span></div><div><span style="font-size:21px">Number of Dimensions: 1</span></div><div><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[1]</span></div><div><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(81,51,171);font-size:21px"><br></div></div><div style="color:rgb(0,0,0)"><br></div><div><span style="font-size:21px">Variable: <font color="#8c0095">prob</font></span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Type: double</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Total Size: 129600 bytes</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> 16200 values</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Number of Dimensions: 2</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[lat | 90] x [lon | 180]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px">Coordinates: </span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lat: [-89.69999694824219..89.69999694824219]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> lon: [ 0..359.7000122070312]</span></div><div style="color:rgb(0,0,0)"><span style="font-size:21px"> </span></div><div><span style="font-size:21px">(0)<span style="color:rgb(0,0,0);white-space:pre-wrap">        </span><font color="#8c0095">min=-0.386039 max=0.986473</font></span></div><div style="color:rgb(0,0,0);font-size:16pt"><br></div></font>Script:<div><br></div><div><div>...</div><div> </div><div>begin</div><div><br></div><div>;************************************************</div><div>; open file and read in variable</div><div>;***********************************************</div><div><br></div><div> in1 = addfile("<a href="http://tos_90x180_cfsr.nc" target="_blank">tos_90x180_cfsr.nc</a>","r")</div><div> in2 = addfile("tos_90x180_MRI.nc","r")</div><div> </div><div> tmp1 = in1->tos</div><div> tmp2 = in2->tos</div><div><br></div><div>printVarSummary(tmp1)</div><div>printVarSummary(tmp2)</div><div>print("tmp2: min="+min(tmp2)+" max="+max(tmp2)) </div><div>print("tmp1: min="+min(tmp1)+" max="+max(tmp1)) </div><div><br></div><div>;************************************************</div><div>; reorder to get time as right most dimension</div><div>;***********************************************</div><div><br></div><div> ts1 = tmp1(lat|:,lon|:,TIME|:)</div><div> ts2 = tmp2(lat|:,lon|:,time|:)</div><div><br></div><div>printVarSummary(ts1)</div><div>printVarSummary(ts2)</div><div><br></div><div>;************************************************</div><div>; calculate cross correlations</div><div>;************************************************</div><div><br></div><div>ts1@_FillValue = 1e20</div><div>ts2@_FillValue = 1e20</div><span class=""><div><br></div><div> </div><div> ccr = escorc(ts2,ts1)</div><div> </div><div> copy_VarCoords(ts1,ccr)</div><div><br></div><div>;*************************************************</div><div>; statistical significance of ccr</div><div>;*************************************************</div><div> </div><div> siglvl=0.05</div><div><br></div><div> Nx = num(.not.ismissing(ts1))</div><div> </div><div> prob = rtest(ccr,Nx, 0) </div><div> </div><div> copy_VarCoords(ccr,prob)</div><div><br></div></span><div>; ========================= PLOT 1 ==============================</div><div> wks = gsn_open_wks ("png", "conOncon.mri" ) ; open workstation </div><div><br></div><div> gsn_define_colormap(wks,"cmp_b2r")</div><div> </div><div> res = True ; make plot mods</div><div><br></div><div> res@cnFillOn = True ; turn on color</div><div><br></div><div><br></div><div> res@gsnSpreadColors = True ; use full colormap</div><div><br></div><div><br></div><div> res@lbLabelAutoStride = True ; automatic lb label stride</div><div><br></div><div> res@cnLinesOn = False ; turn off contour lines</div><div><br></div><div> res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels</div><div> res@cnMinLevelValF = -1. ; set min contour level</div><div> res@cnMaxLevelValF = 1. ; set max contour level</div><div> res@cnLevelSpacingF = 0.1 ; set contour spacing</div><div><br></div><div> res@gsnDraw = False ; Do not draw plot</div><div> res@gsnFrame = False ; Do not advance frome</div><div><br></div><div><br></div><div> plot = gsn_csm_contour_map_ce(wks,ccr(:,:), res) </div><div><br></div><div> plot = ZeroNegDashLineContour (plot)</div><div><br></div><div>; ========================= PLOT 2 ==============================</div><div> res2 = True ; res2 probability plots</div><div><br></div><div> res2@gsnDraw = False ; Do not draw plot</div><div> res2@gsnFrame = False ; Do not advance frome</div><div><br></div><div> res2@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels</div><div> res2@cnMinLevelValF = 0.0 ; set min contour level</div><span class=""><div> res2@cnMaxLevelValF = 1.05 ; set max contour level</div><div> res2@cnLevelSpacingF = 0.05 ; set contour spacing</div><div><br></div></span><div> res2@cnInfoLabelOn = False ; turn off info label</div><div><br></div><div> res2@cnLinesOn = False ; do not draw contour lines</div><div> res2@cnLineLabelsOn = False ; do not draw contour labels</div><span class=""><div><br></div><div> plot2 = gsn_csm_contour(wks,gsn_add_cyclic_point(prob(:,:)), res2) </div><div> plot2 = ShadeLtContour(plot2, 0.06, 17) ; shade all areas less than the</div><div> ; 0.05 contour level</div><div> overlay (plot, plot2)</div><div><br></div></span><div> draw (plot)</div><div> frame(wks)</div><div><br></div><div>end</div><span class=""><br><div><font face="Comic Sans MS"><span style="line-height:17px">---</span></font></div><span style="line-height:17px;background-color:rgb(255,255,255)"><font style="font-size:12pt" face="Comic Sans MS" size="3"><font>Vanúcia Schumacher</font></font></span><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font face="Comic Sans MS">Mestranda em Meteorologia - UFV<font style="font-size:12pt" size="3"><font><br style="line-height:17px">Meteorologista -UFPel</font><br></font></font></span></div><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font face="Comic Sans MS"><font style="font-size:12pt" size="3"><font>Departamento de Meteorologia Agrícola - DEA</font></font></font></span></div><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font style="font-size:12pt" face="Comic Sans MS" size="3"><font>Cel: (31) 9978 2522 </font></font></span></div><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font style="font-size:12pt" face="Comic Sans MS" size="3"><font>DEA: (31) 3899 1890</font></font></span></div><br><br></span><div><div class="hm HOEnZb"><hr>Date: Mon, 6 Oct 2014 13:55:27 -0600<br>Subject: Re: [ncl-talk] correlation and the significance<br>From: <a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a><br>To: <a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a><br>CC: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a></div><div><div class="h5"><br><br><div dir="ltr"><div><div><div><div><div><div><div><br>The question is difficult to answer.<br>You have not included information which ncl-talk constantly request of users.<br></div><div><br>[0] Always include the version of NCL you are using.<br></div><div><br></div><div>Always look at your data and the results of assorted calculations via printVarSummary and print<br></div><div><br></div>[1] printVarSummary(ts1) ; ?? (time) => [ntim] ?? or (time,lat,lon) ==> [ntim,nlat,mlon] ??<br></div><div> printVarSummary(ts2)<br><br></div><div>[2] ccr = escorc(ts2,ts1)<br></div><div> printVarSummary(ccr)<br></div><div><br>[3] Nx = num(.not.ismissing(ts1))<br> print(Nx) ; if ts1 is one-dimensional<br></div><div> printVarSummary(Nx) ; if ts1 & ts2 are three-dimensional<br></div><div><br></div> This give you the **total** number of non-missing points.<br></div> If the ts1 and ts2 arrays are three-dimensional, you would likely see a VERY LARGE number<br></div><div> Very large numbers result in everything being significant.<br></div><div><br></div>[4] If ts1 and ts2 are (time,lat,lon) and you have NCL versions 6.1.1 or<br> earlier, then you should reorder the arrays so time is the<br></div> rightmost dimensions . See escorc Example 5.<br><br></div> If you have NCL v6.2.1 and 3D arrays, you can use ccr = escorc_n(ts2,ts1,0)<br><br>====<br></div>Respond *only* to ncl-talk. Please, no personal salutation.<br><div><div><div><div><br></div></div></div></div></div><div><br><div>On Mon, Oct 6, 2014 at 11:09 AM, Vanúcia Schumacher <span dir="ltr"><<a href="mailto:vanucia-schumacher@hotmail.com" target="_blank">vanucia-schumacher@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><font color="#000000" face="Calibri,sans-serif"><span style="font-size:21px">I need to plot correlation and the significance level of 95%, which, I did r test and applied the example </span></font><h2 style="line-height:29.990400314331055px;font-size:21px;font-family:'Segoe UI Light','Segoe UI Web Light','Segoe UI Web Regular','Segoe UI','Segoe UI Symbol',HelveticaNeue-Light,'Helvetica Neue',Arial,sans-serif;font-weight:normal;padding-top:2px;color:rgb(68,68,68)">conOncon_4.ncl <span style="color:rgb(0,0,0);font-family:Calibri,sans-serif">of NCL, but I think there's something wrong with my script, because for all the data I use, plot area 100% the graph as significant, and I think there's something wrong, someone could help me on this?</span></h2><br><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">....</div><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br></div><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><div>; calculate cross correlations</div><div>;************************************************<span style="line-height:22.719999313354492px;font-size:12pt"> </span></div><div> ccr = escorc(ts2,ts1)</div><div> </div><div> copy_VarCoords(ts1,ccr)</div><div> </div><div>;*************************************************</div><div>; statistical significance of ccr</div><div>;*************************************************</div><div> </div><div> siglvl=0.05</div><div><br></div><div> Nx = num(.not.ismissing(ts1))</div><div><br></div><div> prob = rtest(ccr,Nx, 0) </div><div> </div><div> copy_VarCoords(ccr,prob)</div></div><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br></div><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">....</div><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br></div><div style="line-height:21.299999237060547px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><div> res2@cnLevelSelectionMode = "ManualLevels" </div><div> res2@cnMinLevelValF = 0.00 ; set min contour level</div><div> res2@cnMaxLevelValF = 1.05 ; set max contour level</div><div> res2@cnLevelSpacingF = 0.05 ; set contour spacing</div><div><br></div><div>plot2 = gsn_csm_contour(wks,gsn_add_cyclic_point(prob(:,:)), res2) </div><div><br></div><div> plot2 = ShadeLtContour(plot2,<font style="line-height:normal" color="#ac193d"> 0.06, 17</font>) ; shade all areas less than the 0.05 contour level</div><div> overlay (plot, plot2)</div><div><br></div></div><div><font face="Comic Sans MS"><span style="line-height:17px">---</span></font></div><span style="line-height:17px;background-color:rgb(255,255,255)"><font style="font-size:12pt" face="Comic Sans MS" size="3">Vanúcia Schumacher</font></span><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font face="Comic Sans MS">Mestranda em Meteorologia - UFV<font style="font-size:12pt" size="3"><br style="line-height:17px">Meteorologista -UFPel<br></font></font></span></div><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font face="Comic Sans MS"><font style="font-size:12pt" size="3">Departamento de Meteorologia Agrícola - DEA</font></font></span></div><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font style="font-size:12pt" face="Comic Sans MS" size="3">Cel: (31) 9978 2522 </font></span></div><div><span style="line-height:17px;background-color:rgb(255,255,255)"><font style="font-size:12pt" face="Comic Sans MS" size="3">DEA: (31) 3899 1890</font></span></div>                                            </div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div></div></div></div>                                            </div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>