# [ncl-talk] correlation and the significance

Dennis Shea shea at ucar.edu
Mon Oct 6 13:55:27 MDT 2014

```The question is difficult to answer.
You have not included information which ncl-talk constantly request of
users.

[0] Always include the version of NCL you are using.

Always look at your data and the results of assorted calculations via
printVarSummary and print

[1] printVarSummary(ts1)                   ; ?? (time) => [ntim] ??  or
(time,lat,lon)  ==>   [ntim,nlat,mlon]  ??
printVarSummary(ts2)

[2] ccr    =   escorc(ts2,ts1)
printVarSummary(ccr)

[3] Nx    = num(.not.ismissing(ts1))
print(Nx)                                          ; if ts1 is
one-dimensional
printVarSummary(Nx)                     ; if ts1 & ts2 are
three-dimensional

This give you the **total** number of non-missing points.
If the ts1 and ts2 arrays are three-dimensional, you would likely see
a VERY LARGE number
Very large numbers result in everything being significant.

[4] If ts1 and ts2 are (time,lat,lon)  and you have NCL versions 6.1.1 or
earlier, then you should reorder the arrays so time is the
rightmost dimensions . See escorc Example 5.

If you have NCL v6.2.1 and 3D arrays, you can use  ccr    =
escorc_n(ts2,ts1,0)

====
Respond *only* to ncl-talk. Please, no personal salutation.

On Mon, Oct 6, 2014 at 11:09 AM, Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:

> I need to plot correlation and the significance level of 95%, which, I did
> r test and applied the example  conOncon_4.ncl‏ 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?
> ....
>
> ; calculate cross correlations
> ;************************************************
>   ccr    =   escorc(ts2,ts1)
>
>   copy_VarCoords(ts1,ccr)
>
> ;*************************************************
> ;  statistical significance of ccr
> ;*************************************************
>
>   siglvl=0.05
>
>   Nx    = num(.not.ismissing(ts1))
>
>   prob  = rtest(ccr,Nx, 0)
>
>   copy_VarCoords(ccr,prob)
>
> ....
>
>  res2 at cnLevelSelectionMode = "ManualLevels"
>  res2 at cnMinLevelValF      = 0.00        ; set min contour level
>  res2 at cnMaxLevelValF      = 1.05        ; set max contour level
>   res2 at cnLevelSpacingF     = 0.05        ; set contour spacing
>
>
>   plot2   = ShadeLtContour(plot2, 0.06, 17)  ; shade all areas less than
> the  0.05 contour level
>   overlay (plot, plot2)
>
> ---
> Vanúcia Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agrícola - DEA
> Cel: (31) 9978 2522
> DEA: (31) 3899 1890
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141006/a5501a34/attachment.html
```