Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: tables with makematrix and estout

From   "Elizabeth Gifford, Ph.D." <>
To   "" <>
Subject   st: RE: tables with makematrix and estout
Date   Tue, 6 Dec 2011 21:07:33 +0000

I'm not sure from where the=A0's came but hopefully this will post correctly.  I apologize for the inconvenience.

Hi there
I was wondering if anyone know a tip for adding the chi-sq or ttests
to a table of means by group. I'm really close but currently have the
chi-sq and p-values appearing in every row after the mean of a given
group. (see below).

 This program uses two user written programs: estout (by Jann, Ben) and makematrix (by Nick Cox)

ssc install estout, replace

 ssc install makematrix


sysuse auto,clear
makematrix chi_p, from(r(chi2) r(p)) lhs( price mpg trunk weight) : tab foreign, chi2

estpost tabstat price mpg trunk weight, by(foreign) =statistics(mean sd) columns(statistics)
estadd matrix chi_p=3D chi_p

esttab , cells("mean =chi_p[1] (transpose) chi_p[2] (transpose)") unstack label compress
*I have a work around that involves taking the e(mean) matrix after
the tabstat command but I was hoping for a simpler solution.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index