Skip to main content

Using research tools via Citrix: Stata/SE

Using Stata

How to open files in Citrix/Stata

Data files can be opened in Stata using menus or by entering the appropriate command. Double-clicking on a file to open it, will not work.

To open files via menus, use the instructions provided elsewhere to launch Citrix/Stata. Once Stata is upan running, access the File menu:

 

 

The “Open…” option will open a standard file-browsing window. Within this browser, it’s possible to view folders and files on the Citrix virtual machine as well as on your local system. The following screenshot demonstrates how to ensure that you’re looking in the correct location for the file you wish to open:

 

 

Keep these instructions in mind when saving files during a Stata session. Be sure to only your local file system when saving. To be safe, when you save a file from within a Stata, you may want to confirm that you’ve saved it on your local system by locating it using Finder (MacOSX) or Explorer (Windows). Be sure to do this before you exit your Stata session.

 

Using a working directory

If you prefer to work from the command line or from a do file, it’s best to set a working directory for your project. In order to do this, you’ll need to first copy all the files in your project into a specific folder. Next, use the “Change Working Directory“ option from the File menu to navigate to that folder:

 

 

After the Change Working Directory command is run, there’ll be some output in the Stata results panel showing you how Citrix has mapped your working directory. It should look something like this:

Once you’ve set the working directory any command that requires a filename, like use, save, do , or log using will by default read from or write to the working directory. This is particularly useful when using a do file that’s been provided to you to read data from a text file, an approach used by data repositories like ICPSR and IPUMS. These do files always require that you make sure that any file references are valid, so as long as no paths are included and the data file name matches what’s in your working directory, the do file should run.

 

Importing modules and libraries in Stata

Importing code and data from the web

In order to use external libraries or data in Stata you will need to have the domain that the data or code is hosted at cleared for access or will have to download the code or data to your local computer.

Cleared domains for Citrix/Stata

  • fmwww.bc.edu
  • www.repic.org
  • stata-press.com
  • www.ats.ucla.edu

Use of ado files

Users are not able to directly install ado files on the Citrix platform.  Ado files can be included in a user directory for individual sessions but these files do not persist across sessions.  Another option is to specify a local directory in which to save these files by running the following commands (you'll need to specify a valid local directory for this to work):

net set ado "\\Client\C$\Users\username\Documents\stata_packages"

ssc install packagename

www`adopath + "\\Client\C$\Users\username\Documents\stata_packages"

 

The package(s) you install will be permanently saved on your local system, but the settings only last for your current session. Each time you begin a Stata session in which you want to use one of these packages you’ll need to give this command:

 

adopath + "\\Client\C$\Users\username\Documents\stata_packages"

 

Users who are interested in more details about how to get ado files included for use should submit a Campus Shared Services ticket to get assistance.

Copyright © 2014-2016 The Regents of the University of California. All rights reserved. Except where otherwise noted, this work is subject to a Creative Commons Attribution-Noncommercial 4.0 License.