Welcome Guest User. You are not logged in.

Introduction to Stata

This page is maintained by the software tutors. For errors and/or amendments please contact the current tutor  supporting the program.

 

Introduction

Stata is among the most popular software packages for performing econometric analyses. It features a large set of econometric techniques and efficient data handling procedures. Users without any background in command-oriented software may find the first steps difficult, but once the basic principles are understood, the software allows for easy access to a wide set of different estimators.

Stata can be used in three different ways. In the interactive mode you directly type the commands in the command window. If you're unfamiliar with the syntax of a particular command you can execute it via menus as in any other Windows software. Newcomers may find this option particularly attractive. As you become more familiar with Stata you may want to work with do-files. They allow for fast execution of command sequences such that you work more efficiently. If you use the menus Stata generates code that you then can copy into the do-file.

 

Example

You find Stata installed on the desktops of the Economics Department. The package comes with a number of datasets, one of which we now use to run a simple wage regression. Once you open Stata type 

sysuse nlsw88, clear

Sysuse refers to the internal datasets of Stata. In general, you type use filename, clear. To learn about the variables the dataset contains type

describe

We know now that wage refers to hourly wage, ttl_exp has experience and grade contains years of schooling. To learn more about the variables of interest we can obtain summary statistics by typing

sum wage grade ttl_exp

To obtain the distribution of schooling in the sample, type

tab grade

As always we want to regress log hourly wage on schooling, experience and experience squared. But first we have to generate the variables we need.

gen lwage = log(wage)

gen ttl_exp2 = ttl_exp * ttl_exp

To obtain OLS estimates of this human capital earnings function type

reg lwage grade ttl_exp ttl_exp

 

Documentation

The quickest way to obtain help is to type help commandname. In case the presumed command does not exist, Stata will ask whether you want it to perform a key word search. In case you find the information provided by help insufficient you can always consult the manual. The VSP reference library has one copy of the manual; a second is available in the Library.

Page last updated on 08 December 2010