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

Re: st: RE: Summarising multiple tabulations in one table

From   "Stephen P. Jenkins" <>
Subject   Re: st: RE: Summarising multiple tabulations in one table
Date   Tue, 10 Dec 2002 14:28:31 +0000 (GMT Standard Time)

On Tue, 10 Dec 2002 12:27:28 -0000 Nick Cox <> 

> Stephen P. Jenkins
> >
> > I have a large number of categorical variables named
> > "agekst*" (where *
> > are integers), where each variable is coded using the same frame (4
> > categories: 0,1,2,3). The variables summarise the number of
> > children a
> > woman has had by each age (the elements of *). I would like
> > to tabulate
> > the percentages in each agekst* category -- these are
> > straightforward
> > to derive using -tabulate- and e.g. -foreach-. But how can
> > I report the
> > percentages in a summary table in which there is a column for each
> > variable and the rows are the col percentages? (Or, alternatively,
> > there are rows for each variable, and the col percents on
> > agekst* form columns.)
> > I also know each woman's birthdate, summarised in a categorical
> > variable named "cohort" (8 categories), and it would be
> > nice to able to
> > repeat the summary table for each value of cohort.
> > [I've looked at -collapse-, -table-, and their relatives, and none
> > appear to be what I require.]
> > Suggestions please!
> > In essence I am asking how I might use Stata to reproduce
> > output that the SPSS REPORT command produces.  Here follows an
> example
> > of what SPSS can do:

> I guess your main way forward is -reshape- so that
> the agekst* are all stacked into one variable.

I don't see this -- could you elaborate please? The obs in the data set 
are several thousand woman, i.e. unit record data, so what I was asking 
about was a combined tabulation&formatting routine. Tabulation to 
derive percentages in each category for each variable is 
straightforward, but the formatting like the SPSS example is the 
problem. (If each variable of interest were binary, I think I could  
solve the problem using -table- or -collapse-, but there are multiple 
categories per variable here.)  I am not sure my telling you that the 
names were agekst* helped -- a neat solution would allow any variable 
names across the top of the report table.

Professor Stephen P. Jenkins <>
Institute for Social and Economic Research (ISER)
University of Essex, Colchester, CO4 3SQ, UK
Tel: +44 (0)1206 873374. Fax: +44 (0)1206 873151.

*   For searches and help try:

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