1 Oct 2004 12:48

### [Rd] same test statistic for t-test with and without equal variance assumption

```Could some kindly tell me if I am supposed to be getting the same test
statistic value with var.equal=TRUE and var.equal=FALSE in t.test ?

set.seed(1066)
x1 <- rnorm(50)
x2 <- rnorm(50)

t.test(x1, x2, var.equal=FALSE)\$statistic # 0.5989774
t.test(x1, x2, var.equal=TRUE)\$statistic  # 0.5989774 ???

Here are my own calculations that shows that perhaps the result when
var.equal=TRUE is wrong.

n1 <- length(x1); n2 <- length(x2)
m1 <- mean(x1)  ; m2 <- mean(x2)  ; num   <- (m1 - m2)
v1 <- var(x1)   ; v2 <- var(x2)

# t-test with UNequal variance
denom1 <- sqrt( v1/n1 + v2/n2 )
num / denom1   # gives 0.5989774

# t-test with equal variance
sp <- ( (n1-1)*v1 + (n2-1)*v2 )/(n1 + n2 - 2)
denom2 <- sp * sqrt( 1/n1 + 1/n2 )
num / denom2   # gives 0.5913777

I tested this using R-1.9.1 (21/06/2004) on Redhat Fedora Core 2 and
Windows 2000 Professional with the same results.

Any suggestions would be kindly appreciated.
```

1 Oct 2004 13:15

### Re: [Rd] same test statistic for t-test with and without equal variance assumption

```Adaikalavan Ramasamy <ramasamy <at> cancer.org.uk> writes:

> Could some kindly tell me if I am supposed to be getting the same test
> statistic value with var.equal=TRUE and var.equal=FALSE in t.test ?
>
> set.seed(1066)
> x1 <- rnorm(50)
> x2 <- rnorm(50)
>
> t.test(x1, x2, var.equal=FALSE)\$statistic # 0.5989774
> t.test(x1, x2, var.equal=TRUE)\$statistic  # 0.5989774 ???
>
>
> Here are my own calculations that shows that perhaps the result when
> var.equal=TRUE is wrong.
>
> n1 <- length(x1); n2 <- length(x2)
> m1 <- mean(x1)  ; m2 <- mean(x2)  ; num   <- (m1 - m2)
> v1 <- var(x1)   ; v2 <- var(x2)
>
> # t-test with UNequal variance
> denom1 <- sqrt( v1/n1 + v2/n2 )
> num / denom1   # gives 0.5989774
>
> # t-test with equal variance
> sp <- ( (n1-1)*v1 + (n2-1)*v2 )/(n1 + n2 - 2)
> denom2 <- sp * sqrt( 1/n1 + 1/n2 )
> num / denom2   # gives 0.5913777
>
>
```

1 Oct 2004 14:42

### [Rd] bzip2 directory won't build on OSF1 due to C99 code and -std1 option (PR#7257)

```Full_Name: Michael Hoffman
Version: 2.0.0-beta-20041001
OS: OSF1 V5.1
Submission from: (NULL) (193.62.199.8)

Hello. Building R 2.0.0-beta-20041001 on OSF1 V5.1 failed because the default
configure sets R_XTRA_CFLAGS to "-std1 -ieee_with_inexact." The bzip2 directory
includes C99 code that requires -std1 to not be set in order to compile. This
halts the overall build process.

______________________________________________
R-devel <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

```
1 Oct 2004 14:56

### Re: [Rd] same test statistic for t-test with and without equal variance assumption

```Peter, thank you! I forgot the to square root in calculating sp.

sp <- sqrt( ( (n1-1)*v1 + (n2-1)*v2 )/(n1 + n2 - 2) )

For several simulation runs, the test statistics from both tests are
remarkably similar (difference is less than 10e-16). I naively assumed
that the statistics value should be slightly but visibly different too.

It appear that the effects of equal and unequal variance assumptions are
only felt through the degrees of freedom calculation.

On Fri, 2004-10-01 at 12:15, Peter Dalgaard wrote:
> Adaikalavan Ramasamy <ramasamy <at> cancer.org.uk> writes:
>
> > Could some kindly tell me if I am supposed to be getting the same test
> > statistic value with var.equal=TRUE and var.equal=FALSE in t.test ?
> >
> > set.seed(1066)
> > x1 <- rnorm(50)
> > x2 <- rnorm(50)
> >
> > t.test(x1, x2, var.equal=FALSE)\$statistic # 0.5989774
> > t.test(x1, x2, var.equal=TRUE)\$statistic  # 0.5989774 ???
> >
> >
> > Here are my own calculations that shows that perhaps the result when
> > var.equal=TRUE is wrong.
> >
```

1 Oct 2004 14:58

### (PR#7257) Re: [Rd] bzip2 directory won't build on OSF1 due to C99 code and -std1 option

```What `C99 code' is that?  It passes conformance tests on a very strict C89
compiler.  Please don't expect us to guess what you have in mind, for we
haven't a clue.

Please read the section on BUGS in the FAQ, and tell us the symptoms, not
your guess as to the diagnosis.

AFAIK, R's configure does not know about OSF1 v5.x, so it is quite likely
that the assumptions (which are inside

case "\${host_cpu}" in
alpha*)

) are wrong for that untested platform.  The code in the bzip2 directory
has not been changed for a very long time, except for possibly allowing
inlining (and for which there is a configure test).

Note that feedback 3 days before release is too late for configuration

On Fri, 1 Oct 2004 hoffman+R <at> ebi.ac.uk wrote:

> Full_Name: Michael Hoffman
> Version: 2.0.0-beta-20041001
> OS: OSF1 V5.1
> Submission from: (NULL) (193.62.199.8)
>
>
> Hello. Building R 2.0.0-beta-20041001 on OSF1 V5.1 failed because the default
> configure sets R_XTRA_CFLAGS to "-std1 -ieee_with_inexact." The bzip2 directory
```

1 Oct 2004 15:17

### Re: [Rd] same test statistic for t-test with and without equal variance assumption

```Apologies, I made an incorrect statement. The statistics from t-test
with difference variance assumptions are the same if both groups have
the same length. Sorry for troubling everyone again.

On Fri, 2004-10-01 at 13:56, Adaikalavan Ramasamy wrote:
> Peter, thank you! I forgot the to square root in calculating sp.
>
> sp <- sqrt( ( (n1-1)*v1 + (n2-1)*v2 )/(n1 + n2 - 2) )
>
> For several simulation runs, the test statistics from both tests are
> remarkably similar (difference is less than 10e-16). I naively assumed
> that the statistics value should be slightly but visibly different too.
>
> It appear that the effects of equal and unequal variance assumptions are
> only felt through the degrees of freedom calculation.
>
>
>
> On Fri, 2004-10-01 at 12:15, Peter Dalgaard wrote:
> > Adaikalavan Ramasamy <ramasamy <at> cancer.org.uk> writes:
> >
> > > Could some kindly tell me if I am supposed to be getting the same test
> > > statistic value with var.equal=TRUE and var.equal=FALSE in t.test ?
> > >
> > > set.seed(1066)
> > > x1 <- rnorm(50)
> > > x2 <- rnorm(50)
> > >
> > > t.test(x1, x2, var.equal=FALSE)\$statistic # 0.5989774
```

1 Oct 2004 15:24

### Re: (PR#7257) Re: [Rd] bzip2 directory won't build on OSF1 due to C99 code and -std1 option

```On Fri, 1 Oct 2004, Prof Brian Ripley wrote:

> What `C99 code' is that?

Specifically it uses the inline keyword. I do not believe that is
supported by a strict C89 compiler.

> Please don't expect us to guess what you have in mind, for we
> haven't a clue.

make things easier to understand:

mh5 <at> ecs4d /ecs4/scratch2/ensembl/mh5/sandbox/R-2.0.0/src/extra/bzip2
\$ make
making blocksort.d from blocksort.c
making bzlib.d from bzlib.c
making compress.d from compress.c
making crctable.d from crctable.c
making decompress.d from decompress.c
making huffman.d from huffman.c
making randtable.d from randtable.c
gmake[1]: Entering directory `/ecs4/scratch2/ensembl/mh5/sandbox/R-2.0.0/src/extra/bzip2'
gmake[1]: `Makedeps' is up to date.
gmake[1]: Leaving directory `/ecs4/scratch2/ensembl/mh5/sandbox/R-2.0.0/src/extra/bzip2'
gmake[1]: Entering directory `/ecs4/scratch2/ensembl/mh5/sandbox/R-2.0.0/src/extra/bzip2'
cc -I. -I. -I../../../src/include -I../../../src/include -I/usr/local/include -DHAVE_CONFIG_H
-std1 -ieee_with_inexact  -fast -arch ev6 -c blocksort.c -o blocksort.o
cc: Error: blocksort.c, line 79: Missing ";". (nosemi)
void fallbackSimpleSort ( UInt32* fmap,
```

1 Oct 2004 15:32

### Re: (PR#7257) Re: [Rd] bzip2 directory won't build on OSF1 due to C99 code and -std1 option

```I believe this occurs because the configure test for `inline' is not using
the R_XTRA_CFLAGS, which is a pervasive design problem (we have noted it
occurs with PIC flags as well).  If you set -std1 in CFLAGS then it should
be used in the configure test which should conclude `inline' is not
allowed.

[I use CFLAGS for making my test compilers as picky as possible.]

On Fri, 1 Oct 2004, Michael Hoffman wrote:

> On Fri, 1 Oct 2004, Prof Brian Ripley wrote:
>
> > What `C99 code' is that?
>
> Specifically it uses the inline keyword. I do not believe that is
> supported by a strict C89 compiler.
>
> > Please don't expect us to guess what you have in mind, for we
> > haven't a clue.
>
> Please accept my apologies for an inadequate bug report. This might
> make things easier to understand:
>
> mh5 <at> ecs4d /ecs4/scratch2/ensembl/mh5/sandbox/R-2.0.0/src/extra/bzip2
> \$ make
> making blocksort.d from blocksort.c
> making bzlib.d from bzlib.c
> making compress.d from compress.c
> making crctable.d from crctable.c
> making decompress.d from decompress.c
```

1 Oct 2004 15:49

### Re: (PR#7257) Re: [Rd] bzip2 directory won't build on OSF1 due to C99 code and -std1 option

```> If you set -std1 in CFLAGS then it should be used in the configure
> test which should conclude `inline' is not allowed.

OK, I will do as you suggest. I should note that cc (version info
below) does support inline although not with -std1 so I'd prefer to
have any performance benefits of inline, if possible.
--

--
Michael Hoffman <hoffman <at> ebi.ac.uk>
European Bioinformatics Institute

Compaq C V6.5-011 on Compaq Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V6.5-003 (sys) cc Driver

______________________________________________
R-devel <at> stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

```
1 Oct 2004 15:55

### Re: [Rd] (PR#7254)Documentation: Reference Index (.pdf) -- setOldClass

```Have you looked at the 2.0.0 beta version?

It is hard for us to know what you are looking at, but I believe this was
fixed a while ago (but post 1.9.1).  Better PDF cross-refs is one of the
changes in 2.0.0-to-be.

On Thu, 30 Sep 2004, Pfaff, Bernhard wrote:

> Apologies for cross postings or manual work caused by resending; the
> intially sent bug report through the web-interface bounced, however.
>
>
> Full_Name: Bernhard Pfaff
> Version: 1.9.1
> OS: Windows NT
> Submission from: (NULL) (193.194.7.77)
>
>
> Dear core team members / maintainers,
>
> in the pdf version of the reference index I observed two entries of