Hello everybody,
I asked this question in a more complicated way. So I try it in an easier way. As the title says I want to calculate:
mean of Var1 if X==1 minus mean of Var1 if X==2 by date
I would do it like that but it does not work can you help me?
by date: egen R_12=mean(Var1) if Var1==1 -(minus) mean(Var1) if Var1==2
But I do not know how I can make it work.
Hope this is a easier description.
Thanks a lot for your help
Simon
I asked this question in a more complicated way. So I try it in an easier way. As the title says I want to calculate:
mean of Var1 if X==1 minus mean of Var1 if X==2 by date
I would do it like that but it does not work can you help me?
by date: egen R_12=mean(Var1) if Var1==1 -(minus) mean(Var1) if Var1==2
But I do not know how I can make it work.
Hope this is a easier description.
Thanks a lot for your help
Simon
Comment