help ihstrans

Title

ihstrans -- Generate inverse hyperbolic sine (IHS) transformed variables out of a list of multiple variables

Syntax

ihstrans
[varlist]
[if] [in]
[, options]

Main
keep(varlist) variables to keep from using

prefix(string) specifies the prefix for the newly generated variables; default is "ihs_"

casewise use casewise deletion to handle missing values

Description

ihstrans is a tool for inverse hyperbolic sine (IHS)-transformation of multiple variables.
The command can process multiple variables at once, and therefore can handle datasets that are in wide format and allows for setting casewise missings for observations.
The program automatically detects string variables and keeps them from transformation to avoid an abrupt ending.
Additionally, variables identifying panel and time within a panel dataset (see xtset) are also kept from the process of generating new variables.

Options

Main

keep(varlist) specifies the variables for which no transformation will be executed. By default, IHS-transformed derivatives of all non-string variables will be created.

prefix(string) specifies the prefix for the newly generated variables. By default, the string "ihs_" is placed in front of all variables set in varlist.

casewise handles missing values through listwise deletion, meaning that the entire observation is omitted from the estimation sample if any of the variables in varlist is missing for that observation.

Remarks

The transformation of variables is a common practice in statistics in general, and multiple regression analysis in particular.
When variables have at the same time extreme values as well as zeroes, the log-transformation, however, is not a convenient option, since log(0) is not defined.
The IHS-function is an appropriate alternative to log-transformation, since it is approximately equal to the logarithmic function, except that its domain is the entire real line and therefore it is defined at zero.
Due to these properties, using the IHS function is a proper form of transforming variables that have extreme values and zeroes at the same time (e.g. income or worth of owned property).
The IHS is defined as y=log(x+sqrt(x^2+1)) and the plotted function can be obtained with the following syntax: twoway function y=ln(x+sqrt(x^2+1)), range(-10 10) yline(0) xline(0).
For a more detailled discussion, see Burbidge et al. (1988).

Examples

1st example: IHS-transformation for all variables (except integer)

.sysuse auto, clear

.ihstrans

2nd example: IHS-transformation for selected variables, casewise missings

.sysuse auto, clear

.ihstrans price-trunk, keep(headroom) casewise

3rd example: IHS-transformation for specific sample

.sysuse xtline1, clear

.ihstrans if inlist(person,1,2) & tin(01jan2002, 31jan2002)

References

Burbidge, J. B., Magee, L., & Robb, A. L. (1988). Alternative transformations to handle extreme values of the dependent variable. Journal of the American Statistical Association, 83(401), 123-127.

Author

Jan Helmdag, Department of Political Science, University of Greifswald, Germany