--- Begin Message ---
Package: octave3.0-htmldoc
Version: 1:3.0.1-6lenny1
Severity: normal
Thanks for maintaining octave.
I just used it gain to a statistical insight.
However, it seems to me that the t_test_2()
function, or its documentation, has reversed the
meanings of ">" and "<" in its third argument,
named "alt".
file:///usr/share/doc/octave3.0-htmldoc/interpreter/Tests.html
says
"If alt is ">", the one-sided alternative mean
(x) > mean (y) is used."
But, it seems to me that "<" is used.
Here's how I tested it...
octave:1> x = [ 0, 1, 2 ]
x =
0 1 2
octave:2> y = [ 100, 102, 103 ]
y =
100 102 103
octave:3> t_test_2(x,y,">");
pval: 1
I expected the pval to be close to 0.
Thanks,
Kingsley
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.25-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
octave3.0-htmldoc depends on no packages.
octave3.0-htmldoc recommends no packages.
Versions of packages octave3.0-htmldoc suggests:
ii chimera2 [www-browse 2.0a19-5 Web browser for X
ii dillo [www-browser] 0.8.3-1 GTK-based web browser
ii elinks [www-browser] 0.4.2.99-1 Character mode WWW/FTP browser
ii emacs21 [www-browser 21.2-1 The GNU Emacs editor.
ii iceweasel [www-brows 3.0.5-1 lightweight web browser based on M
ii konqueror [www-brows 4:3.5.9.dfsg.1-2+b1 KDE's advanced file manager, web b
ii links [www-browser] 0.99-1 Character mode WWW browser
ii lynx [www-browser] 2.8.5-1 Text-mode WWW Browser
ii octave3.0 1:3.0.3-1 GNU Octave language for numerical
ii w3m [www-browser] 0.5.2-2+b1 WWW browsable pager with excellent
-- no debconf information
--- End Message ---
--- Begin Message ---
* Kingsley G. Morse Jr. <change@nas.com> [2009-01-04 23:18]:
> Package: octave3.0-htmldoc
> Version: 1:3.0.1-6lenny1
> Severity: normal
>
> Thanks for maintaining octave.
>
> I just used it gain to a statistical insight.
>
> However, it seems to me that the t_test_2()
> function, or its documentation, has reversed the
> meanings of ">" and "<" in its third argument,
> named "alt".
>
> file:///usr/share/doc/octave3.0-htmldoc/interpreter/Tests.html
> says
>
> "If alt is ">", the one-sided alternative mean
> (x) > mean (y) is used."
>
> But, it seems to me that "<" is used.
>
> Here's how I tested it...
>
> octave:1> x = [ 0, 1, 2 ]
> x =
>
> 0 1 2
>
> octave:2> y = [ 100, 102, 103 ]
> y =
>
> 100 102 103
>
> octave:3> t_test_2(x,y,">");
> pval: 1
>
> I expected the pval to be close to 0.
Thanks for your bug report but I think the doc string is correct. I am
hereby closing this bug report. However, feel free to reopen it if you have
strong and good arguments.
When you do t_test_2(x,y,">"), you are testing whether mean(x) is
significantly greater than mean(y), which means that your null hypothesis is
mean(x) <= mean (y). Only when mean(X) is clearly greater than mean(y), you
will get a p-value close to zero, meaning that you can reject the null
hypothesis and say "yes, mean(x) is greater than mean(y)".
As a matter of fact, the behavior of Octave's t_test_2 is identical as R's
t.test function:
$ R
> ?t.test
[snip]
Description:
Performs one and two sample t-tests on vectors of data.
Usage:
[snip]
## Default S3 method:
t.test(x, y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0, paired = FALSE, var.equal = FALSE,
conf.level = 0.95, ...)
[snip]
Arguments:
x: a (non-empty) numeric vector of data values.
y: an optional (non-empty) numeric vector of data values.
alternative: a character string specifying the alternative hypothesis,
must be one of '"two.sided"' (default), '"greater"' or
'"less"'. You can specify just the initial letter.
[snip]
Details:
The formula interface is only applicable for the 2-sample tests.
'alternative = "greater"' is the alternative that 'x' has a larger
mean than 'y'.
[snip]
> x <- c (0, 1, 2)
> y <- c (100, 102, 103)
> t.test(x,y,"greater")$p.value
[1] 0.9999997
--
Rafael
--- End Message ---