Hello,
I am trying to recreate a treatment variable with the following code:
So, basically the code does not work for me. When I run the code, it does create the variable "treat" but without any values. Besides, I would like to know what the meaning behind:
is, since variable "groups1" does not exist. This syntax appears multiple times. There is no error message, and the code runs without any problems. Besides, the line starting with *g seems also quite odd to me, since they are notes, however, I don't really understand what is meant with them. Is this abbreviated Stata language?
Thank you for your help in advance.
I am trying to recreate a treatment variable with the following code:
Code:
***the critical code*** gen treat= groups1 !="" replace treat= . if date10 != . *gen treat=1 if groups1!="" label def treat_control 1 "Treatment" 0 "Control"
Code:
gen treat= groups1 !=""
Thank you for your help in advance.
Comment