||
Archive of user-written Stata packages
ivqrstata.zip Instrumental Quantile Regression Inference for Structural and Treatment Effect Models” (with Victor Chernozhukov)
and “Instrumental Variable Quantile Regression” (with Victor Chernozhukov).
附录: 更新你的STATA包
Finding and Installing User-Written Stata Programs
There are a tremendous number of user-written programs for Stata available which, once installed, act just like official Stata commands. Some are conveniences, like outreg for formatting regression output. Others calculate results Stata itself does not, such aspolychoric for polychoric correlations. A few represent major extensions of Stata's capabilities, such as ice and mim for multiple imputation or gllamm for mixed models. Most of these programs are stored at Boston College's Statistical Software Componentsarchive (or SSC, but not to be confused with the UW's Social Science Computing Cooperative or SSCC) .
You are welcome to install any user-written commands you desire to use, even in the labs, on Winstat or on the Linux servers, because Stata at the SSCC is set up to store the programs you install in your home directory. Thus you don't need to worry about programs you install causing problems for others. On the other hand, this means you need to install the user-written programs you want yourself. The SSCC does not try to identify some useful set of user-written programs and make them available to everyone.
This article will discuss finding, installing, and updating user-written programs. Fortunately Stata includes commands which make this very easy to do.
If you know the name of the program you want to use, you can go directly to Installing User-Written Programs. However, it's much more common to know what you want to do without knowing what program (if any) can do it. This is a job for Stata's finditcommand.
For example, suppose you wanted to do something with Heckman selection models but don't know what command to use. Type:
findit heckman
The result is a tremendous amount of information. The findit command first searches Stata's official help files and notes that there is an official heckman command and several other related commands (this makes findit a powerful tool for figuring out how to do things in Stata in general, not just for finding user-written programs). It then searches Stata's web site and locates several FAQ entries, plus an example on UCLA's large statistics web site. It then begins to list relevant user-written programs, organized into "packages." Programs that were described in the Stata Journal or the older Stata Technical Bulletin are listed first.
You can click on each package to view a very brief description, including a list of files (one package may contain several related programs). Also note the (click here to install) link. Clicking on the .hlp file will get you the help entry for the program, which you can use to decide if the program will do what you need.
Installing User-Written Programs
If you know the name of the package you want to install, you can install it by typing
ssc install package
Alternatively, if you identified the package you want using findit you can install it by clicking on its (click here to install) link. However, avoid installing any package that is directly tied to an article in the Stata Journal or the Stata Technical Bulletin. These packages contain the program as it was described in the article and are not updated. Look for another package containing the program that is not tied to an article and, if one exists, install that instead.
For example, if you type
findit ice
the first three ice packages you'll see are (as of 4/30/2008) stb0067_1, stb0067_2and stb0067_3, but none of these contain the latest version of ice. The package which does is simply called ice. As the author of ice (Patrick Royston) makes further changes and improvements, the ice package will be updated accordingly. If he writes another Stata Journal article describing the changes he has made the result will likely be anstb0067_4 package, but if you installed stb0067_3 you won't get the new version automatically.
(Getting the right version of ice is particularly important because multiply imputed data sets created by one version cannot be used by different versions--and the output of older versions can't be analyzed using mim at all. The newer versions of ice also include more capabilities than the older ones.)
Unfortunately, the ice package you want to install isn't trivial to find--it's about a third of the way through the very long list of results you get from findit ice. However, packages are usually named after the main ado file they contain, and that file is normally listed first in the package description. So if you've looked at stb0067_3 and decided that program will meet your needs, noting that ice.ado is the first file listed is enough to know that you can probably install the latest version by typing
ssc install ice
Updating User-Written Programs
While few user-written programs are updated as frequently as ice, it's still important to get the latest versions of any user-written programs you install. Sometimes updates will include important bug fixes, though the SSC archive has quality control measures in place to try to catch bugs before the program is distributed.
The easiest way to check that your user-written programs are up-to-date is to type:
adoupdate
The adoupdate command notes where each package was downloaded from and goes back to that location to see if a more recent version is available. If there is, you can install the latest version by typing:
adoupdate, update
You can get a list of the packages you've installed by typing:
ado dir
This can be very helpful for catching things like having downloaded stb0067_3 rather than ice. You can remove a package by typing
ado uninstall package
where package should be replaced by either the name of the package you want to remove or the number it is given by ado dir, including the brackets around it.
For example, suppose you downloaded some earlier version of ice that was associated with a Stata Journal article. Just typing
ssc install ice
will fail because you already have a copy of ice.ado and all the other related files, and the installer refuses to overwrite them. Thus you need to identify and remove the older version. To do so, type:
ado dir
If the results included the entry
[6] package st0067_3 from http://www.stata-journal.com/software/sj7-4
SJ7-4 st0067_3. Update: Multiple imputation of missing...
you could remove it by typing either
ado uninstall st0067_3
or
ado uninstall [6]
Then
ssc install ice
will successfully install the latest version. You should then type
adoupdate
periodically to ensure that ice stays up-to-date.
设置 个人包的 搜索 路径:
sysdir set PLUS "e:adoplus"
sysdir set PERSONAL "e:adoplus"
Adding User-Contriubted Packages While Using the Hive
The Stata user community has written many additional packages that can be added to Stata. To use these functions with Stata on the Hive:
1) Log into the hive and open StataIC 13.
2) Type in the following commands:
cd “J:Stata 13″
mkdir ado
sysdir set PERSONAL “J:Stata 13ado”
net set ado PERSONAL
3) Then to search and install different packages type:
net search [_insert packagename_]
4) Click on the link to the package you would like to install.
5) A window will pop up, click “install package”.
6) Each time StataIC 13 is reopened on the Hive, the user must tell Stata how to access the previously installed packages by typing:
sysdir set PERSONAL “JStata 13ado”
———————————————— GAUSS learning ARCHIVE --------------------------------
JOSIM1.GAU is a GAUSS program that estimates a dynamic panel data model using several different methods.
JOSIM.OUT is the output from JOSIM1.GAU.
SEEDS.ASC contains the seeds used in the random number generator in JOSIM1.GAU.
PARMAT.ASC contains the parameter values used in the simulations in JOSIM1.GAU.
JOSIM2.GAU is a GAUSS program that compares GMM techniques for dynamic panel data models.
http://www.unc.edu/~jbhill/gauss archives code information.htm
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-5-29 02:15
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社