<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="font-family:bookman old style, new york, times, serif;font-size:16px;"><div>Hi,</div><div>I've used "escorc" to compute Pearson correlation coefficient for my data, from this link: <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/escorc.shtml" rel="nofollow" target="_blank" class="enhancr_card_1469998574">escorc</a>.</div><div><br></div><div id="ydp29ec9433enhancr_card_1469998574" class="ydp29ec9433yahoo-link-enhancr-card ydp29ec9433yahoo-link-enhancr-not-allow-cover ydp29ec9433ymail-preserve-class ydp29ec9433ymail-preserve-style" style="max-width:400px;font-family:"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif" data-url="https://www.ncl.ucar.edu/Document/Functions/Built-in/escorc.shtml" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/escorc.shtml" style="text-decoration:none !important;color:#000 !important" class="ydp29ec9433yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table border="0" class="ydp29ec9433card-wrapper ydp29ec9433yahoo-ignore-table" cellpadding="0" cellspacing="0" style="max-width:400px"><tbody><tr><td width="400"><table border="0" class="ydp29ec9433card ydp29ec9433yahoo-ignore-table" cellpadding="0" cellspacing="0" width="100%" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px"><tbody><tr><td><table border="0" class="ydp29ec9433card-info ydp29ec9433yahoo-ignore-table" cellpadding="0" cellspacing="0" style="background:#fff;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0 0 2px 2px;border-top:1px solid rgb(224, 228, 233)"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:"Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;border-radius:0 0 2px 0"><h2 class="ydp29ec9433card-title" style="font-size: 14px; line-height: 19px; margin: 0px 0px 6px; font-family: "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif; color: rgb(38, 40, 42);">escorc</h2><p class="ydp29ec9433card-description" style="font-size: 12px; line-height: 16px; margin: 0px; color: rgb(151, 155, 167);">NCL built-in functions (statistics)</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><div><br></div><div>However I want to do some manipulate for input arrays, and I want best function to do that. For example in Example 1 at above link:</div><div><span><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13.3333px; line-height: 12pt; font-family: courier; border-style: solid; border-width: 0px 0px 15px; border-color: transparent; color: rgb(0, 0, 0);"> <span><div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13.3333px; line-height: 12pt; font-family: courier; border-style: solid; border-width: 0px 0px 15px; border-color: transparent; color: rgb(0, 0, 0);">        x    = (/ 0.20, 1.88, -0.76, 0.42, 0.32, -0.56, 1.55, -1.21, -0.66, -0.96, -0.21 /)
        y    = (/ 0.18, 0.54, -0.49, 0.92, 0.22,  0.75, 0.66, -2.65, -0.51,  0.47, -0.09 /)
        r    = <strong style="margin: 0px; padding: 0px;">escorc</strong>(x,y)                ; Pearson correlation
</pre><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13.3333px; line-height: 12pt; font-family: courier; border-style: solid; border-width: 0px 0px 15px; border-color: transparent; color: rgb(0, 0, 0);"><span><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13.3333px; line-height: 12pt; font-family: courier; border-style: solid; border-width: 0px 0px 15px; border-color: transparent; color: rgb(0, 0, 0);">    ;---Compute correlation confidence interval

        n    = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dimsizes.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">dimsizes</strong></a>(x)                ; n=11
        df   = n-2
                                          ; Fischer z-transformation
        z    = 0.5*<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/log.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">log</strong></a>((1+<b style="margin: 0px; padding: 0px;">r</b>)/(1-<b style="margin: 0px; padding: 0px;">r</b>))  ; z-statistic
        se   = 1.0/<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/sqrt.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">sqrt</strong></a>(n-3)                       ; standard error of z-statistic

                                          ; low  and hi <b style="margin: 0px; padding: 0px;">z</b> values
        zlow = z - 1.96*se                ; 95%  (2.58 for 99%)
        zhi  = z + 1.96*se                 
                                          ; inverse z-transform; return to <b style="margin: 0px; padding: 0px;">r</b> space (-1 to +1)
        rlow = (<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/exp.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">exp</strong></a>(2*zlow)-1)/(<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/exp.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">exp</strong></a>(2*zlow)+1)
        rhi  = (<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/exp.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">exp</strong></a>(2*zhi )-1)/(<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/exp.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">exp</strong></a>(2*zhi )+1)</pre></span><span><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 13.3333px; line-height: 12pt; font-family: courier; border-style: solid; border-width: 0px 0px 15px; border-color: transparent; color: rgb(0, 0, 0);">        t    = <b style="margin: 0px; padding: 0px;">r</b>*<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/sqrt.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">sqrt</strong></a>((n-2)/(1-<b style="margin: 0px; padding: 0px;">r</b>^2))      
        p    = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/student_t.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">student_t</strong></a>(t, df)
        psig = 0.05                       ; test significance level                     
        <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">print</strong></a>("t="+t+"  p="+p)            ; t=2.02755  p=0.0732238
        if (p.le.psig) then
            <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">print</strong></a>("<b style="margin: 0px; padding: 0px;">r</b>="+r+" is significant at the 95% level"))
        else
            <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml" style="margin: 0px; padding: 0px; color: rgb(133, 45, 133); font-family: verdana, sans-serif;" rel="nofollow" target="_blank"><strong style="margin: 0px; padding: 0px;">print</strong></a>("<b style="margin: 0px; padding: 0px;">r</b>="+r+" is NOT significant at the 95% level"))
        end if</pre></span><br></pre></div><div><br></div></span></pre></span>For example how could I compute "r,n, ..." where(x.gt.5).</div><div><br></div><div>I'll be thankful for any help.</div><div><br></div><div>Sincerely</div><div>Ehsan</div><div><br></div><div style="font-family:bookman old style, new york, times, serif;font-size:16px;"></div></div></body></html>