More on Stata for Windows

1. Using Stata datasets and graphs created on other platforms

Stata will open any Stata .dta dataset or .gph graph file regardless of the platform on which it was created, even if it was a Mac or Unix system. Also Stata for Mac and Stata for Unix users can use any files that you create. If you transfer a Stata file by using file transfer protocol (FTP), just remember to transfer by using binary mode rather than ASCII.

2. Exporting a Stata graph to another document

Suppose that you wish to export a Stata graph to a document created by your favorite word processor or presentation application. You have two main choices for exporting graphs: you may copy and paste the graph by using the Clipboard, or you may save the graph in one of several formats and import the graph into the application.

2.1. Exporting the graph by using the Clipboard

The easiest way to export a Stata graph into another application is by copying and pasting.

Either create your graph or redisplay an existing graph. To copy it to the Clipboard, right-click on the Graph window, and select Copy. Stata will copy the graph as an Enhanced Metafile (EMF); this ensures that the receiving application obtains it in the highest resolution possible.

A metafile contains the commands necessary to redraw the graph. That is, a metafile is a collection of lines, points, text, and color information. Metafiles, therefore, can be edited in a structured drawing program.

After you have copied the graph to the Clipboard, switch to the application into which you wish to import the graph and paste it. In most applications, this is accomplished by selecting Edit > Paste. Consult the documentation for your particular application for more details.

2.2. Exporting the graph to a file

Stata can export graphs to several different file formats. If you right-click on a graph, select Save as…, and then click on the drop-down menu next to Save as type, you will see that Stata can save in the following file types:

Enhanced Metafile (EMF, .emf), Enhanced PostScript (EPS, .eps) with or without a TIFF Preview, Joint Photographic Experts Group (JPEG, .jpg) with High Quality or Maximum Quality, Portable Document Format (PDF, .pdf), Portable Network Graphics (PNG, .png), PostScript (PS, .ps), Scalable Vector Graphics (SVG, .svg), and Tag Image File Format (TIFF, .tif).

EMF, EPS, PDF, PS, and SVG are vector formats, whereas JPEG, PNG, and TIFF are bitmap formats. If you wish to include a thumbnail of the graph with an EPS file, choose EPS with TIFF Preview (*.eps). Choosing the preview option does not affect how the graph is printed. PNG and SVG are well suited for placing graphs on a webpage. See [G-2] graph export for more information.

3. Installing Stata for Windows on a network drive

You will need a network license before you can install Stata on a network drive. You can install Stata from the server; or if you have the appropriate privileges, you can install Stata directly to the network drive.

Once Stata is installed, run it to initialize the license. Mount the network drive that Stata is installed on from a workstation. Right-click on the Desktop or on the Windows Start menu, and select New > Shortcut. Type the path for the Stata executable into the edit field, or click on Browse… to locate it. Type Stata as the name of the shortcut.

Once a shortcut for Stata has been created, right-click on it, and select Properties. Set the default working directory for Stata by changing the Start in field to a local drive that users have write access to. This is where Stata will store datasets, graphs, and other Stata-related files. If the workstation will be used by more than one user, consider changing the Start in field to the environment variable %HOMEDRIVE%%HOMEPATH%. Doing so will set the default working directory to each user’s home directory.

4. Calling Stata from Python

You can call Stata from Python using the pystata Python package. This includes a suite of API func­tions and IPython magic commands that can be used to interact with Stata and Mata. To learn more about the pystata Python package, view the online documentation at https://www.stata.com/python/pystata. Or see [P] PyStata module for more information.

5. Changing a Stata for Windows license

If you have already installed Stata and your license needs to be changed, go to Help > About Stata, then click on the Update license… button on the lower left. You can either browse renewal options or enter a new License and Activation Key.

Source: STATA (2021), Getting Started with Stata for Windows, Stata Press Publication.

Leave a Reply

Your email address will not be published. Required fields are marked *