STATA: Read in a Stata Data Set

A. Colin Cameron, Dept. of Economics, Univ. of Calif. - Davis

This January 2009 help sheet gives information on

Stata stores data in a special format that cannot be read by other programs.
Stata data files have extension .dta

We consider data in the Stata date file carsdata.dta

SIMPLEST METHOD

In Windows go to the directory with file carsdata.dta and double-click on carsdata.dta
This initiates Stata and opens the data file.

COMMAND LINE METHOD

Start STATA in windows.

Change directory to the directory with the file and then open (use) the file.
For example if file carsdata.dta is in directory C:\stata\ on the command line give commands
  cd C:\stata
 use carsdata.dta

Even more simply give the command
 use "C:\stata\carsdata.dta"

INTERACTIVE METHOD USING STATA GRAPHIC USER INTERFACE

Use the Stata File Menu

File menu

Click on Open and browse to the appropriate directory (here the data were in a subdirectory called stata)

Stata file open

Then click on open. We obtain:

Stata file open

Note that Stata actually gives the command that we called have typed in (rather than using the File menu), here:
  use "C:stata\carsdata.dta", clear
In future we could remember this and just type in this command.

For further information on how to use STATA go to
   http://cameron.econ.ucdavis.edu/stata/stata.html