Subscribe Bookmark RSS Feed

Forcing Unequal Variance T-test in Scripts

sornasst

Community Trekker

Joined:

Feb 2, 2016

The following script performs multiple t-tests on multiple Y columns using the Oneway platform.

As called in this script, the t-test assumes equal variance but I would like to force this script to perform this t-test assuming unequal variance.

Could you help figure out how to do that?

dt = Open ("File");

m = [];

For(i=8,i<=N Col (dt),i++,

  ow = Oneway( Y( Column( i ) ), X( :Disease ), t Test( 1 ), invisible );

  owr = Report (ow);

  m = m || owr["t Test"][Number Col Box( 4 )][1];

);

New Table( "t-tests", New Column( "p", numeric, set values( m ) ) );

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

It appear there is some confusion caused because the outline box for both the equal and unequal version of the ttest is called t-Test.  However, if you change the direct reference from

m = m || owr["t Test"][Number Col Box( 4 )][1];

to

m = m || owr[Outline Box(1)][Number Col Box( 4 )][1];

you will get your correct output

Jim
2 REPLIES
Solution

It appear there is some confusion caused because the outline box for both the equal and unequal version of the ttest is called t-Test.  However, if you change the direct reference from

m = m || owr["t Test"][Number Col Box( 4 )][1];

to

m = m || owr[Outline Box(1)][Number Col Box( 4 )][1];

you will get your correct output

Jim
sornasst

Community Trekker

Joined:

Feb 2, 2016

Hi Jim,

Thank you for your answer. It works perfectly.

Best regards,

Thierry