<div dir="ltr"><div><div>[1]<br>Sorry, bad wording: not &#39;wrong&#39;. I did not look at the code carefully enough<br><br>[2]<br>Bootstrapping is  an alternative to using some classic parametric model as a base reference.<br></div>It only uses the data at hand. It does not depend on any base distrbution. The methof creates the distribution.<br>   <a href="http://www.ncl.ucar.edu/Applications/bootstrap.shtml">http://www.ncl.ucar.edu/Applications/bootstrap.shtml</a><br></div>Once the &#39;nBoot&#39; samples are generated, they are sorted into ascending order. <br><br><pre>   ia = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml"><strong>dim_pqsort_n</strong></a>(xBoot, 2, 0)        ; sort bootstrap means into ascending order
   
   n025     = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml"><strong>round</strong></a>(0.025*(nBoot-1),3)    ; indices for sorted array
   n500     = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml"><strong>round</strong></a>(0.500*(nBoot-1),3)                             
   n975     = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml"><strong>round</strong></a>(0.975*(nBoot-1),3)
   
   xBoot_025= xBoot(n025)                 ;  2.5% level<br>   xBoot_500= xBoot(n500)                 ; 50.0% level  (median)
   xBoot_975= xBoot(n975)                 ; 97.5% level
</pre>These are the significance levels given the distribution. If your original sample exceeds the (say) &#39;<br><pre>xBoot_975&#39; value it is significant at the 95.5% level. <br><br></pre><pre>You could calculate xBoot_950 for the 95% level. <br><br>===<br><br></pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 14, 2016 at 9:13 PM, Anahita Amiri Farahani <span dir="ltr">&lt;<a href="mailto:aamir003@ucr.edu" target="_blank">aamir003@ucr.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Why this one is wrong to calculate the significance level when there is only one partial derivative? and if this is wrong how can I calculate that it is significant or not?<div><br></div><div>And based on this:</div><div><span class=""><pre style="white-space:pre-wrap">   nBoot =   10000                           
   xBoot = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/new.shtml" target="_blank"><strong>new</strong></a> (nBoot, typeof(F))
   
   do ns=0,nBoot-1                        ; generate multiple estimates
      iw = <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml" target="_blank"><strong>generate_sample_indices</strong></a>(N,<b><font color="red">1</font></b>))  ; indices with replacement
      xBoot(ns) = (dF(iw)/dN(iw))*(dN(iw)/dA(iw)<wbr>)
   end do</pre><pre style="white-space:pre-wrap"><br></pre></span><pre style="white-space:pre-wrap">How can I say if it is significant?</pre><pre style="white-space:pre-wrap"><br></pre><pre style="white-space:pre-wrap">Thanks,</pre><pre style="white-space:pre-wrap">Ana</pre></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 14, 2016 at 7:58 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>[1]<br><a href="http://www.ncl.ucar.edu/Applications/bootstrap.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/bootstrap.shtml</a><br><a href="http://www.ncl.ucar.edu/Document/Functions/Bootstrap/bootstrap_regcoef.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Bootstrap/bootstr<wbr>ap_regcoef.shtml</a><br>Look at examples <br>bootstrap_regcoef_1.ncl<br>bootstrap_regcoef_2.ncl<br>bootstrap_regcoef_3.ncl<br><br>[2]<br></div><div>You don&#39;t need the following but it was wrong. FTR:<br></div><div><span><br>do k=0,2999<div>    ab  = regCoef(AI_fall(:,k),Nd_fall(:<wbr>,k))</div></span><div>    df   = ab@nptxy-2</div><div>    tval = ab@tval</div><div> </div><div>    df     = where(<a href="http://df.lt" target="_blank">df.lt</a>.1,1, df)<br></div><div>    prob = 1 - betainc(df/(df+tval^2), df/2.0, 0.5) <br></div><div>    sig_fall(k) = where(prob.lt.0.95, -999, prob) <br></div><div>end do</div></div></div><div class="m_-1061542746964828069HOEnZb"><div class="m_-1061542746964828069h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 14, 2016 at 7:02 PM, Anahita Amiri Farahani <span dir="ltr">&lt;<a href="mailto:aamir003@ucr.edu" target="_blank">aamir003@ucr.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks a lot, your answer was really helpful and I have another question: <div><br></div><div>Before I use regCoef function in NCL to calculate linear regression. Using this function gives other variables such as rcraw_npt, and  rcraw_tval, so I was able to calculate significance at 95%, 90% and 99% confidence level. I&#39;ve put that part of the code here:</div><div><br></div><div><div>do k=0,2999</div><div>    </div><div>   ab = regCoef(AI_fall(:,k),Nd_fall(:<wbr>,k))</div><div>    rcraw_npt=ab@nptxy-2</div><div>    rcraw_tval=ab@tval</div><div>    b    = rcraw_tval</div><div>    b    = 0.5</div><div>    rcraw_npt=where(<a href="http://rcraw_npt.lt" target="_blank">rcraw_npt.lt</a>.1<wbr>,1,rcraw_npt)</div><div>    rcraw_prob = (1 - betainc(rcraw_npt/(rcraw_npt+r<wbr>craw_tval^2),rcraw_npt/2.0,b) )</div><div>    sig_fall(k)=where(rcraw_prob.l<wbr>t.0.95,-999,rcraw_prob)</div><div>   </div><div>end do</div><div><br></div><div><br></div><div>How can I calculate the significance at different confidence level here by using xBoot?</div><div><br></div><div>Best,</div><div>Ana </div><div><br></div><div><br></div><div><br></div></div></div><div class="m_-1061542746964828069m_-310127440803156121HOEnZb"><div class="m_-1061542746964828069m_-310127440803156121h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 14, 2016 at 2:45 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I think you will have to decide what is best.<br><br></div>[a]<br></div>Constrain the F,N,A triplets to be &#39;coupled&#39;<br><br><pre>   nBoot =   10000                           
   xBoot = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/new.shtml" target="_blank"><strong>new</strong></a> (nBoot, typeof(F))
   
   do ns=0,nBoot-1                        ; generate multiple estimates
      iw = <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml" target="_blank"><strong>generate_sample_indices</strong></a>(N,<b><font color="red">1</font></b>))  ; indices with replacement
      xBoot(ns) = (dF(iw)/dN(iw))*(dN(iw)/dA(iw)<wbr>)
   end do<br><br></pre><pre>[b]<br></pre><pre>Unconstrained<br><br> <br>   nBoot =   10000                           
   xBoot = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/new.shtml" target="_blank"><strong>new</strong></a> (nBoot, typeof(F))
   
   do ns=0,nBoot-1                        ; generate multiple estimates
      iwF = <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml" target="_blank"><strong>generate_sample_indices</strong></a>(N,<b><font color="red">1</font></b>)) ; indices with replacement<br>      iwN = <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml" target="_blank"><strong>generate_sample_indices</strong></a>(N,<b><font color="red">1</font></b>)) <br>      iwA = <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/generate_sample_indices.shtml" target="_blank"><strong>generate_sample_indices</strong></a>(N,<b><font color="red">1</font></b>)) </pre><pre>      xBoot(ns) = (dF(iwF)/dN(iwN))*(dN(iwN)/dA(<wbr>iwA))
   end do<br></pre>[c]<br></div>See where your product fits.<br><br><pre>   ia = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml" target="_blank"><strong>dim_pqsort_n</strong></a>(xBoot, 2, 0)        ; sort bootstrap means into ascending order
   
   n025     = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml" target="_blank"><strong>round</strong></a>(0.025*(nBoot-1),3)    ; indices for sorted array
   n500     = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml" target="_blank"><strong>round</strong></a>(0.500*(nBoot-1),3)                             
   n975     = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/round.shtml" target="_blank"><strong>round</strong></a>(0.975*(nBoot-1),3)
   
   xBoot_025= xBoot(n025)                 ;  2.5% level
   xBoot_500= xBoot(n500)                 ; 50.0% level  (median)
   xBoot_975= xBoot(n975)                 ; 97.5% level
</pre><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-1061542746964828069m_-310127440803156121m_-2908032234189974642h5">On Wed, Dec 14, 2016 at 3:12 PM, Anahita Amiri Farahani <span dir="ltr">&lt;<a href="mailto:aamir003@ucr.edu" target="_blank">aamir003@ucr.edu</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-1061542746964828069m_-310127440803156121m_-2908032234189974642h5"><div dir="ltr">Dear all,<div><br></div><div>I have a product of two partial derivatives : dF/dN*dN/dA and for each of the variables (F, N, and A) I have data for 720 times. Each partial derivatives are calculated  by linear regression. I was wondering how I can calculate the significant test for this product. All examples in NCL to estimate linear regression by this function: <strong style="margin:0px;padding:0px;text-decoration:none;font-family:verdana,sans-serif;font-size:13.3333px"><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/regline_stats.shtml" style="color:rgb(133,45,133);margin:0px;padding:0px;text-decoration:none;font-family:verdana,sans-serif;font-size:13.3333px" target="_blank">regline_stats</a><font color="#000000"><span style="background-color:rgb(255,231,198)"> </span></font></strong>  give the regression coefficient for two variables.</div><div><br></div><div>Thanks,</div><div>Ana <br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>