This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: STATA A short list of commands and procedures July 16, 2010 James B. McDonald Department of Economics Brigham Young University Table of Contents 1. Entering data 2. Running commands 3. Basic mathematical and statistical operations 4. Basic regression 5. Violations of the regression assumptions 6. Basic testing procedures 7. Some important variations of regression models 8. Qualitative response models 9. ARCH/GARCH models 10. ARIMA models 11. Panel data models 12. Vector autoregressive models (reduced form and structural forms) 13. Nonlinear least squares 14. Maximum likelihood estimation 15. Bootstrapping 16. Matrix operations STATA: a short list of commands and procedures Tutorials: The MIT introduction to STATA written by Aimee Chin is located at http://mit.edu/14.33/www/stata_A.html UCLA has some excellent instructional material, including “movies” which can be reached at http://www.ats.ucla.edu/stat/stata/ FHSS has an online tutorial which can be accessed at http://fhssrsc.byu.edu Stata examples for Wooldridge problems: http://fmwww.bc.edu/gstat/examples/wooldridge/wooldridge.html 1. Entering data $ Entering data from an asci or text file (w/o a line defining variable names) $ infile y x1 x2 x3 using c:\data\filename and extension $ Stata “file”, import, unformatted, ASC, or browse variable names $ Save as .dta file. $ Entering data where the first line contains the variable names $ insheet using c:\data\filename and extension $ EXCEL data $ Save the data file as a comma delimited file, filename.csv $ insheet using c:\data\filename.csv $ Copy and Paste $ Copy the data from an Excel spreadsheet $ Open the Data Editor in Stata either by typing “edit” in the command prompt or clicking on the Data Editor toolbar button $ Paste the data $ Close/exit the editor $ Directly entering data $ Type “edit” in the command prompt $ Enter the data $ Under the “file” command type “save as” and save as a “.dta” file. $ Close/edit the editor 2. Running Commands $ Running commands from the command window $ Type a command (such as “edit”, “help”, or “reg y x”) and press enter $ Running commands from a dofile $ Open the dofile editor by typing “doedit” in the command prompt or clicking the dofile editor in windows button toolbar button $ Type the commands you wish to execute $ Comment lines using an asterisk (*) at the beginning $ Comment a block of code using (/*) at the beginning and (*/) at the end $ To wraparound a long line of code to the next line, type (///) at the end $ Save the dofile $ Run the dofile by clicking the “Do current file” toolbar button in the dofile editor (picture of text with a downward pointing arrow) $ Example of dofile: *Example dofile clear /* clears any previously loaded data*/ insheet using C:\example.csv /*loads a dataset called “example” */ reg Y X, robust /* regresses Y on X using robust standard error */ 3. Basic mathematical and statistical operations $ Typing “ mata...
View
Full Document
 Winter '08
 Mcdonald,J
 Economics, Econometrics, Regression Analysis, The American

Click to edit the document details