There are two ways to download and install the programs. You may let Stata do it for you (Option 1) or manually download and install the programs yourself (Option 2).
Option 1: Automatically download and install the programs and demo files.
(1) To begin the installation process, enter the following line into the Stata command window and execute it:
net install sfbook_install, from(http://homepage.ntu.edu.tw/~wangh/sfbook/) replace
This command will install the program sfbook_install on your computer, which is necessary for the subsequent step. You can type help sfbook_install after installation to view the options available for installation.
(2) Next, run the following command in Stata.
sfbook_install
This will install the necessary Stata programs (files with the .ado extension) into Stata's PLUS directory. It will also copy the demonstration files (files with the .do and .dta extensions) to c:\sfbook_demo for Windows users and /users/c(username)/sfbook_demo for Mac users. You can type help sfbook to read a brief description of the newly installed Stata commands.
If you wish to uninstall the programs, use the following commands.
To uninstall the sfbook_install program itself, type:
ado uninstall sfbook_install
To remove the Stata programs installed by sfbook_install, type:
ado uninstall sf_ado
Option 2: Manually download and install the programs and demo files.
Click to download Stata ado-files.
Click to download Stata demo do-files.
Click to download datasets used in the demo.
Installation of the ADO files: The ADO files contain the necessary Stata commands for estimating the stochastic frontier models discussed in the book. After downloading the zip folder containing the Stata ADO files (link provided above), unzip the folder and extract all contents. Save these files in a directory of your choice. Choose from one of the two options below.
System Directory (Recommended): If you choose one of Stata’s system directories for your files (you can view these directories by running the command adopath in Stata), the estimation commands will be automatically recognized by Stata.
Non-System Directory: If you choose a directory that is not a system directory (e.g., c:\myado\), you need to inform Stata of this location in your DO-file. At the beginning of your DO-file, add the following line:
adopath ++ c:\myado\
This line directs Stata to the new location where it can find the estimation commands.
March 13th, 2017: The code is updated to be fully compatible with recent versions of Stata (v12 and higher). Before the update, users have to declare -- version 10.1-- every time the estimation commands are used. After the update, the declaration is no longer needed. The updated programs do not work in earlier versions of Stata (v11 and earlier).
October 27th, 2019: A bug in the true random effect panel stochastic frontier model (e.g., Model 9 on chapter10_second_set_of_examples.do) is now fixed. Updated files include sfpan.ado, sfpredict_Cham.ado, sfpanel_Cham.ado, panel_Cham_new.ado, mle_Cham.ado, and ghquadm.ado. A few demo do-files also have minor updates.