<div dir="ltr"><div><div><div><div>Hi Noelia,<br></div>sX and sY should be the sample sizes, so I think you should change these lines:<br>sX   = dimsizes (ave_ua_ncep)   <br>sY = dimsizes(ave_ua_model)<br></div>to these lines:<br>sX   = dimsizes (ave_ua_ncep&amp;time)   <br>sY = dimsizes(ave_ua_model&amp;time)<br><br></div>Alternatively, you could use the equiv_sample_size function:<br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/equiv_sample_size.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/equiv_sample_size.shtml</a><br><br></div><div>If you have any further queries please respond only to the ncl-talk list.<br></div><div>Adam <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 19, 2014 at 1:11 PM, Noelia otero <span dir="ltr">&lt;<a href="mailto:noeli1680@gmail.com" target="_blank">noeli1680@gmail.com</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">Hi, <div><br></div><div>I am having problems with the ttest function, the error is:</div><div>







<p>fatal:ttest: If s1 is not a scalar, then it must have the same number of dimensions as ave1, var1, ave2, and var2</p><p>I don&#39;t understand very much this error, I would like to ask you what I am missing here.</p><p>This is a piece of the code:</p></div>        ua_ncep = u_ncep-&gt;uwnd(1:42,1,:,:) ;select 925 level<br>        ;Averages<br>        ave_ua_ncep=dim_avg(ua_ncep(lat|:,lon|:,time|:))<br>        ;Variances<br>        Var_ua_ncep = dim_variance (ua_ncep(lat|:,lon|:,time|:))         ; calculate variances<br>        ;Defining sizes<br>        sX   = dimsizes (ave_ua_ncep)   <br>        ;Model<br>        ua_model = uFiles[i]-&gt;ua(1:42,1,:,:)  ;plevel 1=925 plevel 9=200 <br>        ;Time averages<br>        ave_ua_model=dim_avg(ua_model(lat|:,lon|:,time|:))<br>        ;Variances<br>        Var_ua_model = dim_variance (ua_model(lat|:,lon|:,time|:))    ; calculate   var.<br>        sY=dimsizes(ave_ua_model)<br>        iflag=False<br>        ;Significance levels: <div>   prob = ttest(ave_ua_ncep,Var_ua_ncep^2,sX, ave_ua_model,Var_ua_model^2,sY, iflag, False) ;using STD <div><p>I also wanted to ask you, in this case, would it be necessary to use <font color="#000000"><span style="font-weight:bold;font-size:13px;font-family:verdana,sans-serif;line-height:16px"> </span><span style="font-size:13px;margin:0px;padding:0px;text-decoration:none;font-family:verdana,sans-serif;line-height:16px"><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave.shtml" style="font-size:13px;margin:0px;padding:0px;text-decoration:none;font-family:verdana,sans-serif;line-height:16px" target="_blank">wgt_areaave</a>?</span></font> </p><p>Many thanks in advance,</p><p><br></p><p>Cheers,</p><p><br></p><p>Noelia</p><p><br></p><p><br></p></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><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Division, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div>
</div>