Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: tabout and foreach -counter error
From
"Claudia Y. Rangel" <[email protected]>
To
[email protected]
Subject
st: tabout and foreach -counter error
Date
Wed, 7 Dec 2011 01:00:15 -0500
Hello,
I am trying to replicate the example in Dr. Watson's tabout tutorial
to produce tables for 25 variables with restricted data, repeated over
30 geographical units; hoping to reduce my lengthy do file code. I am
sure there is a problem with the special characters and after trying
to use (') (`) and (') I still got an error returned about the counter
variable.
My apologies for any stata 101 coding mistakes.
levelsof lipsname, local(levels)
local lipslabels : value label lipsname
local counter = 0
local filemethod = "replace"
local heading = ""
foreach 1 of local levels {
if `counter' > 0 {
local filemethod = ”append”
local heading = ”h1(nil) h2(nil)”
}
local vlabel : label ’lipslabels’ ’l’
qui tabout var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11
var12 var13 var14 var15 var16 var17 immigrant if lipsflag==1 & if
lipsname == ’l’ using ”tablesfile.txt”, ’filemethod’ ///
cells (freq row) show(all) layout(cb) stats(chi2) ’heading’
h3(”LIPS: ’vlabel’”) f(0c) ptotal(single)
local counter = `counter' + 1
}
I appreciate any help,
Claudia
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/