Skip to main content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.

Stata

A brief introduction to Stata

Loading Data

Using code to open a dataset, either one you have downloaded or inputted manually, in Stata is rather easy. Once you have the data downloaded onto your computer the next step is to tell Stata the location of the data, so it knows where to pull it from. You can find the path of a file by left clicking on the file, going to properties, and copying/pasting the path into the Stata .do file.

 

Below is code for opening a data file in Stata. Note: Stata data files are saved as a ".dta" file.

Code

use "C:\Users\Username\Stata\SLID.dta"

 

In the code above we are telling Stata to use the data from a file that can be found along the path "C:\Users\Username\Stata\SLID.dta" on a computer. 

If you have collected data and need to begin manually inputting it into Stata, you can click on the icon highlighted in red below on the main Stata page and a blank dataset window will appear.

undefined

 

In Stata you can directly type data in and Stata will automatically produce a new observation for each row.