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

st: RE: svytab

From   "Nick Cox" <>
To   <>
Subject   st: RE: svytab
Date   Tue, 8 Jul 2003 17:34:43 +0100

> Is there a way to combine a "by" statement or its 
> equivalent with the svytab
> command?  For instance, I have a file with multiple years 
> and want to
> breakdown the svytab results by year.  Using the simple 
> "tabulate" command
> allows me to do this using by year: tabulate <varlist>. The 
> svytab command
> does not but I'm wondering if there is another way to do this?

Try -levels-. 

levels year, local(Y) 
foreach y of local Y { 
	svytab onevar othervar if year == `y'

In addition, see the FAQ 

Is there a way to tell Stata to try all values 
of a particular variable in a foreach statement 
without specifying them?


*   For searches and help try:

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