Ols with Stata

Submitted by: Submitted by

Views: 553

Words: 4022

Pages: 17

Category: Business and Industry

Date Submitted: 02/20/2012 09:13 AM

Report This Essay

Using Stata 9 & Higher for OLS Regression

Introduction. Stata is a popular alternative to SPSS, especially for more advanced statistical techniques. This handout shows you how Stata can be used for OLS regression. It assumes knowledge of the statistical concepts that are presented. Several other Stata commands (e.g. logit, ologit) often have the same general format and many of the same options. Rather than specify all options at once, like you do in SPSS, in Stata you often give a series of commands. In some ways, this is more tedious, but it also gives you flexibility in that you don’t have to rerun the entire analysis if you think of something else you want. As the Stata 9 User’s Guide says (p. 43) “The user-interface model is type a little, get a little, etc. so that the user is always in control.” For the most part, I find that either Stata or SPSS can give me the results I want, but there are some tasks that can be done more easily in one program than the other. For example, I personally prefer to do most of my database manipulation in SPSS and then convert the file to Stata, but that is partly because I am much more familiar with the SPSS commands than their Stata counterparts. Conversely, Stata’s statistical commands are generally far more logical and consistent (and sometimes more powerful) than their SPSS counterparts. Luckily, with the separate Stat Transfer program, it is very easy to convert SPSS files to Stata and vice-versa. Get the data. First, open the previously saved data set. (Stata, of course, also has means for entering, editing and otherwise managing data.) You can give the directory and file name, or even access a file that is on the web. For example,

. use http://www.nd.edu/~rwilliam/stats1/statafiles/reg01.dta, clear

Descriptive statistics. There are various ways to get descriptive statistics in Stata. Since you are using different commands, you want to be careful that you are analyzing the same data throughout, e.g. missing data could...