Author
Listed:
- Eric A. Booth
(Texas 2036)
Programming Language
Abstract
usepackage takes the list of user-written packages a do-file needs and makes sure they are installed, so a shared do-file can open with one line instead of a stack of ssc install / net install commands or a paragraph telling the reader to go run findit. For each name it checks whether it is already installed, then SSC, then the net search catalogue (which covers the Stata Journal and the STB), reporting what it found, what it skipped, and why. The name you ask for is often a COMMAND rather than a PACKAGE -- dropmiss ships inside dm89_2, bacon inside st0197. usepackage resolves that case, but because the mapping is inferred it asks before installing, and in a batch run it declines rather than guessing (see noconfirm). Ancillary files (a package's example do-files and datasets, which net install does not place on the adopath) are fetched by default and reported; noancillary skips them. github() installs a package straight from a GitHub repository, probing branch (main, then master) and the usual layouts for stata.toc; give it a bare owner and it searches that account's repositories by name, or set the global usepackage_github once and any unresolved name is looked for there. It uses only raw.githubusercontent.com for installs, so it is not rate-limited the way the GitHub code-search API is. data() fetches data files out of a GitHub repository, guessing the live branch and transparently resolving Git LFS pointers, which the raw endpoint otherwise serves as a 130-byte text stub that Stata cannot read. scan() reads a do-file and reports which of its commands do not resolve on this machine. usepackage does not check versions; pair it with require (Correia and Seay, Stata Journal 24(4)) when you need minimum or exact versions pinned. Version 1.0.0 (2011) was written at the Public Policy Research Institute, Texas A&M University.
Suggested Citation
Eric A. Booth, 2026.
"USEPACKAGE: Stata module to find, verify, and install the user-written packages (and data) a do-file needs,"
Statistical Software Components
S459828, Boston College Department of Economics.
Handle:
RePEc:boc:bocode:s459828
Note: This module should be installed from within Stata by typing "ssc install usepackage". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
Download full text from publisher
Corrections
All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s459828. See general information about how to correct material in RePEc.
If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.
We have no bibliographic references for this item. You can help adding them by using this form .
If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .
Please note that corrections may take a couple of weeks to filter through
the various RePEc services.