How to import data into STATA?

By Priya Chetty on December 28, 2016

STATA comes with a set of sample data files. This helps the learner in understanding how different set of tests can be applied to single data. For the purpose of understanding this module I will be using auto.dta and will be applying some tests to this data. However, importing data from MS excel to STATA is important.

Selecting example datasets

In order to select example datasets, click on File and scroll down to example datasets. Click on “Example Datasets…”. A new window will open. There will be two options:

  1. Example Datasets installed with STATA
  2. STATA Manual Datasets

While option 1 provides different datasets in STATA, that were installed as default with the software. On the other hand, option 2 will enable to have web access all the datasets which have been computed using STATA.

To full fill the purpose of this article select option 1. After which a new page will open that enlists different datasets. For every dataset you can use 2 options, i.e. use or describe. When you Click “Describe”, it will give you the description of dataset variables in Output window and when you click “Use” it will reflect all the variables in Variable window.

Importing data to Data Editor

Since we have selected an Example Dataset, the data for each variable is  automatically transferred to data editor window (see below):

importing the example data set from stata to main window
Importing example data set from STATA

If the data is stored in excel, then import the data to STATA by copying the data from MS Excel into the Data Editor. In order to do so, click on the Data Editor icon on the bar as shown below:

Importing data from microsoft Excel to stata
Importing data from Microsoft Excel

While pasting the data in the data editor window, it will give you two options:

  1. Treat first row as data
  2. Treat first row as variable names

In cases where there are variable names we will select Option 2 so that the variables names are added on the top row. The Data Editor like MS excel allows the analyst to make changes in the responses if and when needed.

Priya is the co-founder and Managing Partner of Project Guru, a research and analytics firm based in Gurgaon. She is responsible for the human resource planning and operations functions. Her expertise in analytics has been used in a number of service-based industries like education and financial services.

Her foundational educational is from St. Xaviers High School (Mumbai). She also holds MBA degree in Marketing and Finance from the Indian Institute of Planning and Management, Delhi (2008).

Some of the notable projects she has worked on include:

  • Using systems thinking to improve sustainability in operations: A study carried out in Malaysia in partnership with Universiti Kuala Lumpur.
  • Assessing customer satisfaction with in-house doctors of Jiva Ayurveda (a project executed for the company)
  • Predicting the potential impact of green hydrogen microgirds (A project executed for the Government of South Africa)

She is a key contributor to the in-house research platform Knowledge Tank.

She currently holds over 300 citations from her contributions to the platform.

She has also been a guest speaker at various institutes such as JIMS (Delhi), BPIT (Delhi), and SVU (Tirupati).



5 thoughts on “How to import data into STATA?”