[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: simple question: generating variables using the if / or command
Dear Stata list,
I have a seemingly simple problem that I can't seem to figure out.
1) I would like to generate a new variable :
generate newvariable=var1+var2+var3 if dum1=1 and or dum2=1 and or dum3=1
In essence I want to sum across var2, var3 and var4 for a case where either
of the three dummies are equal to 1.
2) If instead I did the following....
Sendar3 if dum1=1 & dum2=1 & dum3=1
.... I would only capture values for var1, var2 and var3 if ALL the three
dummies simultaneously are 1. is this correct? If so I do not want this.
Express yourself instantly with MSN Messenger! Download today it's FREE!
* For searches and help try: