Getting to Know STATA

Over the past couple weeks, I’ve been learning to program in STATA, a program used to assist statistical analysis. My advisors have been working on a project that requires them to know the charges for individual surgical procedures , specific to an individual hospital. For some hospitals however, there are no records for an individual procedure’s cost. Instead, there are entries that have the combined cost for two procedures, one being the procedure of interest. Hence, the data must be manipulated to get the desired results. In the simplest example, the information we wish to find is the charge of procedure x at hospital A. In the data, we find the charges for procedure x  and procedure y combined. In order to find the charge for procedure x by itself, we can look to see if there is an entry that just contains the charges for procedure y. We could then subtract this value from the x and y combined charges to get our procedure of interest. In order to do this, it is easiest to write some code up in stata that goes through this process.

My advisors were very helpful in guiding me through the programming process, but it was still quite challenging. Since I had never created code in STATA before (and have very limited programming experience in general), most of the syntax and terminology was brand new to me.  To help get me started, I was given the code for a program that helps find charges for procedure x from a two procedure combination, x and y. In some cases though, there are no matches for this scenario. The next step is to move on to three procedure cases. That is , if we want the charges for procedure x, we can try to find the charges for procedure x,y, and z combined. Then, if we can find procedure y and z together, we can subtract those charges to get procedure x’s charges. Or, if we can find just y and just z individually, we can add those charges together and then the difference between that sum and x,y, and z combined will give us the cost of procedure x.  After lots of trial and error and help from my advisors, I was able to write code that went through this process. I am definitely glad I got the chance to become more skilled in using STATA. I will be be able to save lots of time on  future projects now that I know some basic programming functions in STATA.