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

st: RE: How to find out whether a variable is a dummy variable ?


From   "David Harrison" <david.harrison@icnarc.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to find out whether a variable is a dummy variable ?
Date   Tue, 2 Aug 2005 16:27:20 +0100

By a 'dummy variable' do you mean taking the values 0 or 1 only? If so, you could do this with an -assert- command, e.g.

cap assert inlist(var1,0,1)
if _rc {
	<code for a continuous variable>
}
else {
	<code for a dummy variable>
}

David

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Thomas
Cornelißen
Sent: 02 August 2005 16:24
To: statalist@hsphsun2.harvard.edu
Subject: st: How to find out whether a variable is a dummy variable ?


Is there a programmer's command to find out whether a variable is a dummy 
variable  ?
I need it because all dummy variables in my program are to be treated 
differently from continuous variables.

Thanks for any comments,
Thomas
cornelissen@mbox.iqw.uni-hannover.de 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index