Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Two Easy Questions


From   Socrates Mokkas <[email protected]>
To   [email protected]
Subject   st: Two Easy Questions
Date   Tue, 31 Oct 2006 20:51:47 +0000

Hi People,

I need to write down a command that has too many variables but I do not want to write down all of the variables that I use. Suppose that I have var1, var2,...to Var12 and I want to have a command like:

replace Dot=Quick if var==0 & var2==0 & ....& var12==0.
Is there a way to make a shortage of that? I tried possible different varlist definitions like:

replace Dot=Quick if var*=0

but they do not seem to work.
An additional question is that I tried to write a the commands within an if but Stata is not doing anything. So I wrote:

if var1==0 & var2==0 {
    replace Dot=Quick
}

and it is not doing any changes whasoever. Whereas if I write it

replace Dot=Quick if var1==0 & var2==0 

it does the changes. Is there a problem with my syntax of the if command?

Thanks in advance!

Regards,
Socrates
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index