Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: ttest for multiple groups

From   jean ries <[email protected]>
To   [email protected]
Subject   Re: st: ttest for multiple groups
Date   Wed, 27 Oct 2004 11:45:41 +0200

I think that you have mixed up two different syntaxes of -ttest-. In your case you should rather do
. bysort nations: ttest PolA == PolB

When you type:
. ttest PolA, by(nation)
where nation is a binary variable, you will test whether the attitude towards policy A is different in two countries


Michael Cha wrote:

Dear listers,
Could you help me with this problem?
I have a data on police from 500 people from 10 different nations.
Now, I need to do paired t-test for variables PolA and PolB, each of which is about attitude toward police A and Police B.
But, I need to do the paired t-test for each countries to test the significance of the test results.
What I did in SPSS is as follows,
TABLES=PolA PolB BY Nations

where PolA and PolB are the variables to compare and nations are 10 countries.
The output gives me a 10 by 2 tables as follows.
PolA PolB Significance
cnt1 3.4 4.3 ?
cnt2 3.5 3.6 ?

cnt10. ?

However, this does not give the significant test results for each country, which is necessary for me.
Could anyone of you tell me what I should do to test the statistical significance
Of course, I can do the test by repeating the paired ttest after selecting each country over and over.
However, it is very tedious and uneasy way of doing analysis.
So, would you please let me know how I can easily do it?
In stata, I tried it as follows in vain,
ttest polA==polB, by <Nations>

So, please let me know how I can make it easily.
In either way, SPSS or STATA, it is OK with me.
Thank you very much for your help in advance.


*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index