Hello all together,
I am new here so please let me know if I asked my question properly. Unfornately, I cannot post output due to confidentiality issues but I hope you can still help me. I am a beginner in Stata and I have a problem with dummy variables in an areg-regression:
I have a list of 33 dummy variables guts1-guts33 which stand for some variables of my dataset. I created them by "gen gutsd". Now I want to set some of them to 0 in my regression. I have tried to put the dummy variables in a macro:
Problem: He seems to only set the first (guts2) to zero but i want him to set guts2, guts3 and guts4 to 0. If i put them in seperately it does the job but is not really an elegant way of doing it:
[CODE
I have not found anything but probably just did not look for the right thing.
Thanks in advance and best regards
Renato
I am new here so please let me know if I asked my question properly. Unfornately, I cannot post output due to confidentiality issues but I hope you can still help me. I am a beginner in Stata and I have a problem with dummy variables in an areg-regression:
I have a list of 33 dummy variables guts1-guts33 which stand for some variables of my dataset. I created them by "gen gutsd". Now I want to set some of them to 0 in my regression. I have tried to put the dummy variables in a macro:
Code:
- global gutsch guts2-guts4
- areg q2 $treatments date $controls if count==1 & $gutsch==0 , robust absorb(zip)
[CODE
- areg q2 $treatments date $controls if count==1 & guts2=0 & guts3 = 0 & guts4 =0, robust absorb(zip)
I have not found anything but probably just did not look for the right thing.
Thanks in advance and best regards
Renato
Comment