bipolate: A Stata Command for Bivariate Interpolation with Particular Application to 3D Graphing
Stata has a variety of flexible commands for graphing in two dimensions; however, it has few options for graphing in three dimensions. The user-written surface command by Adrian Mander, available from SSC, attempts to fill this gap, providing both 3D wire-frame plots and dropline plots. However, when some (x,y) combinations do not have a corresponding z-value, the graphs produced by surface are often unintelligible. SAS addresses this problem with PROC G3GRID, which creates a data set of interpolated values, providing a smooth surface plot when used as input for PROC G3D. The default method of interpolation used by PROC G3GRID was proposed by Hiroshi Akima in 1978. To reproduce this functionality in Stata, we used a publicly-available Fortran implementation of Akima’s method. We converted these Fortran subroutines into Mata and created the Stata command bipolate to interface with these subroutines. The bipolate command contains options for interpolating z-values at all possible combinations of the specified x- and y-values and for specifying specific (x,y) combinations at which to interpolate. There is also an option for handling multiple z-values for a given (x,y). Examples will be provided to illustrate the use of surface, with and without bipolate, and to illustrate various bipolate options.
Year of publication: |
2014-08-02
|
---|---|
Authors: | Canner, Joseph ; : Xuan Hui ; Schneider, Eric |
Institutions: | Stata User Group |
Saved in:
Saved in favorites
Similar items by person
-
Optimizing Stata for Analysis of Large Data Sets
Canner, Joseph, (2013)
-
Schneider, Eric B., (2023)
-
Real wages and the family : adjusting real wages to changing demography in pre-modern England
Schneider, Eric, (2012)
- More ...