Re: function ttest

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 20 2010 - 15:44:37 MDT

On 10/20/10 2:44 PM, Paula Doubrawa Moreira wrote:
> Hey all -
> *
> *
> *Question 1:*
>
> In the function /ttest/, how are the degrees of freedom calculated?
> Is it as in the unpaired t-test: (varX/sX + varY/sY)^2 / (
> (varX/sX)^2/sX-1 + (varY/sY)^2/sY-1 ) ?

===
http://www.ncl.ucar.edu/Document/Functions/Built-in/ttest.shtml

The *user* inputs the number of independent samples (s1, s2).
The degrees of freedom (df) are calculated as indicated below.

       if (iflag.eq.0) then
           df = s1+s2-2.
           varp = ((s1-1.)*var1+(s2-1.)*var2)/df
           tval = (ave1-ave2)/sqrt( varp*(1./s1 + 1./s2) )
       elseif (iflag.eq.1) then
           df = (var1/s1 + var2/s2)**2 /
      * ((var1/s1)**2/(s1-1.)+(var2/s2)**2/(s2-1.))
           tval = (ave1-ave2)/sqrt(var1/s1 + var2/s2)
       end if

The above is similar to what you see in "Numerical Recipies"

>
> *Question 2:*
>
> Can I get the output of /ttest/ and use as input for the function
> /student_t/ ?

I am not a statistician .... but, I think, "yes"

>
> Thank you!
>
> --
> *Paula Doubrawa Moreira*/
> /Graduate Student - Research Assistant
> International Arctic Research Center
> University of Alaska Fairbanks
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 20 15:44:42 2010

This archive was generated by hypermail 2.1.8 : Fri Oct 22 2010 - 12:21:46 MDT