pair t test for multiple variables

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

pair t test for multiple variables

MANMIT SHRIMALI
Hello Team:

I have 18 messages- rating scale (1-7). Data looks as follows:
begin data
ID M1 M2 M3 M4....M18
1   7    6   5    7         6

I need to do pair t-test of each message with rest of them i.e. M1 with M2 to M17 and then M2 to M1, M3 to M18 and so on. If I mannually write pairs it will be more than 600 combinations. Can you experts favour me by sharing a easier way out.

Thanks,
Manmit
Reply | Threaded
Open this post in threaded view
|

Re: pair t test for multiple variables

Marta García-Granero
Hi Manmit,

Although I strongly disagree with the use of multiple paired t tests
instead of a RM ANOVA (or, even, better, since your data are ordinal,
Friedman tests followed by a convenient post-hoc method), if you
*really* want multiple t tests, here you are:

T-TEST PAIRS = m1 TO m18.

This way it will run all the pairwise combinations.

MS> I have 18 messages- rating scale (1-7). Data looks as follows:
MS> begin data
MS> ID M1 M2 M3 M4....M18
MS> 1   7    6   5    7         6

MS> I need to do pair t-test of each message with rest of them
MS> i.e. M1 with M2 to M17 and then M2 to M1, M3 to M18 and so on. If
MS> I mannually write pairs it will be more than 600 combinations

Only 153, as a matter of fact.

I insist you use Friedman (plus a post-hoc), or RM ANOVA (plus a
convenient post-hoc).

Regards,
Dr. Marta García-Granero, PhD
Statistician.
Reply | Threaded
Open this post in threaded view
|

Re: pair t test for multiple variables

Marta García-Granero
In reply to this post by MANMIT SHRIMALI
Hi Manmit

I'd rather follow this exchange of messages here, if you don't mind...

MS> Thanks Marta for the solution. I had written long syntax and
MS> it did not work. Your syntax, short and sweet works perfectly
MS> alright.

One item I forgot to mention in my previous message is the problem of
hight type I error. You're running 153 t-tests, the chance that at
least one is significant by chance is really above 0.05 (i feel lazy
right now, that's why I'm not computing it, but I know it will be over
99%: 1-(0.95^153)). An overall test (like a RM ANOVA or Friedman) can
be useful to check if there at least one pair of variables that differ
signifficantly.

MS> Re: RM GLM, you raised very important point. As per my
MS> understanding, we need to classify the dependent variable and
MS> factors. In my given problem, I cannot classify any message as
MS> dependent. Usually, when I have data in column I use pair-t test
MS> and using indepdent t-test will not generate significance
MS> different. E.g. if the data is in the following manner:

MS> Begin data
MS> Id Drug1 Drug2 Drug3 Drug4
MS> 1   7     7      7     7

(message followed...)

Sorry, but I don't quite follow your reasoning. You can, and you
should use a RM ANOVA before attempting all those paired t-tests (if
it is not significant, then you needn't perform all those pairwise
comparisons):

* Simulated data (according to your layout) *.
INPUT PROGRAM.
- VECTOR m(18).
- LOOP #I = 1 TO 20.
- LOOP #J = 1 TO 18.
- COMPUTE m(#J) = 1+TRUNC(UNIFORM(7)).
- END LOOP.
- END CASE.
- END LOOP.
- END FILE.
END INPUT PROGRAM.
FORMAT m1 TO m18 (F4).
EXE.

GLM  m1 TO m18
  /WSFACTOR = m 18 Simple
  /EMMEANS = TABLES(m)
  /WSDESIGN = m .

Concerning the second point I mentioned: your data are not truly
quantitative, but ordinal. You could try Friedman test

NPAR TESTS
  /FRIEDMAN = m1 TO m18.

--
Regards,
Dr. Marta García-Granero,PhD           mailto:[hidden email]
Statistician





--- "It is unwise to use a statistical procedure whose use one does
not understand. SPSS syntax guide cannot supply this knowledge (nor
this list), and it is certainly no substitute for the basic
understanding of statistics and statistical thinking that is essential
for the wise choice of methods and the correct interpretation of their
results".

(Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind)
Reply | Threaded
Open this post in threaded view
|

Re: pair t test for multiple variables

Manmit Shrimali-2
In reply to this post by MANMIT SHRIMALI
Thanks Marta. I am sorry I posted on personal message. I am using the list serve for very first time so was not aware of whether to reply your email or listserv. Thanks again for make me informed.

Manmit
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Marta García-Granero
Sent: Wednesday, July 26, 2006 2:23 PM
To: [hidden email]
Subject: Re: pair t test for multiple variables

Hi Manmit

I'd rather follow this exchange of messages here, if you don't mind...

MS> Thanks Marta for the solution. I had written long syntax and
MS> it did not work. Your syntax, short and sweet works perfectly
MS> alright.

One item I forgot to mention in my previous message is the problem of
hight type I error. You're running 153 t-tests, the chance that at
least one is significant by chance is really above 0.05 (i feel lazy
right now, that's why I'm not computing it, but I know it will be over
99%: 1-(0.95^153)). An overall test (like a RM ANOVA or Friedman) can
be useful to check if there at least one pair of variables that differ
signifficantly.

MS> Re: RM GLM, you raised very important point. As per my
MS> understanding, we need to classify the dependent variable and
MS> factors. In my given problem, I cannot classify any message as
MS> dependent. Usually, when I have data in column I use pair-t test
MS> and using indepdent t-test will not generate significance
MS> different. E.g. if the data is in the following manner:

MS> Begin data
MS> Id Drug1 Drug2 Drug3 Drug4
MS> 1   7     7      7     7

(message followed...)

Sorry, but I don't quite follow your reasoning. You can, and you
should use a RM ANOVA before attempting all those paired t-tests (if
it is not significant, then you needn't perform all those pairwise
comparisons):

* Simulated data (according to your layout) *.
INPUT PROGRAM.
- VECTOR m(18).
- LOOP #I = 1 TO 20.
- LOOP #J = 1 TO 18.
- COMPUTE m(#J) = 1+TRUNC(UNIFORM(7)).
- END LOOP.
- END CASE.
- END LOOP.
- END FILE.
END INPUT PROGRAM.
FORMAT m1 TO m18 (F4).
EXE.

GLM  m1 TO m18
  /WSFACTOR = m 18 Simple
  /EMMEANS = TABLES(m)
  /WSDESIGN = m .

Concerning the second point I mentioned: your data are not truly
quantitative, but ordinal. You could try Friedman test

NPAR TESTS
  /FRIEDMAN = m1 TO m18.

--
Regards,
Dr. Marta García-Granero,PhD           mailto:[hidden email]
Statistician





--- "It is unwise to use a statistical procedure whose use one does
not understand. SPSS syntax guide cannot supply this knowledge (nor
this list), and it is certainly no substitute for the basic
understanding of statistics and statistical thinking that is essential
for the wise choice of methods and the correct interpretation of their
results".

(Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind)