{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

OLS-Stata9 - Using Stata 9 Higher for OLS Regression...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Using Stata 9 and Higher for OLS Regression Page 1 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 change the cases that get analyzed. The correlate command below uses listwise deletion of missing data, which is the same as what the regress command does, i.e. a case is deleted if it is missing data on any of the variables in the analysis. . correlate income educ jobexp race, means (obs=20) Variable | Mean Std. Dev. Min Max -------------+---------------------------------------------------- income | 24.415 9.788354 5 48.3 educ | 12.05 4.477723 2 21 jobexp | 12.65 5.460625 1 21 race | .5 .5129892 0 1 | income educ jobexp race -------------+------------------------------------ income | 1.0000 educ | 0.8457 1.0000 jobexp | 0.2677 -0.1069 1.0000 race | -0.5676 -0.7447 0.2161 1.0000
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Using Stata 9 and Higher for OLS Regression Page 2 Regression . Use the regress command for OLS regression (you can abbreviate it as reg ). Specify the DV first followed by the IVs. By default, Stata will report the unstandardized (metric) coefficients. . regress income educ jobexp race Source | SS df MS Number of obs = 20 -------------+------------------------------ F( 3, 16) = 29.16 Model | 1538.92019 3 512.973396 Prob > F = 0.0000 Residual | 281.505287 16 17.5940804 R-squared = 0.8454 -------------+------------------------------ Adj R-squared = 0.8164 Total | 1820.42548 19 95.8118671 Root MSE = 4.1945 ------------------------------------------------------------------------------ income | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- educ | 1.981124 .3231024 6.13 0.000 1.296178 2.66607 jobexp | .6419622 .1811106 3.54 0.003 .2580248 1.0259 race | .5707931 2.871949 0.20 0.845 -5.517466 6.659052 _cons | -7.863763 5.369166 -1.46 0.162 -19.24589 3.518362 ------------------------------------------------------------------------------ Confidence Interval.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern