Title
emh -- Extended Mantel-Haenszel Statistics
Syntax
emh var1 var2 [if] [in] [weight] [, options]
options Description ------------------------------------------------------------------------- Main strata(varlist) stratify on varlist correlation Correlation Statistic; the default anova ANOVA (Mean Scores) Statistic general General Association Statistic transformation(scoretype) use transformation scores, e.g., ranks ------------------------------------------------------------------------- by is allowed; see [D] by. fweights are allowed; see weight. Only one of correlation, anova and general is permitted at a time.
Description
emh calculates extended Mantel-Haenszel chi-square test statistics (also known as Cochran-Mantel-Haenszel Statistics) for stratified tables. Tables are defined by var1 and var2, both which must be numeric. Stratification is optional.
Options
+------+ ----+ Main +-------------------------------------------------------------
strata(varlist) specifies variables on which to stratify the analysis. Stratification variables may be numeric, string or a mix of the two.
correlation Correlation Statistic--tests for a linear association between var1 and var2. Suitable when both are at least ordinal.
anova ANOVA (Row Mean-score Differences) Statistic--tests for a difference in means of var1 between groups that are defined by var2. Suitable when var1, the response variable, is at least ordinal. var2, the predictor variable, may be nominal (unordered).
general General Association Statistic--most general form of association; of interest especially when both var1 and var2 are nominal.
transformation(scoretype) When correlation is specified, transforms both var1 and var2; when anova is specified, transforms the response variable (var1). This option is ignored when general is specified. Available scoretypes are table (untransformed--the default), integer, rank, ridit, modridit (standardized midranks), savage (Savage scores), mood (Mood scores), median (above or at-or-below median), vdw (van der Waerden scores) and klotz (Klotz scores).
Remarks
emh computes chi-square test statistics for association of row and column variables in unstratified or stratified tables. A good introduction to the use of these statistics is Chapters 2 through 7 of M. E. Stokes, C. S. Davis and G. G. Koch, Categorical Data Analysis Using the SAS(R) System Second Edition. Cary, North Carolina: SAS Institute, 2000.
emh uses tabulate internally. The number of levels of var1 and var2 are limited to what tabulate can accept. In order to accommodate an analysis with many levels of either or both of these variables, e.g., with continuous variables, matsize and memory might need to be set larger.
Computing extended Mantel-Haenszel statistics involves inverting a pooled covariance matrix. For some datasets, the matrix might be singular. When this occurs, a warning is displayed, and the chi-square statistic and associated p-value are set to missing. Such occurrences are more likely when requesting the General Association statistic for a dataset with many levels of row and column variables and with a substantial amount of missing data.
Some transformation types available in emh have an established use in unstratified two-group mean score-difference analysis, e.g., Mood test, van der Waerden test, Klotz test. Their use does not appear so well known in stratified analysis of multi-group (>2) datasets. In this context, such transformations might not display the desired sensitivity to location or scale difference. In general, users should exercise care in choosing whether and how to employ various scoring schemes.
Examples
. sysuse auto
. emh rep78 price, s(foreign)
Saved results
emh saves the following in r():
Scalars r(chi2) chi-square test statistic r(df) degrees of freedom for chi-square statistic r(p) p-value for reported chi-square statistic and degrees of freedom
Macros r(scoretype) short-name for score type, as specified in transformation(scoretype) r(ScoreType) formal name for score type, as displayed in output
Author
J. Coveney E-mail jcoveney@bigplanet.com if you observe any problems.
Also see
Help: [ST] epitab; vanelteren (if installed), somersd (if installed), [R] tabulate twoway