On a cold Sunday evening, starting from the evening until well past midnight, it has taken me more than 7 hours to figure out why a simple code would not run. I checked the data, I looked up Google, I emailed the professor, I posted a new thread of message in the class discussion forum. However, nothing worked. I could not generate a simple bar graph using two variables in stata. I took breaks, I paced up and down my home, I sometimes sipped some water. The assignment was due the following day, and the professor had promised it shouldn’t take that long. Then why was the code not working?
After seven plus hours of thinking, contemplating, frowning, agonizing, staring at the data, seeking for help, excogitating, and cerebrating, I finally spotted the problem. Every numeric information I had in my dataset, stata for some inexplicable reason thought was a string data. Now why would stata think an achievement score percentile would be string data, I have no idea. Some serious googling indicated that string data was coded red, and numeric data was coded black. With the sinking feeling, I went back to my dataset and checked. There was blood everywhere.
All it took me was a simple command, “destring, replace”. Within seconds, stata had converted most variables from red to black. There are a few that still look red, but I am past caring.
I cried the moment stata converted everything from red to black. I don’t know if the tears were for happiness, relief, or tension release.
I cried, because it took me seven plus hours on a Sunday evening to figure out that every numeric data was being read as string data. And all it took to fix it was a simple command. Whether I am stupid, naïve, or lack sharpness to survive graduate school, I will never know. This could be one of your unfortunate evenings if you were in graduate school. If you are interested in graduate school, please ensure that you have virtues like patience, hard work, and persistence in your toolkit.
Finally, my data looks as if there are no strings attached.