I really do not know how to manipulate data set, the right syntax, that stata is case-sensitive, and most importantly, that I should ALWAYS log (though I still usually do not keep log files). My first impression is that stata is so tiring to use.
All that was going for me is my knowledge of excel. I picture in my mind the variables in my mind using excel. I visualize the structure of the data set in “excel terms”. At one point, I constructed a data set via excel and then ran the regression commands using stata (a No! No!).
Then, seven years ago, in my first random experiment project, I instinctively picked up a few things. For instance, in the question…
“What if I am adding two variables, and say some of the observation has no values in one of the mentioned variables, should I….
1. Replace the missing values with zero, and then simple
gen variablename=variable1+variable2
….. or I do the following:
2. gen variablename=variable1+variable2
replace variablename=variable1 if variable2==.
replace variablename=variable2 if variable1==. “
My guiding rule then is NEVER, ever change the base variable. Always generate a new one. So I opted for option 2 above……
Now I know better (I think), I use egen!
Don’t want to explain, would rather show. (Hopefully, I would always be inspired to do sample files and do-files for you guys! Now I am inspired since I just saw a nice play).
So here is the link. Read the do-file first. Change the location in the do-file (research on your own why this has to be done J ). And of course, you know the drill.
PS: Hopefully, fewer REDs this time....
No comments:
Post a Comment