[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: dumb cross-tab question

From   "E. Paul Wileyto" <>
Subject   Re: st: RE: dumb cross-tab question
Date   Thu, 29 Nov 2007 08:01:45 -0500

Thanks. I have similar coding that would do it, but as you show below, it is not general.... By "quick," I meant the usual Stata one-line command.


Nick Cox wrote:

Depends what you mean by "quick".
I don't think that this is canned. But it can be done directly.
sysuse auto
egen group = group(for rep78)
gen ub = .
gen lb = .
gen mean = .
gen se = .
qui forval i = 1/8 {
ci mpg if group == `i'
replace ub = r(ub) if group == `i'
replace lb = r(lb) if group == `i'
replace mean = r(mean) if group == `i'
replace se = r(se) if group == `i'
tabdisp foreign rep78 if group < . , cell(mean se lb ub) format(%2.1f)

E. Paul Wileyto

Is there a quick way to get Stata to format a two-way table showing
means, SEs, and CIs for a third variable?

tabulate summarize doesn't seem to do SEs and CIs

tabstat gets angry if I try to give it two by variables.

* For searches and help try:

E. Paul Wileyto, Ph.D.
Assistant Professor of Biostatistics
Tobacco Use Research Center
School of Medicine, U. of Pennsylvania
3535 Market Street, Suite 4100
Philadelphia, PA 19104-3309

Fax: 215-746-7140
* For searches and help try:

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