<div dir="ltr"><div><div><div>The question is not clear to me.<br><br></div>  x = (/..../)<br></div>  y = (/..../)<br><br></div>  i5 = ind(x.gt.5)<br>  <span style="font-family:arial,helvetica,sans-serif"><font size="2"><span><pre style="margin-top:0px;margin-bottom:0px;padding:0px;line-height:12pt;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;line-height:12pt;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)"> r5 = <strong style="margin:0px;padding:0px">escorc</strong>(x(i5),y(i5))                ; Pearson correlation<br> n5 = <b>num</b>(x.gt.5)<br></pre></span></pre></span></font></span><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 11, 2018 at 5:48 AM, Ehsan Taghizadeh <span dir="ltr"><<a href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.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 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" class="m_-4645474966867788724enhancr_card_1469998574" target="_blank">escorc</a>.</div><div><br></div><div id="m_-4645474966867788724ydp29ec9433enhancr_card_1469998574" class="m_-4645474966867788724ydp29ec9433yahoo-link-enhancr-card m_-4645474966867788724ydp29ec9433yahoo-link-enhancr-not-allow-cover m_-4645474966867788724ydp29ec9433ymail-preserve-class m_-4645474966867788724ydp29ec9433ymail-preserve-style" style="max-width:400px;font-family:"Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif"><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/escorc.shtml" style="text-decoration:none!important;color:#000!important" class="m_-4645474966867788724ydp29ec9433yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="m_-4645474966867788724ydp29ec9433card-wrapper m_-4645474966867788724ydp29ec9433yahoo-ignore-table" style="max-width:400px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="400"><table class="m_-4645474966867788724ydp29ec9433card m_-4645474966867788724ydp29ec9433yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224,228,233);border-radius:2px" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td><table class="m_-4645474966867788724ydp29ec9433card-info m_-4645474966867788724ydp29ec9433yahoo-ignore-table" style="background:#fff;width:100%;max-width:400px;border-radius:0 0 2px 2px;border-top:1px solid rgb(224,228,233)" cellspacing="0" cellpadding="0" border="0"><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="m_-4645474966867788724ydp29ec9433card-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="m_-4645474966867788724ydp29ec9433card-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)+<wbr>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><span class="HOEnZb"><font color="#888888"><div>Ehsan</div><div><br></div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"></div></font></span></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>