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

st: matrix with averages and p-values


From   <[email protected]>
To   [email protected]
Subject   st: matrix with averages and p-values
Date   Thu, 2 Oct 2003 06:51:53 -0700 (PDT)

I have a data set that looks like the following:

       State      Price
1.     AL         40
2.     AL         50
3.     AL         40
4.     AZ         20
5.     AZ         20
6.     AZ         30
7.     AZ         40
8.     CA         20
9.     CA         50
10.    CA         20
11.    CA         40
12.    CA         50

I would like to get a table with averages (on the
diagonal), and p-value for the test that two averages
are equal (off-diagonal):


       AL         AZ         CA

AL     avg(AL)    p(AL=AZ)   p(AL=CA)

AZ       ---      avg(AZ)    p(AZ=CA)

CA                           avg(CA)    


Since I have 50 states and I have to repeat the same
analysis for different variables and different data
sets, I was wondering whether there is an easy way for
doing this.

Thank you,

Raffaella Baldi



__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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