Stata FAQ
Top 10 Questions about Stata

This page contains the top 10 problems/questions that we find that people encounter when they first start using Stata. If you have further questions, please see our other Stata pages or use our consulting services so we may help you further.

1. How do I manipulate the windows? Sometimes the windows disappear, what can I do?

The movies about the Stata 9 Graphical User Interface (for Windows) explains more about this.

2. How do I change the font (PC version)?

The Stata Results window has an icon in the top left corner (see below) that you can click and bring up a menu to select the font. Below we show an arrow pointing to this icon for the Review window. For other windows, you can right click on the window and then a menu pops up allowing you to select the font. The font changes you select are saved from one Stata session to the next. If you want to change the font for each window, you need to do this process separately for each window, allowing you to choose a different font for each window.


3. How do I read a file that is over 1 megabyte?

By default, Stata can only read in a file that is up to 1 megabyte. If you try to read a bigger file, you get an error, illustrated below.
use bigfile

no room to add more observations
Before you read the file, use the set memory command to allocate enough memory for the file.  If the file is, for example, 9 megabytes then you need to allocate at least 9 megabytes for the file (say we allocate 20 megabytes to give us room to add more variables).  We illustrate this below.
	set memory 20m

	use bigfile
You can make these changes permanent like this.
	set memory 20m, permanent

4. When I run a regression or anova, I get an error "matsize too small"

You can overcome this by using the set matsize command.  The highest setting is 800, illustrated below.
	set matsize 800
You can make these changes permanent like this.
	set matsize 800, permanent

5. Why can't I save the contents of the results window?

The results window stores just the most recent results that you have created.  It does not store all of the results.  If you want to copy selected parts of the output, see How do I Copy Stata Output and Stata Graphs into Word?

If you want to save all of the results from your Stata session, you need to start a log file.  Say you want to call the log c:\dissert.log, you can type the following at the start of your Stata session.

log using c:\dissert.log
Then, go ahead and run all of your commands. When you are done, you can type.
log close
The results of all of your commands will be saved in the log file (for this example, c:\dissert.log ).

6. Can I make the results window hold more results?

Yes. Suppose you wanted the results window to hold up to 300,000 bytes, you can use the following command

set scrollbufsize 300000
(set scrollbufsize will take effect the next time you launch Stata)

As the message indicates, the setting will not take effect until the next time you launch Stata. However, that setting will be remembered every time you launch Stata from that point forward.

7. Are my graphs saved in my log file? How do I save my graphs?

The log file does not save your graphs.  There are a few ways that you can save your graphs, but the most common way is to copy the graphs and paste them into Microsoft Word, where they can be integrated into your report/document.  This is described at How do I Copy Stata Output and Stata Graphs into Word?.

8. How do I update my copy of Stata?

After you install Stata, you want to update it to get the most recent updates.  Once you are connected to the internet, you can type
update all

If there is a new executable file, you will also need to type

update swap
You can follow the onscreen instructions to complete the update process. Since Stata is frequently updated, we recommend this every month.

9. I have Stata 9 or 10, can I still use the Stata 7 version of the graph commands?

Yes. You can do this three ways. First, is using the graph7 command, for example
graph7 read write
or you can use the version 7 prefix, for example
version 7: graph read write 
or you can use the version 7 command, for example
version 7
graph read write
graph read math
graph read science
version 8

10. I have Stata 10. Can I save data so they can be used in Stata 9?

Yes, you can use the saveold command, for example
saveold mydata
and that file will be usable in Stata 7 (as well as Stata 8 and Stata 9).

How to cite this page

Report an error on this page or leave a comment

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.