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: RE: tabout loop across surveys
From
"Radwin, David" <[email protected]>
To
<[email protected]>
Subject
st: RE: tabout loop across surveys
Date
Fri, 2 Aug 2013 11:50:17 -0400
As stated in the FAQ, please describe the author and source of
user-written programs. -tabout- is by Ian Watson and available from SSC.
It's difficult to say with certainty given the limited information I
have, but I think you could -reshape- your dataset from long to wide.
The syntax would be along the lines of
. tabout industry [weight=weight] using result.cvs, c(mean wages02 mean
wages03 etc.) etc.
David
--
David Radwin
Senior Research Associate
Education Studies Division
RTI International
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-665-8274
www.rti.org
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Cardozo-Silva,
Adriana-Rocio
> Sent: Thursday, August 01, 2013 10:20 AM
> To: [email protected]
> Subject: st: tabout loop across surveys
>
> Hello,
> I am using tabout to export a table containing average wages by
industry
> sectors using 9 different survey years.
> (from 2002 to 2010). When I use the append command, the resulting
table
> shows a table for each year ordered vertically.
> I want to have a table containing the industry sectors in the first
column
> and to its right the average wages for each year.
> Can some one tell me how to do such a loop?
>
> My code is:
>
> foreach year in 02 03 04 05 06 07 08 09 10{
> use cos`year', clear
> tabout industry [weight=weight] using result.cvs, c(mean wages) sum
> h2(Average Wages) h3(Year 20`year') format(1) append
> }
>
>
>
> Thanks
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/