Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating a table with sample restriction specifics in headers


From   Stephen Cranney <scranney@sas.upenn.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Creating a table with sample restriction specifics in headers
Date   Mon, 20 May 2013 11:44:23 -0400

Hi all,

I'm looping a regression over approximately a dozen countries X 3
years= 21 different samples. Instead of going through and eyeballing
each set of regressions one by one, I want to compile them all into a
table and automatically head each table with the sample that that
regression is limited to. The variable that restricts the sample is
numeric, but the labels are string (CZ_08, for example, is the Czech
Republic in 2008).  In other words, is there a way to create a macro
from a variable label, and then directly input that macro into the
header of an estout or estimates table.

levelsof V7, local(levels)
foreach l of local levels {
  ologit V36 V33 $demo if V7 == `l'
  tab V6 if e(sample)==1
  tab Year if e(sample)==1
  est store
 }

Thanks in advance,

Stephen
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index