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: Using the format of a variable to trigger different command


From   Erik Lenguerrand <Erik.Lenguerrand@bristol.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Using the format of a variable to trigger different command
Date   Thu, 26 Jul 2012 11:04:29 +0100

Dear all Stata user,

I would like to use the "foreach varlist" command to loop over a large list of variables to automate a listing of descriptive statistics.

However the statistical tool to use should depend on the nature of the variable. (ie tab command for categorical variables and sum command for continuous variables)


I am wondering if there is a stata command to identify the variable format, ie something which will generate a binary outcome like 1 if is it continuous variable and 0 if not.

Thank you in advance for your help
Y
Erik





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


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