{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

IntroductiontoStata7

IntroductiontoStata7 - AEM411 Introduction to Econometrics...

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

View Full Document Right Arrow Icon
AEM411 – Introduction to Econometrics Introduction to Stata Marc F. Bellemare Basic Commands To input commands into Stata, one can either type them directly in the software window or use a .do file. I find the latter method to be more efficient, as it allows me to run long programs rather quickly. To use the .do file method, you just need to type your program using the Microsoft® Windows Notepad and save it with a .do extension (instead of the usual .txt extension). You should always begin your program with the following three commands: .clear clears the memory; .drop _all drops all the variables; .set mem #m sets Stata’s memory use to the number # of megabytes you specify; Usually, eight or 16 megabytes will be enough, but for very large datasets (such as panel datasets), you might need to specify as many as 256 megabytes. Note that if you want to drop a single variable x instead of all the variables, you just need to type: .drop x where x is the name of the variable you want to drop; To import data into Stata, you can either use a file that is already in Stata format (a .dta file) or import from an ASCII file. If you use the latter method, make sure the columns are delimited by tabs and that they represent the variables while the rows represent observations! Also, make sure the first line of your data file is not made up of the names of your variables, as you will name them using the following command: .infile x1 … xk using c:\file.txt
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
Image of page 2
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