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.


A brief introduction to Stata

Ways to View Data in Stata

Stata designates a separate ‘data window’ that can be opened once data is either downloaded or inputted manually. The data window has the name of the dataset on the very top left corner to let you know what dataset you are working with, if there are multiple open.

To view data in Stata on a separate window you may click on the data browser icon that is highlighted in red below. This will open a new window for browsing through data and some options specific to manipulating the data.



There are multiple options to view data in Stata. You may open a designated data window to view the data or call on Stata to show it in the output window. 

Below is the code for viewing an entire data set in the Stata output window.




We simply tell Stata to list the data in the output window.


The output for the code above is the observations listed in rows and variables as columns. Since there are so many observations in this dataset the output is longer than Stata is able to show. This is a limitation of 'listing' the data in Stata and instead using the data window or using other list functions maybe more useful. 



Note: a " . " in Stata indicates a missing datum point. 

To view a certain number of observations using the list function, we can specify the number using the code below. 


First 10 observations

list in 1/10, table





Observations 15 to 20 

list in 15/20, table




In Stata we can learn more about how each variable is coded, the labels, and the format of the variable (e.g., numeric, string, or character). Below is the code for finding information for all variables in the dataset at once




This is the command codebook for all the variables.

Below is the code to call on the codebook of only the variable language.


codebook language


This is the command codebook for the variable language