|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: tabstat question
Dear all,
Is anyone aware of a -tabstat- like command (or an option to -tabstat-) which allows for plotting "by groups" on the horizontal rather than the vertical?
Here is a simple illustration of what I am looking for:
. sysuse auto, clear
(1978 Automobile Data)
. tabstat price mpg, statistics(count mean sd skewness kurtosis) by(foreign) columns(variables) format(%9.3f) longstub varwidth(16) labelwidth(32) save nosep
foreign stats | price mpg
------------------+--------------------
Domestic N | 52.000 52.000
mean | 6072.423 19.827
sd | 3097.104 4.743
skewness | 1.778 0.771
kurtosis | 5.090 3.441
Foreign N | 22.000 22.000
mean | 6384.682 24.773
sd | 2621.915 6.611
skewness | 1.215 0.657
kurtosis | 3.555 3.107
------------------+--------------------
Total N | 74.000 74.000
mean | 6165.257 21.297
sd | 2949.496 5.786
skewness | 1.653 0.949
kurtosis | 4.819 3.975
---------------------------------------
However, I would much prefer the following layout to the table created by -tabstat- before:
foreign | Domestic | Foreign | Total -------------------------------+---------------------+--------------------
stats | price mpg | price mpg | price mpg ---------+---------------------+---------------------+--------------------
N | 52.000 52.000 | 22.000 22.000 | 74.000 74.000
mean | 6072.423 19.827 | 6384.682 24.773 | 6165.257 21.297
sd | 3097.104 4.743 | 2621.915 6.611 | 2949.496 5.786
skewness | 1.778 0.771 | 1.215 0.657 | 1.653 0.949
kurtosis | 5.090 3.441 | 3.555 3.107 | 4.819 3.975
--------------------------------------------------------------------------
Any help is greatly appreciated.
Best regards,
Daniel
Any information in this communication is confidential and may be privileged or otherwise protected from disclosure without our consent. If you are not the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. You are requested to please telephone or email the sender and delete this message and any attachment from your system.
Due to the electronic nature of e-mail, there is a risk that the information contained in this message has been modified. Consequently we can accept no responsibility or liability as to the completeness or accuracy of the information.
A-03-03-E
*
* 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/