Welch's t-test: Difference between revisions

m
Line 187:
)</lang>
 
<code>integrate</code> and <code>simpson</code> are from the [[Numerical_integration#J|Numerical integration]] task.
 
<code>lngamma</code> is from http://www.jsoftware.com/pipermail/programming/2015-July/042174.html -- for values less than some convenient threshold (we use 1, but we could use a modestly higher threshold), we calculate it directly. For larger values we compute the fractional part directly and rebuild the log of the factorial using the sum of the logs.
 
<code>mean</code> is classic J - most J tutorials will include this
 
The initial definition of <code>nu</code> (degrees of freedom of a data set), as well as the combining form (approximating degrees of freedom for two sets of data) is from [[wp:Welch%27s_t_test#Calculations|Welch's t test]]. (Verb definitions can be forward referenced, even in J's tacit definitions, but it seems clearer to specify these definitions so they only depend on previously declared definitions.)
 
<code>sampvar</code> is sample variance (or: standard deviation squared)
 
<code>ssem</code> is squared standard error of the mean
 
Data for task examples:
6,962

edits