%&latex
\documentclass[12pt]{article}

\usepackage{currfile}

\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage[normalem]{ulem}
\usepackage{pifont}
\usepackage{wasysym}
% float allows H for tables
\usepackage{float}

% comment out next command if you don't want sans serif font
%\renewcommand{\familydefault}{\sfdefault}

%%\graphicspath{ {N:\Private\ND\slong\final version\Paper/figures/} } 

\setcounter{MaxMatrixCols}{10}

% Line numbers
%%\usepackage{lineno}
%%\linenumbers

% page setup
\setcounter{topnumber}{1}
\renewcommand{\topfraction}{.99}
\setcounter{bottomnumber}{1}
\renewcommand{\bottomfraction}{.99}
\setcounter{totalnumber}{1}
\renewcommand{\textfraction}{.0}
\setlength{\parindent}{2em}

% wide margins
\setlength{\topmargin}{0.01in}
\setlength{\textwidth}{6.0in}
\setlength{\textheight}{8.25in}
\setlength{\oddsidemargin}{0.25in}
%NOT\ NEEDED\setlength{\evensidemargin}{0.25in}

% 1 inch margins
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\topmargin}{-0.5in}
\setlength{\textheight}{9.0in}

\raggedbottom

\usepackage{setspace}
\singlespacing
\doublespacing
\onehalfspacing

% ==============================================================================
% ==============================================================================
%

\begin{document}

\title{
\uline{Using predictions to compare groups in regression models for binary outcomes}%
    \footnote{We thank Long Doan, Trent Mize, Rich Williams, and an anonymous
    reviewer for their comments.}
}
%%Title 4: \uline{Using predictions to compare groups in nonlinear regression models}%
%%Title 2:\ \uline{Comparing groups in regression models for binary outcomes using predictions 
%%and marginal effects}%
%%Title 1: \uline{Comparing groups in binary regression models using 
%%predictions

\author{J. Scott Long\footnote{jslong@iu.edu,
Departments of Sociology \& Statistics,
Indiana University, Bloomington, IN 47401.}
\;and Sarah A. Mustillo\footnote{Sarah.A.Mustillo.5@nd.edu;
Department of Sociology, University of Notre Dame, Notre Dame, IN 46556.}
}
\date{ January 30, 2018 revision of SMR\  draft of June 6, 2017\\
} 


%The current file is: \currfilename  

%= HISTORY =======================================================================
\iffalse
\subsection{History}
\small
\begin{verbatim}
2015-09-04 start groups-draftV2-work.tex;
2015-10-28 return to paper groups-draftV2-work.tex;
2015-10-28:15-22 print draft;
2015-11-09 Major revision of theory;
2016-04-15 Refine theory;
2016-06-21 Restart to add new materials on location-scale and examples;
2016-06-22 Incomplete sections to groups-draftV2-inserts-starting
2016-06-22.tex copy to CME;
2016-06-27 Begin results;
2016-06-29 decomp added; draft of theory to Sarah'
2016-06-29 draft revised decomposition; revised to Sarah;
2016-08-07 start major revisions to results;
2016-08-10 location scale;
2016-08-17 work on merging/cleaning do-files; start parameters results;
2016-08-20 add intro to examples;
2016-08-22 revised on tables to mix DC and prob;
2016-09-06 in loc/scale results. Print draft to review;
2016-09-15 complete alpha1 revision; redefined sample to keep cases only missing
on arthritis.
2016-09-20 drop extra tables;
2016-09-21 finished revising example, not review math and do intro/abstract/conclusions.
2016-09-22 edit theory;
2016-09-23 alpha 2 done;
2016-09-28 partial revisions.
2016-10-09/10 decomp theory,
2016-10-10 alpha 3 part 1 completed;
2016-10-10 PART 2; v3 with new notation added A=1, B=0.; v4 make A=0, B=1;
2016-10-13 v5 complete pass with verification of Stata output;
2016-10-13 start alpha 4 to write abstract, front and conclusions.
2016-10-24 intro, abstract, conclusions
2016-10-26 proofing and tewaks; verify equaitons
2016-12-22 sam: groups-beta-draft1 2016-12-22.tex
2017-04-25 jsl: SLdraft2-pass1cleaned-2017-04-25.tex
2017-05-08 SLdraft2-pass2-start-2017-05-08V1.tex draft of review
2017-05-10 verification with tables using jsl-groups-diabetesV5d.do,
    jsl-groups-goodhlthV5d.do and jsl-groups-descriptiveV5d.do
2017-06-06 V6 do files and V7 data files; draft to send to SMR
2017-12-01 review SMR reviews
2018-01-21 start R and R revisions
2018-01-25 nearly done with draft for SAM
\end{verbatim}
\normalsize
\fi

%= END HISTORY ===================================================================

\maketitle


% ===========================================================================
%

\begin{abstract}
 Methods for group comparisons using predicted probabilities and marginal
 effects on probabilities are developed for regression models for binary
 outcomes. Unlike approaches based on the comparison of regression
 coefficients across groups, the methods we propose are unaffected by the
 identification of the coefficients and are expressed in the natural metric
 of the outcome probability. While we illustrate our approach using the
 logit model with two groups, we consider how our interpretive framework can
 be used with  a broad class of regression models and can be extended to any
 number of groups.
\\ \\ \\ \\ \\  
{\textbf{Note}: Substantive changes from the June 6, 2017 draft are underlined. Non-substantive,
editorial
changes have not been underlined.}
\\ \\  
\noindent
%%{\textbf{Note 2}: This draft does not include minor changes to the graphs and tables.}
\end{abstract}

\newpage

% ===========================================================================
%
\begin{center}
{\Large
{Using predictions to compare groups \\in regression models for binary outcomes}
}
\end{center}

% ===========================================================================
%
\section{Introduction
\label{groups-sec-intro}}

Regression models comparing groups are used in many areas of research to answer
two types of questions. First, do  groups differ in the level of the outcome
after adjusting for differences in observed characteristics? For example, do
white and nonwhite respondents have different probabilities of reporting good
health, controlling for age, income, education, and other characteristics?
Second, does the effect of a regressor on the outcome differ across groups? For
example, does obesity have the same effect on being diagnosed with diabetes for
white and nonwhite respondents?

To answer these questions, models are fit that allow the regression
coefficients to differ by group. To test if the coefficients are equal across
groups,  a Wald test is used \citep{Chow:1960}. For example, suppose
that we are considering the effect of $x_k$ on $y$ for white and nonwhite
respondents, where $\beta_{k}^{W}$ and $\beta_{k}^{N}$ are the coefficients of
interest. If $H_{0}$:\,$\beta_{k}^{W}\!=\!\beta_{k}^{N}$ is rejected, we
conclude that the effects differs across groups. While this approach can be used
with linear regression and some other models \citep{Liao:2002},
\cite{Allison:1999} shows that since the regression coefficients in binary logit
or probit are only identified to a scale factor,
standard tests of the equality of coefficients are invalid. He develops 
tests that address the identification problem by adding 
\uline{untestable, auxiliary assumptions} that the coefficients for some regressors
are equal across groups. While his test addresses the identification problem,
we believe that in
most applications it is substantively more useful to understand whether the
marginal effects of $x_k$ on the probability of the outcome are the same in both
groups than whether the regression coefficients for $x_k$ are equal. Critically,
in binary probit and logit, the equality of regression coefficients across
groups does not imply that the marginal effects of a regressor on the
probability are equal. In this paper, we develop methods for group comparisons
groups
using  tests of the equality of probabilities conditional on the regressors and
tests of the equality of marginal effects on the probability. Since
probabilities are identified, these tests do not require additional identifying
assumptions.

\uline{Our paper focuses on methods for comparing groups using the logit and
probit models for binary outcomes for several reasons. First, 
these are the most commonly used models for binary outcomes. Second, much of
the recent work on group comparisons has addressed the issue of how group
comparisons must deal with the scalar identification of the regression
coefficients in binary logit and probit. It is important to understand how
our approach is related to this work.
Our methods, however, can be generalized  to any regression model for which
it is possible to make conditional predictions and estimate marginal
effects.  In models where the regression coefficients are expressed in the
outcome metric of interest, such as linear regression or the linear
probability model, the regression coefficients are often the effects of
interest. In this case our approach is equivalent to testing the equality of
regression coefficients. However, even in linear models our approach is
necessary when there is a nonlinear relationship between a regressor and the
outcome. For example, in a linear regression model that includes age and
age-squared as regressors, the marginal effect of age is  computed using the
coefficients for both age and age-squared and the conclusions depend on the
values of regressors at which the test is made. Similarly, in any model in
which predictions can be made, our methods for comparing predictions and
marginal effects can be used. This includes models such as negative binomial
regression, ordered logistic regression, and
multinomial logit. With some adjustments, our approach can also be used with
non-parametric regression. Generalizations are considered in section
\ref{groups-sec-generalize}.
}

The substantive advantages of tests based on predicted probabilities are not
without costs. Tests comparing regression coefficients are simple to apply since
the only hypothesis of interest is whether the coefficients are equal
across groups and the results do not depend on the values of the
regressors in the model. For example, when examining racial differences in the
regression coefficient for  obesity on the onset of diabetes, 
the conclusion is
either that the  coefficients are the same or that they are not. With methods
based on probabilities, including marginal effects, the conclusions depend
on the  values of the regressors
where the comparison is made. For example, there might be no difference in the
probability of diabetes for nonwhites and whites who have low income and a high
school education, while the probabilities might differ for those with high
income and a college degree. Similarly, the size of the marginal effect of a
regressor on the outcome probability depends on the value of the regressor where
the effect is computed  as well as the values of all other variables in the
model  \citep{Long:2014a}. For example, the effect of 
obesity on diabetes for a
70-year-old, married man could be the same for both groups (i.e., the null
hypothesis is not rejected), while the  effect of obesity for a 50-year-old,
single women could be significantly larger  if the woman was white than if she
was nonwhite. While  conclusions about groups differences in the effect of
obesity on  diabetes are more complex than those from  testing
group difference in regression coefficients, they also have 
the potential to provide
more useful insights into the substantive process being studied.

The question of how to assess group differences in logit and other nonlinear
models has attracted considerable attention across many disciplines, both
directly in research
dealing with statistical methods for comparing groups and indirectly
in research about interactions in nonlinear models (e.g., 
\citealt{Ai:2003}, 
\citealt{Buis:2010},
\citealt{Kendler:2010},
\citealt{norton:2004}). 
This work shows that conventional techniques are flawed in several ways, 
with research focusing on two approaches to group comparisons.
One approach makes comparisons of regression coefficients that are in the 
metric of an underlying latent variable.
\cite{Allison:1999} shows that
group differences in unobserved heterogeneity invalidate traditional tests
for comparing regression coefficients across groups. \cite{Allison:1999} and
\cite{Williams:2009} developed new tests for comparing regression 
coefficients that account for differences in unobserved heterogeneity. 
\uline{\cite{Breen:2014} present methods for group comparisons of 
correlations between the latent outcome
and each regressor. Both the
Allison and Breen approach compare effects that are not in
the metric of the outcome probability.
\cite{Kuha:2018} argue that these methods  are only relevant when the
latent outcome is of substantive interest.}
A second approach compares groups in terms the probability or the odds of the outcome. 
\cite{Long:2005,Long:2009} 
used graphs to compare conditional probabilities and the effects of 
regressors across groups and provided tests
of the equality of probabilities across groups.
Other researchers considered the comparison of odds ratios and marginal
effects.
\cite{Mood:2010} reviews how unobserved heterogeneity affects the group comparison
of odds ratios and regression coefficients  and argues that marginal effects
of regressors on the probability are substantively more informative.
\cite{Landerman:2011} demonstrate how regression coefficients for interaction
terms in logistic models for panel data can provide misleading results about
group differences in rates of change in the outcome. They recommend comparing
group differences average marginal effects of regressors on the probability
of the outcome rather than the comparison of odds ratios.
\cite{Mustillo:2012c} develop tests for group differences in growth trajectories
in longitudinal mixed models for counts and argue that the interpretation 
of group-by-time interaction terms are misleading
and suggest the comparison of average marginal effects on the rate.


\uline{In this paper, we build on exiting research to  develop a general 
framework for the comparison of groups in regression models in
terms of the probability of the outcome and marginal effects of regressors
on the probability. Our predictive methods yield graphs and tables that can
answer substantively motivated questions about group differences.
Our methods  do not involve deriving new tests, but rather the use
of standard methods of specifying models, comparing predictions across
groups, and comparing marginal effects in ways that avoids traps of
misinterpretation common in the substantive literature.} 
The next section
explains how the identification of regression coefficients affects group
comparisons in the binary logit and probit models and how this issue is avoided
in methods based on predictions. Section 
\ref{groups-sec-theory-predictions} 
presents methods for comparing conditional predictions
and marginal effects. Each of these methods is illustrated in section
\ref{groups-sec-example} where we compare white and nonwhite respondents in
models predicting  being diagnosed with diabetes and reporting having good
health.
\uline{Section \ref{groups-sec-generalize}
discusses how our approach can be used with any regression  model in which
predictions and marginal effects can be computed and explains why it is
especially useful in models where the outcome has a nonlinear relationship
to regressors, including linear regression when nonlinearities are included
on the right hand side of
the model.}

% ===========================================================================
%
\section{Scalar identification in binary logit and probit
\label{groups-sec-theory-ident}}

The identification of regression coefficients is  critical for
understanding group comparisons in
logit and probit models. To explain this  we begin by
reviewing how coefficients are compared across groups in  linear
regression (\citealt{Chow:1960}). To simplify the presentation, we use two
groups with two regressors,
but the results can be easily generalized $G$ groups and $K$ regressors.
Let $y$ be a continuous, observed dependent
variable regressed on $x_1$
and $x_2$ for groups defined by  $g\!=\!0$ and $g\!=\!1$. We begin by fitting
separate
regressions  for each group which allows the regression
coefficients and error variances to differ by group:
%
\begin{eqnarray*}
    \text{Group 0:} &
        y=\beta_{0}^{0}+\beta_1^{0}x_1+\beta_2^{0}x_2
        + \varepsilon_0\
        \text{where \textit{Var}}\!\left(\varepsilon_0\right) =\sigma_0^{2}
    \\
    \text{Group 1:} &
        y=\beta_{0}^{1}+\beta_1^{1}x_1+\beta_2^{1}x_2
        + \varepsilon_1\
        \text{where \textit{Var}}\!\left(\varepsilon_1\right) =\sigma_1^{2}
\end{eqnarray*}
%
To assess whether the effect of  $x_k$ is the same for both groups,
we test
the hypothesis $H_{\beta_k}$:\,$\beta_k^{0}=\beta_k^{1}$ using a Wald or
likelihood ratio test. If $H_{\beta_k}$ is rejected, we conclude that the
effect of $x_k$  differs by group.

If $y$ is binary, the corresponding regression equations  are
%
\begin{eqnarray*}
    \text{Group 0:} &\Pr_0(y\!=\!1\mid x_1,x_2)
        = F(\beta_{0}^{0}+\beta_1^{0}x_1+\beta_2^{0}x_2)
\label{groups-eq-prbeta-A0}
    \\
    \text{Group 1:} &\Pr_1(y\!=\!1\mid x_1,x_2)
        = F(\beta_{0}^{1}+\beta_1^{1}x_1+\beta_2^{1}x_2)
\label{groups-eq-prbeta-A1}
\end{eqnarray*}
%
where $F$ is the normal cumulative density function for the probit model and
the logistic cumulative density function for the logit model.
While it  seems that we could assess whether the
effect of $x_k$ is the  same for both groups by testing
$H_{\beta_k}$:\,$\beta_k^{0}\!=\!\beta_k^{1}$, such tests are invalid since
regression coefficients in the binary regression model are
only identified up to a scale factor
(\citealt[1489]{Amemiya:1981}; \citealt[23]{Maddala:1983}; \citealt{McKelvey:1975}).
Following  \cite{Allison:1999}, this can be
shown  by deriving the  model using a latent dependent variable
$y^{\ast}$ that is  related to $x_1$ and $x_2$ through the equation
%
\begin{equation}
    y^{\ast }
    = \beta_{0}+\beta_1x_1+\beta_2x_2+\varepsilon
\label{groups-eq-ystar-beta}
\end{equation}
%
where the error $\varepsilon$ has mean $0$ and variance $\sigma ^{2}$.
When the latent $y^{\ast }$ is greater than $0$,
$y$ is observed as $1$; otherwise, $y$ is  $0$.
For example, if a person's  propensity  $y^{\ast}$ to have
diabetes exceeds $0$,
she is diagnosed with diabetes and $y\!=\!1$. If her propensity is at or
below $0$, she is not diagnosed with diabetes and $y\!=\!0$.%
\footnote{\uline{While the latent variable derivation of the logit and probit models
is compelling way to illustrate difficulties in comparing regression coefficients
across groups, the same problem arises when the model is
derived in other ways.}  (\citealt{Allison:1999}, 190; \citealt{Breen:2013}, 170).}

The probability that $y\!=\!1$ conditional on  $x_1$ and  $x_2$ is the
proportion of the distribution of $y^{\ast }$ that is greater than $0$:
%
\begin{equation*}
    \Pr \left( y\!=\!1\mid x_1,x_2 \right)
    = \Pr \left( y^{\ast }>0\mid x_1,x_2 \right)
\label{groups-eq-pr-ystargt0}
\end{equation*}
%
Substituting the right-hand-side of equation \ref{groups-eq-ystar-beta}
for $y^{*}$ and rearranging terms, the probability can be expressed in terms
of the error as
%
\begin{equation}
    \Pr\left(y\!=\!1\mid x_1,x_2 \right)
    = \Pr(\varepsilon \leq \beta_{0}+\beta_1x_1+\beta_2x_2 \mid x_1,x_2)
\label{groups-eq-pr-error-beta}
\end{equation}
%
For a model with a single regressor, figure  \ref{groups-fig-didactic-sd1}
shows that  the probability at specific values of $x$ is the
shaded area of the error distribution above $y^*\!=\!0$.
To compute this area we must know the mean, variance,
and  mathematical form of the error distribution.
The error is assumed to be logistic for logit and normal for probit.
As with the linear regression model, the mean is assumed to be 0.
The variance, however, leads to an identification problem for the $\beta$s.

\begin{center}--- Figures
\ref{groups-fig-didactic-sd1} and \ref{groups-fig-didactic-sd2}
here ---\end{center}

In linear regression the residuals $y_i-\widehat{y}_i$
are used to estimate the variance of the errors. This cannot be
done with logit or probit since $y_i^{\ast }$ is unobserved.
To understand the implications of this, consider what happens when we multiply
equation \ref{groups-eq-ystar-beta} by an arbitrary,
unknown constant $\delta$:
%
\begin{equation}
    \delta y^{\ast }
    = \left(\delta \beta_{0} \right)
    + \left(\delta \beta_1   \right) x_1
    + \left(\delta \beta_2   \right) x_2
    + \delta \varepsilon
\label{groups-eq-ystar-delta-beta}
\end{equation}
%
Using the notation $\gamma_k\equiv\delta\beta_k$,
$\widetilde{y}^{\ast}\equiv\delta {y}^{\ast}$,
and $\widetilde{\varepsilon}\equiv\delta\varepsilon$,
equation \ref{groups-eq-ystar-delta-beta} can be written as
%
\begin{equation}
    \widetilde{y}^{\ast}
    = \gamma_{0}+\gamma_1x_1
    + \gamma_2x_2
    + \widetilde{\varepsilon}
\label{groups-eq-ystar-gamma}
\end{equation}
%
and equation \ref{groups-eq-pr-error-beta} as
%
\begin{equation}
    \Pr(y\!=\!1\mid x_1,x_2 )
    = \Pr(\widetilde{\varepsilon }\leq \gamma_{0}
    + \gamma_1 x_1
    + \gamma_2 x_2 \mid x_1,x_2)
\label{groups-eq-pr-error-gamma}
\end{equation}
%
Since all that we did was  multiply both sides of the inequality by
$\delta $ and change notation, the probabilities in
equation \ref{groups-eq-pr-error-gamma} are \textit{exactly}
the same as those in equation \ref{groups-eq-pr-error-beta}.
However, since $\delta$ is unknown,
there is no way to distinguish between
the true  $\beta$ coefficients that generate $y^{\ast}$
and the rescaled $\gamma $ coefficients.
The effects of the change in scaling are shown
in figure \ref{groups-fig-didactic-sd2} that was created
by multiplying the equation for $y^*$ in figure \ref{groups-fig-didactic-sd1}
by $\delta\!=\!2$.
The intercept, slope, and standard deviation of the error
are $\delta$ times larger,
while  the probabilities represented by the shaded proportion of the error
distribution  are the same in both  figures.

Since the $\beta$ coefficients
are only identified to a scale factor, they cannot be estimated without
assuming a  value for the variance of the error.
For probit, the usual assumption is that $\sigma ^2_{\text{Assumed}}\!=\!1$,
which implies that
$\delta\!=\!\sigma_{\text{Assumed}} / \sigma\!=\!1 / \sigma$
in equation \ref{groups-eq-ystar-delta-beta}.
For logit, $\sigma^2_{\text{Assumed}}\!=\!\pi^{2}/3$,
which implies that $\delta\!=\!\pi / \sqrt{3}\sigma$.
Multiplying $y^*$ by $\delta$ rescales the $\beta$ coefficients
while  $\Pr(y\!=\!1\mid x_1,x_2 )$ is unaffected.
We cannot estimate the $\beta$s in
equation \ref{groups-eq-ystar-beta} since $\sigma$ is unknown, but we can
estimate the re-scaled
$\gamma$s in equation \ref{groups-eq-ystar-gamma} since the value of the
variance is assumed. The effect of the assumed value of the error  variance is
seen when you compare  results from logit and probit. The estimated coefficients
for logit are approximately  $\pi /\sqrt{3}$ times
larger than those from probit, while the predicted probabilities
are nearly identical.
The probabilities are not exactly the same and
the coefficients are not exactly $\pi /\sqrt{3}$
larger in logit since the shapes of the logistic and normal distributions
are slightly different (see \citealt[47-50]{Long:1997}).

The scalar identification of the regression coefficients
led \cite{Allison:1999} to conclude:
``Unless we are willing to assume that the [error] variance is constant
across groups, the standard tests for cross-group differences in
the [$\gamma$] coefficients tell us nothing about differences in the
[$\beta$] coefficients.''
To understand why  identification affects tests of the equality of coefficients,
consider the equations for $y^*$:
%
\begin{eqnarray}
    \text{Group 0:} &y^{\ast}
        = \beta_{0}^{0} + \beta_1^{0} x_1 + \beta_2^{0} x_2
        + \varepsilon_0\
      \text{where \textit{Var}}\left(\varepsilon_0\right)\!=\!\sigma_0^{2}
\label{groups-eq-ystar-A0}
    \\
    \text{Group 1:} & y^{\ast}
        = \beta_{0}^{1} + \beta_1^{1}x_1 + \beta_2^{1}x_2
        + \varepsilon_1\
        \text{where \textit{Var}}\left(\varepsilon_1 \right)\!=\!\sigma_1^{2}
\label{groups-eq-ystar-B1}
\end{eqnarray}
%
Since we cannot estimate the error variances, we assume
$\sigma^2_g\!=\!1$ for probit or $\sigma^2_g\!=\!\pi^2/3$ for logit.
This is done by multiplying equation \ref{groups-eq-ystar-A0}
by $\delta_1\!=\! \sigma_{\text{Assumed}}/\sigma _1$
and equation \ref{groups-eq-ystar-B1}
by $\delta_0\!=\!\sigma_{\text{Assumed}}/\sigma _0$:
%
\begin{eqnarray*}
    \text{Group 0:}&\,\delta_0 y^{\ast}
        = \left(\delta_0 \beta_0^0\right)
        + \left(\delta_0 \beta_1^0\right) x_1
        + \left(\delta_0 \beta_2^0\right) x_2
        + \delta_0\varepsilon_0\
        \text{where \textit{Var}}
        \left(\delta_0\varepsilon_0\right)\!=\!\sigma^2
    \\
    \text{Group 1:}&\delta_1 y^{\ast}
        = \left(\delta_1 \beta_0^1\right)
        + \left(\delta_1 \beta_1^1\right) x_1
        + \left(\delta_1 \beta_2^1\right) x_2
        + \delta_1\varepsilon_1\
        \text{where \textit{Var}}
        \left(\delta_1 \varepsilon_1\right)\!=\!\sigma^2
\end{eqnarray*}
%
Since $\delta_0$ and $\delta_1$ cannot be estimated, we rewrite
the equations in terms of the $\gamma$s which can be estimated:
%
\begin{eqnarray}
    \text{Group 0:}&\widetilde{y}^{\ast}_0
    = \gamma_0^0 + \gamma_1^0 x_1 + \gamma_2^0 x_2
    + \widetilde{\varepsilon}_0
    \ \text{where \textit{Var}}\left( \widetilde{\varepsilon }\right)
        \!=\!\sigma^2
\label{groups-eq-ytilda-A0}
\\
    \text{Group 1:}&\widetilde{y}^{\ast}_1
    = \gamma_{0}^1 + \gamma_1^1 x_1 + \gamma_2^1 x_2
    + \widetilde{\varepsilon}_1
    \ \text{where \textit{Var}}\left( \widetilde{\varepsilon }\right)
        \!=\!\sigma ^{2}
\label{groups-eq-ytilda-B1}
\end{eqnarray}
%
After estimation, we can test
$H_{\gamma_k}\!\text{:}\,\gamma_k^0\!=\!\gamma_k^1$ 
which is equivalent to testing
$H_{\gamma_k}\!\text{:}\,\delta^0\beta_k^0\!=\!\delta^1\beta_k^1$.
However, we want to test $H_{\beta_k}\!\text{:}\,\beta_k^0\!=\!\beta_k^1$ 
which requires knowing the relative size of the error variances
in the two groups.
The test proposed  by \cite{Allison:1999} obtains this information
by \textit{assuming} that $\beta^0_j\!=\!\beta^1_j$ for at least one regressor.
For example, if we assume that $\beta_j^{0}\!=\!\beta_j^{1}$, then
%
\begin{equation}
    \frac{\gamma_j^0}{\gamma_j^1}
    = \frac{\delta_0 \beta_j^0}{\delta_1\beta_j^1}
    = \frac{\left( \sigma_{\text{Assumed}}/\sigma_0\right) \beta_j^0}
           {\left( \sigma_{\text{Assumed}}/\sigma_1\right) \beta_j^1}
    = \frac{\sigma_1}{\sigma_0}
\label{groups-eq-ystar-ratio}
\end{equation}
%
is the relative magnitudes of the $\sigma_g$s.
As illustrated in section
\ref{groups-sec-example-scalarbetas}, the results of the test
for $H_{\beta_k}\!\text{:}\,\beta_k^0 \!=\!\beta_k^1$ depend
on which $\beta_j$s are assumed to be equal across groups, sometimes leading
to opposite conclusions.

Tests of the equality of probabilities or  marginal effects on the
probability do not require additional assumptions since identical
predictions are obtained  using  the $\beta $s
from equations \ref{groups-eq-ystar-A0} and \ref{groups-eq-ystar-B1}:
%
\begin{eqnarray*}
    \text{Group 0:}& \Pr_0 (y\!=\!1\mid x_1,x_2 )
    = \Pr_0 ({\varepsilon }\leq \beta_{0}^0
    + \beta_1^0 x_1
    + \beta_2^0 x_2
    \mid x_1,x_2)
\label{groups-eq-prtrue-A0}
\\
    \text{Group 1:}& \Pr_1 (y\!=\!1\mid x_1,x_2 )
    = \Pr_1 ({\varepsilon }\leq \beta_{0}^1
    + \beta_1^1 x_1
    + \beta_2^1 x_2
    \mid x_1,x_2 )
\label{groups-eq-prtrue-B1}
\end{eqnarray*}
%
or the $\gamma $s from equations \ref{groups-eq-ytilda-A0}
and \ref{groups-eq-ytilda-B1}:
%
\begin{eqnarray*}
    \text{Group 0:}
    & \Pr_0 (y\!=\!1\mid x_1,x_2 )
    = \Pr_0 (\widetilde{\varepsilon }\leq \gamma_{0}^0
    + \gamma_1^0 x_1 + \gamma_2^0 x_2
    \mid x_1,x_2)
\label{groups-eq-pr-A0}
\\
    \text{Group 1:}
    & \Pr_1 (y\!=\!1\mid x_1,x_2 )
    = \Pr_1 (\widetilde{\varepsilon }\leq \gamma_{0}^1
    + \gamma_1^1 x_1 + \gamma_2^1 x_2
    \mid x_1,x_2)
\label{groups-eq-pr-B1}
\end{eqnarray*}
%
While comparing groups % using probabilities or
using probabilities and marginal effects on probabilities does not required
the untestable, identification assumptions needed to test regression
coefficients, this is far from the only advantage. Conclusions about the
equality of regression coefficients in logit and probit are generally less
useful  than conclusions in the natural metric of probabilities, as they do
not represent the substantive size of the effect. For example, knowing
whether the effect of obesity on the probability of diabetes is the same for
for whites and nonwhites is more useful than knowing if the regression
coefficients, which in logit are in the metric of the  log odds of diabetes,
are the same.

% ===========================================================================
%
\section{Using probabilities to compare groups
\label{groups-sec-theory-predictions}}

Differences in the probability of the outcome and differences in the
marginal effects of regressors  on the probability emphasize
different ways in which groups can differ.
Probabilities show how outcomes differ under specific conditions.
For example, is diabetes more prevalent for obese men who are white than
those with similar characteristics who are nonwhite? This is illustrated  
across a range of ages by the two probability curves in 
figure \ref{groups-fig-probVeffect} \uline{where 
age and age-squared are included as regressors}  (discussed further in
section \ref{groups-sec-example}). The two-headed vertical arrow compares
the probability of diabetes for whites and nonwhites who are 75 years old.
Marginal effects examine whether a  regressor has the same effect on the
probability of the outcome for both groups. For example, does
obesity have the same health cost for whites as it does for
nonwhites?  The arrows show the change in
probability as age increases from 55 to 60 for each group.
While group differences in probabilities and group differences in marginal
effects on probabilities are related, you cannot draw
conclusions about one from the other. For example, being obese
could lead to a larger increase in the probability of diabetes for whites than
nonwhites even though the probability of diabetes is greater for nonwhites
than whites.

\begin{center}--- Figure
\ref{groups-fig-probVeffect}
here ---\end{center}

The next three subsections present  methods for testing group differences
in probabilities
and marginal effects. The following notation is used. The vector
$\mathbf{x}$ contains $K$ regressors with
the regression coefficients for group $g$ in the vector
$\boldsymbol \gamma^g$.
We use  $\gamma$s rather than $\beta$s since predictions
are made from the parameters that are estimated after identification
assumptions have been made.
\uline{We replace $\Pr_g(y\!=\!1\! \mid \!\mathbf{x})$ with the more
compact notation  $\pi(\mathbf{x},g)$:}
%
\begin{eqnarray}
    \text{Group 0:} &\pi(\mathbf{x},g=0)
        = F(\mathbf{x}' \boldsymbol \gamma ^0)
\label{groups-eq-prgamma0}
    \\
    \text{Group 1:} &\pi(\mathbf{x},g=1)
        = F(\mathbf{x}' \boldsymbol \gamma ^1)
\label{groups-eq-prgamma1}
\end{eqnarray}
%
\uline{where $F$ is the normal cumulative density function for the probit model and
the logistic cumulative density function for the logit model.}
Although estimating
models separately by group is conceptually appealing, we 
estimate the equations  for both groups
simultaneously which makes post-estimation computations simpler and is necessary
for obtaining  the correct standard errors when using a complex sampling
design \citep{West:2008}:
%%
[[PROVENANCE groups-covbetas-2017-05-05.do 2017-05-05]]
%%
\begin{equation}
    \pi\left(\mathbf{x},g\right)
    =
    F\left(
      \left[g \times\mathbf{x}' \boldsymbol \gamma ^1 \right]
    +
      \left[(1\!-\!g) \times\mathbf{x}' \boldsymbol \gamma ^0 \right]
    \right)
\label{groups-eq-group-interactiveform}
\end{equation}
%
In this model,   $\pi(\mathbf{x},g\!=\!0)\!=\!F(0+ \mathbf{x}' \boldsymbol\gamma^0)$
and $\pi(\mathbf{x},g\!=\!1)\!=\!F(\mathbf{x}' \boldsymbol\gamma^1+0)$.
While the same regressors are typically included for  both groups,
a regressor can be eliminated for one  group by constraining
$\gamma_k^g\!=\!0$.
Standard errors for predicted probabilities
and marginal effects on probabilities are computed with the delta method
(\citealt[72-77]{Agresti:2013}; \citealt[486-497]{Bishop:1975}).
% ===========================================================================
%
\subsection{Group comparisons of probabilities
\label{groups-sec-theory-probabilities}}

The most basic way to compare groups is to estimate probabilities
at the same  values of the regressors and test
if the predictions are equal. Let $\mathbf{x}^*$ contain  specific
values of the $x$s.
The difference between groups $0$ and $1$ in the probability at
$\mathbf{x}=\mathbf{x}^*$ is the \textit{group difference} 
in $\pi$:
%%\footnote{The group
%%difference in probabilities is the the discrete change with respect to group. 
%%We prefer the simpler, more informative terminology.}
%
\begin{equation}
    \frac{\Delta \pi( \mathbf x = \mathbf x^*) }
        {\Delta \,g }
    = \pi(\mathbf x = \mathbf x^*,g\!=\!1)
    - \pi(\mathbf x = \mathbf x^*,g\!=\!0)
\label{groups-eq-dcgroup}
\end{equation}
%
To test $H_0\text{:}\, \pi(\mathbf x\!=\!\mathbf x^*,g\!=\!0)
= \pi(\mathbf x\!=\!\mathbf x^*,g\!=\!1)$,
we can test if the group differences is 0.
{Note that the group
difference is simply  the discrete change with respect to group.%DROP $H_0\text{:}\, \Delta \pi( \mathbf x = \mathbf x^*)/ \Delta g=0.

Group differences in probabilities can be used in  a variety of ways. At the
most basic level, we can test whether whites and nonwhites differ in the
probability of diabetes. Adding a layer of complexity, we can test, for example,
whether  forty-year-old white men have the same probability of diabetes as
forty-year-old nonwhite men. Comparisons at multiple values of one or more
regressors can  be presented in tables. For example, racial differences in
diabetes could be shown for men and women  at different levels of education. For
continuous regressors, plots are more effective. For example, do nonwhites and
whites differ in the probability of diabetes as they age? These methods are
illustrated in sections \ref{groups-sec-example-prob-graphs} and 
\ref{groups-sec-example-prob-tables}.

\uline{While we find group differences in conditional probabilities 
to be the most useful way to compare groups, differences could be measured
in other ways. For example, in medicine and epidemiology, the relative risk
ratio (also called the adjusted
risk ratio) is often 
used  (\textbf{Greenland 198X}; \citealt{Bender:2010,Norton:2013}). 
Rather computing a \textit{difference} in conditional probabilities across
groups using equation \ref{groups-eq-dcgroup}, the adjusted risk
\textit{ratio} takes the ratio of probabilities, where the  the conditional
probability is referred to as the risk of the  event:}
%
\begin{equation*}
 \text{RRR} =
    \frac{\pi(\mathbf x = \mathbf x^*,g\!=\!1)}
         {\pi(\mathbf x = \mathbf x^*,g\!=\!0)}
\label{groups-eq-rrgroup}
\end{equation*}
%
\uline{If the two groups have the same risk of an outcome,  
then the {RRR} equals $$1 which corresponds to
a group difference of $$0. While we use group differences in the remainder of the
paper, our approach can be modified to use the adjusted risk ratio or any other
measure of group
differences in the probability of the outcome.}

% ===========================================================================
%
\subsection{Group comparisons of marginal effects
\label{groups-sec-theory-effects}}

The {marginal effect}  of $x_k$ is the change in the probability
of the outcome for a change in $x_{k}$, holding other variables at
specific values. There are two varieties of marginal effects. A
\textit{marginal change}, sometimes called a partial change,
is the change in the probability for an  infinitely small change in $x_k$.
A \textit{discrete change} or \textit{first difference} is the change
in the probability for a discrete or finite change in $x_{k}$.
\uline{In the following discussion, we focus  on discrete changes since we find
them to be more useful substantively, but our  methods
can also be used with marginal changes.}
The critical idea is that one variable is changing while other variables
are not.

For group $g$, the discrete change with respect to $x_k$ is
the change in the probability as $x_k$ changes from
\textit{start} to \textit{end} while holding other variables at specific values:
%
\begin{equation}
    \frac{\Delta\pi(\mathbf x \!=\! \mathbf x^*,g)}
         {\Delta x_k(\textit{start}\rightarrow \textit{end}\,) }
    =
    \pi(x_k\!=\!\textit{end}, \mathbf x \!=\! \mathbf x^*,g)
    -
    \pi(x_k\!=\!\textit{start}, \mathbf x \!=\! \mathbf x^*,g)
\label{groups-eq-effect-xk-dcbygroup}
\end{equation}
%
Vector $\mathbf{x}^{\ast}$ contains values for all regressors except $x_k$
whose value is determined by $\textit{start}$ and $\textit{end}$.
If the regressors includes polynomials or interactions, these
variables  change in tandem. For example, if
$x_{\text{agesq}}\!=\!x_{\text{age}}\!\times\!x_{\text{age}}$,
then  $x_{\text{agesq}}$ must change from $100$ to $121$
when $x_{\text{age}}$ changes from $10$ to $11$.

To compare effects across groups, the discrete change of $x_{k}$
is estimated for each group and we test if the effects are equal:
%
\begin{equation}
    H_{0}\text{: }
        \frac{\Delta \pi(\mathbf x \!=\! \mathbf x^*,g\!=\!1)}
        {\Delta x_k ( \textit{start}\rightarrow \textit{end}\,) }
    =
        \frac{\Delta\pi(\mathbf x \!=\! \mathbf x^*,g\!=\!0)}
        {\Delta x_k ( \textit{start}\rightarrow \textit{end}\,) }
\label{groups-eq-effect-xk-equal}
\end{equation}
%
Equivalently, we can estimate the \textit{group difference in discrete changes} with
respect to $x_k$, which is the second difference
%
\begin{eqnarray}
    \frac{\Delta ^2\pi(\mathbf x \!=\! \mathbf x^*) }
        {\Delta x_k (\textit{start}\rightarrow \textit{end}\,)\,
        \Delta \, g}
    =
    \frac{\Delta \pi( \mathbf x \!=\! \mathbf x^* ,g\!=\!1)}
        {\Delta x_k ( \textit{start}\rightarrow \textit{end}\,) }
    -
    \frac{\Delta \pi(\mathbf x \!=\! \mathbf x^*,g\!=\!0)}
        {\Delta x_k ( \textit{start}\rightarrow \textit{end}\,) }
\label{groups-eq-effect-xk-2nddif}
\end{eqnarray}
%
The hypothesis that the effect of $x_k$ is the same for both groups is
%
\begin{equation}
    H_0\text{: }
        \frac{\Delta ^2\pi( \mathbf x \!=\! \mathbf x^* ) }
        {\Delta x_k ( \textit{start}\rightarrow \textit{end}\,) \,
         \Delta \, g }
    = 0
\label{groups-eq-effect-xk-2nddif-ho}
\end{equation}
%

Since the value of the discrete change  of $x_k$ depends
on the values of the  regressors where the change is estimated  
\citep[244-246]{Long:2006},  a critical decision
is how to summarize the effect. Two approaches are commonly used. First, the
discrete change is estimated at representative values of the $x$s, referred
to as a discrete change at representative values (DCR). When means are used
as   the representative values, the effect is called the discrete change  at
the mean (DCM). Second, the average discrete change (ADC) is  the average of
the discrete changes computed conditionally on the observed values of the
$x$s for each observation. DCRs and ADCs  highlight different ways in which
groups can differ and the choice of which measure to use depends on your
substantive question. This issue is discussed in section 
\ref{groups-sec-theory-effects-adcVdcr} after we formally 
define these measures of discrete change.

% ===========================================================================
%
\subsection{Discrete change at representative values (DCR)
\label{groups-sec-theory-effects-dcr}}

A DCR is computed at values of the regressors that represent some aspect of
the sample that is of substantive interest. For group $g$ the discrete change
of $x_k$ evaluated at $\mathbf x \!=\! \mathbf x^*$ is
%
\begin{equation*}
    \frac{\Delta\pi(\mathbf x \!=\! \mathbf x^*,g)}
         {\Delta x_k(\textit{start}\rightarrow \textit{end}\,) }
    =
    \pi(x_k\!=\!\textit{end}, \mathbf x \!=\! \mathbf x^*,g)
    -
    \pi(x_k\!=\!\textit{start}, \mathbf x \!=\! \mathbf x^*,g)
\label{groups-eq-effect-xk-dcrbygroup}
\end{equation*}
%
For a continuous variable we  can compute the effect of changing  $x_k$
from any starting value to any ending value.
For example, we could increase $x_{k}$ from its mean to the
mean plus one standard deviation holding other variables at their means,
which is the discrete change at the mean (DCM). To compare
effects across groups we estimate
group differences in DCMs using equation \ref{groups-eq-effect-xk-2nddif}:
%
\begin{equation*}
    \frac{\Delta ^2\pi(\mathbf x \!=\! \overline{\mathbf x}) }
         {\Delta x_k (\overline{x}_k\rightarrow \overline{x}_k\!+\!s_{k}) \,
          \Delta \, g }
    =
    \frac{\Delta \pi(\mathbf x \!=\! \overline{\mathbf x},g\!=\!1)}
         {\Delta x_k (\overline{x}_k\rightarrow \overline{x}_k\!+\!s_{k}) }
    -
    \frac{\Delta \pi(\mathbf x \!=\! \overline{\mathbf x},g\!=\!0)}
        {\Delta x_k (\overline{x}_k\rightarrow \overline{x}_k\!+\!s_{k}) }
\end{equation*}
%
Or if $x_k$ is binary, the group  difference in the effect of $x_k$ when
$\mathbf x \!=\! \mathbf x^*$ is:
%
\begin{equation*}
    \frac{\Delta^2 \pi(\mathbf x \!=\! \mathbf x^*)}
         {\Delta x_k(0\rightarrow 1) \, \Delta \, g}
    =
    \frac{\Delta \pi(\mathbf x \!=\! \mathbf x^*,g\!=\!1)}
         {\Delta x_k(0\rightarrow 1)}
    -
    \frac{\Delta \pi(\mathbf x \!=\! \mathbf x^*,g\!=\!0)}
         {\Delta x_k(0\rightarrow 1)}
\end{equation*}
%
To test if the effects are the same in both groups, we  test if the group
difference in effects is 0. Since DCRs compare the  effect of a variable  at the
\textit{same} values of the regressors for both groups, they  do \textit{not}
reflect   group differences in the distribution of the regressors. This important
point is discussed in detail after we consider the ADC.

% ===========================================================================
%
\subsection{Average discrete change (ADC)
\label{groups-sec-theory-effects-adc}}

The average discrete change of $x_k$ is the average of the discrete
change of $x_k$ computed for each observation in a given group using the observed
values of the covariates.
Let $\pi(x_{ik},\mathbf{x}_i,g)$ be the probability  at the observed values
for the \(i^{th}\) observation in group $g$,
noting in particular the value of $x_k$.
For observation $i$ in group $g$, the discrete change of $x_k$ is
%
\begin{equation*}
    \frac{\Delta\pi(\mathbf x \!=\! \mathbf x_i,g )}
         {\Delta x_k (\textit{start}_i\rightarrow \textit{end}_i)}
    =
    \pi(x_{k}\!=\!\textit{end}_i , \mathbf x \!=\! \mathbf x_{i},g)
    -
    \pi(x_{k}\!=\!\textit{start}_i ,\mathbf x \!=\! \mathbf x_i,g)
\end{equation*}
%
The start and end values can be defined in a variety of ways. For a
continuous variable we might compute the effect
when $x_k$ increases by $\delta$ from its observed value $x_{ik}$:
%
\begin{equation*}
    \frac{\Delta\pi(\mathbf{x\!=\!x}_i ,g)}
    {\Delta x_{k} (x_{ik}\rightarrow x_{ik}\!+\!\delta ) }
    =
    \pi(x_k\!=\!x_{ik}\!+\!\delta ,\mathbf x \!=\! \mathbf x_i,g)
    -
    \pi(x_k\!=\!x_{ik},\mathbf x \!=\! \mathbf x_i,g)
\end{equation*}
%
While $\delta$ is often 1 or a standard deviation, other values
can be used. It is also possible to change $x_k$ between
the same two values for every
observation, such as increasing age from 60 to 65 or changing a binary variable
from 0 to 1. For group $g$,
%
\begin{equation*}
    \frac{\Delta\pi(\mathbf{x=x}_i,g)  }
         {\Delta x_k(\textit{start}\rightarrow \textit{end}\,) }
    =
    \pi(x_{k}\!=\!\textit{end} ,\mathbf x \!=\! \mathbf x_i,g)
    -
    \pi(x_{k}\!=\!\textit{start} ,\mathbf x \!=\! \mathbf x_i,g)
\end{equation*}
%
The values \textit{start} and \textit{end} do not need the subscript $i$
since they have the same
values for all observations. When $x_k$ is binary, the simpler notation
$\Delta\pi(\mathbf{x\!=\!x}_i,g) / \Delta x_k$ is used. For example,
the effect of being female is written as 
$\Delta\pi(\mathbf{x\!=\!x}_i,g) / \Delta  \textit{female}$. 
The ADC for $x_k$ in group $g$ is the average of the discrete changes for
each observation
in group~$g$:
%
\begin{equation*}
    \text{ADC}^g_{x_k}
    =
    \frac{1}{N_g}
    \sum_{i \in g}
    \frac{\Delta \pi(\mathbf{x\!=\!x}_i,g)}
         {\Delta x_k(\textit{start}_i\rightarrow \textit{end}_i)}
\label{groups-eq-effect-xk-adcbygroup}
\end{equation*}
%
Equations \ref{groups-eq-effect-xk-equal}-\ref{groups-eq-effect-xk-2nddif-ho}
are used to test if group differences in the ADC are significant.

% ===========================================================================
%
\subsection{Should you compare ADCs or DCRs?
\label{groups-sec-theory-effects-adcVdcr}}

\begin{center}--- Figure
\ref{groups-fig-didactic-ameVmem-youngW}
here ---\end{center}

The choice of whether to make group comparisons of ADCs or DCRs depends on
the  substantive question being asked. To illustrate what each measure of
change tells you, figure \ref{groups-fig-didactic-ameVmem-youngW} plots the
probability of diabetes by age for whites and nonwhites from a model with
age and age-squared. The squares are observations for the younger sample of
whites, while the cirlces are observations for the older sample of
nonwhites. For whites,
$\text{ADC}^W_\text{age}\!=\!.03$ which is the average change in the
probability  for each observations as age is increases by 5 from its
observed values. For nonwhites, $\text{ADC}^N_\text{age}$ is close to 0 since
the positive effects of age for those
younger than 72 are offset by the negative effects for those older than 72.
The  difference in the ADCs  across groups is due primarily to  group
differences in the distribution of age and mask the similar shapes of the
probability curves. In contrast, the DCRs computed at specific ages reflect
the similar
shapes of the curves.
At the mean  age of 60 for whites,
$\text{DCR}^W_\text{age}\!=\!.03$ and
$\text{DCR}^N_\text{age}\!=\!.04$; at the overall mean age of 67.5,
$\text{DCR}^W_\text{age}\!=\!.01$ and
$\text{DCR}^N_\text{age}\!=\!.02$; and at the mean age of 75 for  nonwhites,
$\text{DCR}^W_\text{age}\!=\!-.01$ and
$\text{DCR}^N_\text{age}\!=\!-.02$.
DCRs compare the shape of the probability curves at the same values of the
regressors, whiles ADCs  reflect both group differences in the curves and in
the distribution of regressors. In this example, the ADCs suggest that the
effect of age is larger for whites, yet the curves show that the rate of
change in the probability of diabetes is larger for nonwhites. Indeed,   two
groups can  have \textit{exactly} the same regression coefficients with
significantly different ADCs. Neither the ADC or the DCR is always better---
they simply reflect different ways in which effects differ across groups as
illustrated in section \ref{groups-sec-example}.

% ===========================================================================
%
\section{Example: Racial differences in health
\label{groups-sec-example}}

The analyses we use  to illustrate these techniques are based on research 
related to racial and ethnic differences, 
hereafter referred to as 
racial differences, in  diabetes risk and self-rated health. The literatures
on diabetes and self-reported health find strong, incontrovertible racial
differences in both outcomes with some evidence that these differences
decline with age (\citealt{Hummer:2004}, \citealt{Markides:1997}). Further,
it is well known that obesity and physical activity are  related to the 
risk for
diabetes, but it is less clear if these variables affect  racial differences.
There is some evidence that racial disparities in diabetes are higher for normal
and overweight individuals and lower among the obese, but
few studies have tested whether physical activity benefits one  group
more than another \citep{Zhang:2009}. Thus, we use  differences in 
probabilities to examine racial differences in diabetes and health by 
age. Then we compute differences in DCRs and ADCs to examine  racial
disparities in the effects of aging on diabetes,  
differences in the impact of physical activity on the probability of diabetes,
and whether racial differences in the  effect of physical activity vary over
the middle-to-late life course.

Our example uses data from the Health and Retirement Study (HRS), a
representative sample of older adults in the US \citep{HRS:2006}.\footnote{The
Health and Retirement Study is sponsored by the National Institute on Aging
(grant number NIA U01AG009740) and is conducted by the University of Michigan.
To access these data you must register with HRS. Our dataset was constructed
from the 2006 Fat file and version N of the RAND HRS file. The versions of these
files that are currently available for download could differ from those we used.
} Approximately 22,000 individuals and their spouses were
interviewed about every other year since 1992 using a multistage, clustered
probability sampling design that represents non-institutionalized individuals
age 50 or over in the 48 contiguous states, with an over-sampling of black and
hispanic Americans. Data from the 2006 wave of the HRS  were extracted from the
RAND HRS data files \citep{RAND:2014}. From the 16,955 respondents  who had non-
zero sampling weights, we excluded 10 respondents who were too young to be in
the sample, 380 who did not identify as white, black, or hispanic,  7 with
incomes greater than two million, 246 who did not report body mass, and 86 with
missing data for other variables in our analyses. The resulting sample includes
16,226 observations. 
%%
[[PROVENANCE groups-hrs-supportV9.do \#6.1 2018-01-29]] 
%%
Analyses were conducted with Stata 14.2 using adjustments for complex sampling
\citep{StataCorp:2015o}. Two-tailed tests are used in all analyses.
\uline{Analyses used Stata's \citep{StataCorp:2015-14} \texttt{margin}
command along with the  \texttt{SPost13} package \citep{Long:2014a}.
Similar features are being developed in R (Leeper, \citeyear{Leeper:2016}). 
The do-files construct our  analysis dataset and can
reproduce our analyses can  be obtained by running
the command \texttt{search groupsbrm} in Stata and following the instructions
for downloading files. Then, type \texttt{help groupsbrm} for details on
creating the dataset.}

\begin{center}--- Table
\ref{groups-tab-descriptive}
here ---\end{center}

Table \ref{groups-tab-descriptive} contains descriptive statistics for the
variables in our models. Our group variable is the race of the respondent,
comparing whites to nonwhites who include blacks and those of Hispanic
ethnicity. Other racial and ethnic groups were excluded due to  inadequate
representation in the HRS sample. Two outcome variables are used.
Self-rated health  recoded responses to  ``Would you say your
health is excellent, very good, good, fair, or poor?'' to equal 1  if
health was  good, very good, or excellent, else 0. Diabetes is a
respondent's self-report of whether diabetes was  diagnosed by a physician.
Independent variables include age, gender, education, income, marital
status, obesity, and physical activity. Education is measured as having a
high school degree or higher compared to not completing high school.
Income is  in thousands of dollars and an inverse hyperbolic sine
transformation is used to reduce the skew \citep{Burbidge:1988}. Physical
activity is measured as exercising more than three times a month compared
to  exercising less often. Following guidelines  by the US Centers for
Disease Control and Prevention (\citealt{Pi:1998}),
obesity is defined as having a body mass index  of 30 or more.

\begin{center}--- Tables
\ref{groups-tab-goodhlth-logit} and \ref{groups-tab-diabetes-logit}
here ---\end{center}

Tables \ref{groups-tab-goodhlth-logit} and \ref{groups-tab-diabetes-logit}
contain estimates of the regression coefficients from two models. \uline{We chose these two outcomes and specifications to
illustrates how our methods can be used to both when the relationship between
a regressor and the outcome is nearly linear and when a more complex
nonlinear relationships exists.} The model for
good health is simple to interpret since it does not include squared terms or 
interactions among regressors.
\uline{Since predicted probabilities are  between .65 and .85, 
the effect of age is almost linear which makes interpretation simple.} 
%%
[[PROVENANCE groups-goodhlthV9.do \#2.1.1 2018-01-29]]
%%

The model for diabetes includes  age-squared and
an interaction between the age variables and level of activity which makes
the interpretation more challenging, but is a more realistic modeling
scenario.
%%\uline{For diabetes,
%%the prevalence of diabetes increases with age between 50 and 75 before decrease
%%beyond 75.} 
Recall one of our
research questions is whether there are racial differences in the probability
of diabetes at different ages (e.g., are racial difference larger at younger
ages than older ages), whether there are racial differences in the effects of
growing older on the probability of diabetes, and whether racial differences in
the effects of growing  older on the probability of diabetes  vary by  level of
physical activity. 


Our analyses begin with
graphs to explore group differences in the outcomes by age. The discrete change
with respect to  race, referred to simply as the racial difference, is used to
test if  differences in the outcomes are statistically significant. Next, the
discrete change with respect to age is used to test if the effects of age
differ by race. Then we use graphs to examine the more complex example of  the
effects of age on diabetes for those with different levels of activity. Tables
are used to  examine racial differences in the effects of gender and obesity,
where  discrete changes for gender and obesity are compared across race
using second differences (i.e., racial differences in the discrete changes for
these regressors). Finally, racial differences in scalar measures of the effect
of a regressor are considered using discrete changes and  regression
coefficients.

% ===========================================================================
%
\subsection{Graphs of probabilities and group differences in probabilities
\label{groups-sec-example-prob-graphs}}

Graphs show both group differences in predictions
across values of a regressor and differences in how the effects of
a regressor vary by group. To explain this method of interpretation, 
we begin with a simple example showing how whites and
nonwhites differ in reporting good health at different ages. We then extend
this approach to a more complicated model for diabetes
that includes age and age-squared along with interactions between age and a
respondent's level of physical activity.

We know from table \ref{groups-tab-descriptive} that on average whites
report better health than nonwhites and now want to consider
whether racial disparities in health change with age.
For each group probabilities are computed at ages
from 50 to 90 with other variables held at their means.
Figure \ref{groups-fig-goodhlth-agePR} shows that while whites have a higher
probability of reporting good health at all ages,  differences steadily
decrease from  .10 at age 50 to less than .04 at 90.
%%
[[PROVENANCE groups-goodhlthV9.do \#2.1.1 2018-01-30]]
%%
Racial differences at each age are used to test
if these differences  in probabilities
are significant (see equation \ref{groups-eq-dcgroup}):
%
\begin{equation*}
    \frac{\Delta \pi(\text{age}\!=\!p,\mathbf x \!=\! \overline{\mathbf x})}
         {\Delta \,\text{white}}
\end{equation*}
%
Figure \ref{groups-fig-goodhlth-ageDC} plots these  differences in the
probability of good health along with the 95\% confidence interval.
When the confidence interval crosses 0, as it does around 85,
the difference between whites and nonwhites
in the probability of  good health is not significant.

\begin{center}--- Figures
\ref{groups-fig-goodhlth-agePR} and \ref{groups-fig-goodhlth-ageDC}
here ---\end{center}

Since the probabilities curves in figure \ref{groups-fig-goodhlth-agePR}
are nearly linear, the effects of age can be summarized by computing
the discrete change in the probability of good health
as age increase from 50 to 90 for each group $g$
(see equation \ref{groups-eq-effect-xk-dcbygroup}):
%
\begin{equation*}
    \frac{\Delta \pi(\text{white}\!=\!g,
          \mathbf x \!=\! \overline{\mathbf x} )  }
         {\Delta \text{age} ( 50\rightarrow 90 )  }
  =
    \pi(\text{age}\!=\!90,\mathbf x \!=\! \overline {\mathbf x},
            \text{white}\!=\!g )
  -
    \pi(\text{age}\!=\!50,\mathbf x \!=\! \overline {\mathbf x},
            \text{white}\!=\!g )
\end{equation*}
%
Group differences in the effect of age  are computed as a second difference
(see equation\,\ref{groups-eq-effect-xk-2nddif}):
%
\begin{equation}
    \frac{ \Delta \pi( \mathbf x \!=\! \overline{\mathbf x} ) }
         { \Delta \text{age} (50\rightarrow 90) \,\Delta \text{white} }
   =
    \frac{ \Delta \pi( \mathbf x \!=\! \overline{\mathbf x},
                       \text{white}\!=\!1 ) }
         { \Delta \text{age} (50\rightarrow 90) }
   -
    \frac{ \Delta \pi( \mathbf x \!=\! \overline{\mathbf x},
                       \text{white}\!=\!0 ) }
         { \Delta \text{age} (50\rightarrow 90) }
\label{groups-eq-effect-age-dcbygroup}
\end{equation}
%
Using these measures, we find that as age increases from 50 to 90 the probability
of good health decreases more rapidly for whites (.13)
than  than nonwhites (.07), but the difference is not significant ($p$=.17).
%%
[[PROVENANCE groups-goodhlthV9.do \#2.2.2 2018-01-30]]
%%
\uline{While figure \ref{groups-fig-goodhlth-ageDC} shows tests of  racial
difference in the probability of good health at each age, 
the discrete changes examine racial difference
in the effect of age on the
probability of good health.}

To illustrate how graphs can be used to examine more complex differences between
groups, figure \ref{groups-fig-diabetes-agePR} plots the
probability of diabetes by
age, where the  curves reflect the inclusion of age
and age-squared in the model. For both groups the
probability of diabetes increases from age 50 to 75 after which the probability
decreases. While whites have a smaller probability  of diabetes at all
ages, the difference is smallest at  50 where it is about .04,
increases to a maximum of .12 at  75, and then decreases to .08 at  90.
%%
[[PROVENANCE groups-diabetesV7.do \#2.1.1 2018-01-30]]
%%
This pattern of the racial differences is plotted  in figure 
\ref{groups-fig-diabetes-ageDC} which shows how differences 
increase from age 50 to 75
followed by a gradual decrease. Racial differences are significant at all
ages except  90 where the confidence interval includes 0.

\begin{center}--- Figures
\ref{groups-fig-diabetes-agePR} and \ref{groups-fig-diabetes-ageDC}
here ---\end{center}

The change in the size of the effect of race over  age occurs because the
rate of increase in diabetes  is larger
for \mbox{nonwhites} than whites from ages 50 to 75  at which point the rate of
decrease with age is more rapid for nonwhites.
To test this formally, we compute the discrete change for
age for each group and test if they are equal
(see equation\,\ref{groups-eq-effect-xk-2nddif}).
%%
[[PROVENANCE groups-diabetesV7.do \#2.2 2018-01-30]]
%%
From 50 to 60 diabetes increases by .11 for nonwhites compared
to .06 for whites, a significant difference of .05 ($p$=.01).
From 80 to 90 the probability
decreased by .05 for whites and .09 for nonwhites, a difference that
is not significant ($p$=.27).

\begin{center}--- Figure
\ref{groups-fig-diabetes-ageactivePR}
here ---\end{center}

Using graphs to examine group differences over the range
of a continuous regressor can be extended to show the effects of other
variables. Returning to our research questions, suppose   we want to determine
whether
 the racial differences
in diabetes that we found in figure \ref{groups-fig-diabetes-agePR}
vary by a person's level of physical activity.
Or, to put it another way, are the benefits of physical  
activity different for nonwhites
and whites  over the life  course? This is an example of both the complexity
and the advantages of our approach to interpretation. It is not straightforward
to find the most effective way to visualize how group differences in an outcome over
age vary by the levels of another variable, yet doing
so allows us to test more complex hypotheses than traditional methods.  
The first step is to graph the probability
of diabetes for whites and nonwhites by level of activity. This is done
in figure \ref{groups-fig-diabetes-ageactivePR} where open circles represent
nonwhites who are inactive with solid circles for those who are active.
Similarly, inactive and active whites are represented by open and solid squares.
While the graph contains all of the information that we need for
our research question,
the trends are difficult to see due to the complexity of the graph.
A more effective approach is to create plots that show 
differences between the probability curves.
There are two ways that we can proceed that emphasize different aspects of
our research question. First, we can examine racial differences in diabetes
over age conditional on level of activity by  plotting the
difference between the  probability curves for whites and nonwhites for those
who are active (solid circles and squares) and for those who are inactive
(hollow circles and squares).
Second, we can examine the
effects of activity by plotting the discrete change of activity by race, which
is the difference between the curves for whites (solid and open squares)
and the curves for nonwhites (solid and open circles).

\begin{center}--- Figure
\ref{groups-fig-diabetes-ageactiveDCrace}
here  ---\end{center}

Figure \ref{groups-fig-diabetes-ageactiveDCrace}
plots 
\mbox{$\Delta \pi(\text{age}\!=\!p, \text{active}\!=\!q,
\mathbf x \!=\! \overline{\mathbf x}) / \Delta \text{white}$}
(see equation \ref{groups-eq-dcgroup}), which is the 
racial difference in the probability of diabetes by level
of activity over age.
Since adding confidence intervals to the figure leads to overlapping
lines that are confusing,  a dashed line is used to indicate when a difference
is \textit{not} significant. The graph shows that while the  benefits of being white
occur both for those who have an active lifestyle and those who do not, the
strength and timing of the benefits differ by the level of activity. For those
who are not active (open diamonds), the advantages for whites increase from age
50 to 70 before decreasing thereafter. Differences are significant at all ages
except 90. For those who are active (solid diamonds), the same  pattern occurs,
but the effects are weaker at younger ages than they are for  those who are
inactive. The differences increase from age 50 to 80, becoming statistically
significant at age 57. At age 80 the differences begin  to decrease and are no
longer significant.

\begin{center}--- Figure
\ref{groups-fig-diabetes-ageactiveDCactive}
here ---\end{center}

Figure \ref{groups-fig-diabetes-ageactiveDCactive}
re-expresses the information from  figure \ref{groups-fig-diabetes-ageactivePR}
to focus on the effects of activity for each group.
While being active benefits members of both groups, the benefits occur differently
for whites and nonwhites.
For whites (open triangles) the protective effect of activity is smaller (i.e.,
less negative) at younger ages
and increases in magnitude until age 90. For nonwhites (solid triangles), the
effect gets stronger from age 50 to 60 before decreasing till age 90;
after age 76 the effects are not significant.
Tests of racial differences in the effect of activity
are significant at the .10 level between
ages 55 and 61, reach significance at the .05 level at age 58 where the difference
reaches its maximum of .044,   and are not significant at other ages.
%%
[[PROVENANCE groups-diabetesV7.do \#2.3sup 2018-01-30]]
%%

Finally, another way to think of the effects of race and activity  is to
note that the health deficit for being nonwhite is roughly equal
to the benefits of being active. This is seen in
figure \ref{groups-fig-diabetes-ageactivePR} by comparing the line for inactive
whites (hollow squares) and active nonwhites (solid circles). The probabilities
differ by  -.01 at age 50 with a maximum of .05 at age 75, but none of the differences
are  significant.
%%
[[PROVENANCE groups-diabetesV7.do \#2.4sup 2017-05-10 - supplemental results]]
%%

% ===========================================================================
%
\subsection{Tables of probabilities and group differences
in probabilities
\label{groups-sec-example-prob-tables}}


\medskip
\begin{center}--- Table
\ref{groups-tab-diabetes-obesegender}
here ---\end{center}

Tables are an effective way to show how probabilities vary over categories
of a few regressors. Suppose that we are interested in whether 
racial differences in diabetes vary by gender and obesity, 
with a focus on the adverse effects
of obesity.
One way to approach this is to compute the probability of
diabetes conditional on all combinations of race, gender, and obesity, holding
other variables at their means. These probabilities are presented in
\uline{rows 1 and 2} of columns 1 through 4 in table \ref{groups-tab-diabetes-obesegender}.
The last row shows racial differences in the probabilities of diabetes (see equation \ref{groups-eq-dcgroup}):
%
\begin{equation*}
    \frac{\Delta \pi(\text{female}=p, \text{obese}=q,
                     \mathbf x \!=\! \overline{\mathbf x}) }
         {\Delta\,\text{white} }
\end{equation*}
%
In the rest of this section, we exclude
$\mathbf x \!=\! \overline{\mathbf x}$ from $\pi()$ to simplify the
notation. 
While we are holding other variables at the mean, these variables could
be held at other values.
 
The probabilities of whites being diagnosed with diabetes are smaller than those
for nonwhites for all combinations
of obesity and gender. The largest racial differences, \uline{shown in row 3},  is $-.126$ for
women who are not obese and the smallest, nonsignificant  difference
is $-.044$ for obese men.
We can test whether the racial differences for men and women are of equal size
for a given level of obesity
by estimating a second differences (see equation \ref{groups-eq-effect-xk-2nddif}):
%
\begin{equation*}
    \frac{ \Delta \pi(\text{obese}=q) }
         { \Delta \text{female} \,\, \Delta \text{white} }
  =
    \frac{ \Delta \pi(\text{female}=1,\text{obese}=q) }
         { \Delta \,\text{white} }
  -
    \frac{ \Delta \pi(\text{female}=0,\text{obese}=q) }
         { \Delta \,\text{white} }
\end{equation*}
%
Computing these differences, which are not included in the table, we find 
that the effect of race for obese men and women differ by 
\uline{$-.068=(-.112--.044)$}
which is significant at the .02 level. For those who are not obese, the
gender difference is smaller and not significant ($p\!=\!.13$).
%%
[[PROVENANCE groups-diabetesV7.do \#3.2a 2018-01-30]]
%%

Next, we consider the effects of obesity on diabetes.
The probabilities \uline{in rows 1 and 2} of the first four columns show that being obese
is associated with a higher incidence of diabetes.
To formalize these findings, we estimate
the discrete change of obesity conditional on gender and race holding other
variables at their means
(see \mbox{equation \ref{groups-eq-effect-xk-dcbygroup}):}
%
\begin{equation*}
    \frac{\Delta \pi(\text{female}=p,\text{white}=r ) }
         {\Delta \,\text{obese} }
\end{equation*}
%
These effects,  presented \uline{in rows 1 and 2} of columns 5 and 6,  show that obesity
significantly increases the probability of diabetes by about $.16$ for all
groups except white men where the effect is  $.21$.
To test if there are racial differences in the  effects of obesity, we estimate
second differences (see equation \ref{groups-eq-effect-xk-2nddif}):
%
\begin{equation*}
    \frac{ \Delta \pi(\text{female}=p) }
         { \Delta \,\text{obese\,} \, \Delta \,\text{white} }
  =
    \frac{ \Delta \pi(\text{female}=p,\text{white}=1) }
         { \Delta \,\text{obese} }
  -
    \frac{ \Delta \pi(\text{female}=p,\text{white}=0) }
         { \Delta \,\text{obese} }
\end{equation*}
%
The results, shown in the last row of columns 5 and 6, indicate that racial
differences in the effects of obesity are small and not significant for
women, but larger and marginally significant for men ($p\!=\!.09$). To test
whether the effect of obesity is the same for men and women, we estimate the
second differences  with respect to gender, which are
shown in \uline{rows 1 and 2} of column~7:
%
\begin{equation*}
    \frac{ \Delta \pi(\text{white}=r) }
         { \Delta \,\text{obese} \,\, \Delta \,\text{female} }
   =
    \frac{ \Delta \pi(\text{female}=1,\text{white}=r) }
         { \Delta \, \text{obese} }
   -
    \frac{ \Delta \pi(\text{female}=0,\text{white}=r) }
         { \Delta \,\text{obese} }
\end{equation*}
%
\uline{The effect of obesity for whites is $.04$ larger ($p\!<\!.001$) for  
men than  women, but the gender difference is small and nonsignificant
for nonwhite respondents.}

The idea of a second difference can be extended to compare any two effects,
such as whether the effect of obesity is the same for white men and nonwhite
women:
%
\begin{equation*}
    \frac{ \Delta \pi(\text{female}=0,\text{white}=1) }
         { \Delta \,\text{obese} }
   -
    \frac{ \Delta \pi(\text{female}=0,\text{white}=0 ) }
         { \Delta \,\text{obese} }
\end{equation*}
%
or to test the hypothesis that the effects for 
all combinations of gender and race are equal:
%
\begin{multline*}
    H_0\text{:\,}
    \frac{ \Delta \pi(\text{female}=0,\text{white}=0) }
         { \Delta \,\text{obese} }
   =
    \frac{ \Delta \pi(\text{female}=0,\text{white}=1) }
         { \Delta \,\text{obese} }
\\
   =
    \frac{ \Delta \pi(\text{female}=1,\text{white}=0) }
         { \Delta \,\text{obese} }
   =
    \frac{ \Delta \pi( \text{female}=1,\text{white}=1) }
         { \Delta \,\text{obese} }
\end{multline*}
%
which is rejected at the $.001$ level.
%%
[[PROVENANCE groups-diabetesV7.do \#3.3a 2018-01-30]]
%%

In table \ref{groups-tab-diabetes-obesegender} the effects of obesity were
computed for each combination of race and gender holding other variables
at their means. 
While this allows us to make comparisons where only race and
gender change, is it reasonable to estimate effects for each group at the overall
means when table \ref{groups-tab-descriptive} shows significant
racial differences in the distribution of the regressors?
An alternative approach that reflects group differences in the distribution
of regressors is to compare the ADC of obesity for each group defined by 
race and gender. 
ADCs reflect group differences in the regressors, but do not
show whether the effects of obesity are similar
across groups  for individuals with the same characteristics 
(see section \ref{groups-sec-theory-effects-adcVdcr}).
Another approach is to compare the effects for each group holding other
variables at the means specific to each group (see \citealt{Long:2014a} for
a  discussion of local means). The most effective approach for comparing
effects depends on the specific questions motivating the research.

% ===========================================================================
%
\subsection{Comparing summary measures of effect
\label{groups-sec-example-scalareffects}}

The methods in the last two sections showed how to use predictions and
marginal effects to address specific questions  motivating one's researcher.
In this section we consider methods for summarizing the effect of each
regressor across groups. These measures are the counterpart to regression
coefficients that are routinely  used in linear regression to summarize the
effect of each variable, assuming there are no polynomial terms. In  logit
and probit  there are several measures that should be considered and some
that should be avoided. We begin by   comparing marginal effects across
groups using discrete changes, which we believe is the most generally useful
approach. Next we examine methods based on the comparison of the regression
coefficients and illustrate their limitations.

% ===========================================================================
%
\subsubsection{Comparing marginal effects
\label{groups-sec-example-scalarDC}}

\smallskip
\begin{center}--- Table
\ref{groups-tab-diabetes-dcsummary}
here  ---\end{center}

The discrete change at the mean
(see equation \ref{groups-eq-effect-xk-dcrbygroup}) and
the average discrete change (see equation \ref{groups-eq-effect-xk-adcbygroup})
are standard measures of the effect of a
variable.\footnote{While marginal change showing
the instantaneous rate of change in the probability can also be used, we
prefer the discrete change because of its simpler 
interpretation. \uline{If the probability curve
is being evaluated in a region that is approximately linear for a unit
change in the regressor, the marginal change  will approximate a discrete
change of one.}} Table \ref{groups-tab-diabetes-dcsummary} contains
estimates for both measures along  with racial differences in the effects
(see equation \ref{groups-eq-effect-xk-2nddif}) and $p$-values from testing
whether the effects are equal. Consider the ADC of being female from panel~1
of the table. On average being female significantly decreases the
probability of diabetes by $.051$ ($p\!<\!.001$) for white respondents, with
a decrease to .015 ($p\!<\!.001$) for nonwhites. As shown in columns 5 and
6, these effects differ by .036, which is significant at the .10 level but
not the .05 level. The results using the discrete change at the mean from
panel B are nearly identical. The ADC and DCM do not always lead to the same
conclusions as illustrated by the effect of a five-year increase in age.
Using the ADC, we conclude that the average  effect of age is significantly
larger for nonwhites than whites ($p$=.002). Using the DCM, we  conclude
that for an average respondent the effect of age does not differ for whites
and nonwhites ($p$=.169). As discussed in section 
\ref{groups-sec-theory-effects-adcVdcr}, 
conclusions based on  ADCs and DCRs can be quite different
depending on the model specification and group differences in the
distribution of regressors. The ``best'' measure is the one that
characterizes that aspect of groups differences that are of greatest
substantive interest. In our experience, it is useful to compute both the
DCM and the ADC. If your conclusions differ depending which measure you use,
determine why the measures differ before using either  and then decide which
best answers your research question.

% ===========================================================================
%
\subsubsection{Comparing regression coefficients
\label{groups-sec-example-scalarbetas}}

Given the complexities of summarizing the effects of regressors using marginal
effects on the probability, tests of the equality of  the regression
coefficients are appealing in their simplicity.
While such tests are often used, there are several issues to consider.
First, regression coefficients are in a metric that is not as substantively
useful as probabilities. Comparing the
effects of $x_k$ on $y^{\ast}$ or on the log-odds is rarely as useful as comparing
how a regressor affects the probability. Second, while odds ratios are
in a more natural metric than the log-odds or $y^{\ast}$, 
odds ratios can be especially misleading in group comparisons.
If the odds ratio for $x_k$ is identical for both groups, the effect of $x_k$
on the probability can be very different in the two groups. 
For example, consider probabilities of the outcome for two groups at two values
of regressor $x_1$:

\smallskip
\smallskip
\begin{tabular}{llllllllll}
&&&&&   $\pi(x_1=0,g=1)=.2$       &&&     $\pi(x_1=0,g=0)=.010$ \\
&&&&&   $\pi(x_1=1,g=1)=.4$       &&&     $\pi(x_1=1,g=0)=.026$ 
\end{tabular}
\smallskip
\smallskip

\noindent
For group 1, the discrete change of $x_1$ is $.2\!=\!.4-.2$ with an odds ratio
for $x_1$ of $2.67\!=\!(.4/.6)/(.2/.8).$ For group 0,
the discrete change  is $.016\!=\!.026-.010$ with an odds ratio of
$2.64\!=\!(.026/.974)/(.01/.99)$. Even though $x_1$ has a far 
bigger impact on the probability of $y$ for group 1 than
group 0 (.2 versus .016), the odds ratios are nearly identical for both groups.
%%DROP $2.67\!=\!\frac{.4/.6}{.2/.8}$ 
Third, if the models includes
interactions or polynomials, there is no simple way to express the total
effect of those variables in using regression coefficients  or odds ratios,
while marginal effects on the probability can be computed that simultaneously
to take into account all of the coefficients  
that include the variable. For example,  the marginal effect
of age simultaneously accounts  for changes in age
and age-squared. Finally, even if these issues  are not a concern in your
 application, you must deal with the scalar identification of
regression coefficients, which we referred to earlier . To illustrate
this important issue, we consider alternative tests of the hypothesis
that the regression coefficients
for gender and obesity are equal for whites and nonwhites.

Columns 9 and 10 of  table \ref{groups-tab-diabetes-logit} contain 
results from standard Wald tests of
$H_0\text{:}\,\beta^{\text{W}}_k\!=\!\beta^{\text{N}}_k$.
If these tests were appropriate, which they are not due to the scalar identification
of the coefficients, we would
conclude that the protective effects of being
female are significantly larger for whites than nonwhites ($p\!<\!.01$)
and that the health costs of obesity are significantly greater
for whites than nonwhites ($p\!<\!.01$). This contradicts our conclusions
using discrete changes in table \ref{groups-tab-diabetes-dcsummary}.
The ADC for obesity is .022 larger for whites than nonwhites, but the
difference is not significant ($p\!=\!.41$); similarly the DCM is .032
larger for whites  ($p\!=\!.26$).
The ADC and DCM for being female are  about .04 less negative for nonwhites
than whites, but the differences are not significant ($p\!=\!.09$; $p\!=\!.07$).

\cite{Allison:1999} showed that standard tests comparing regression
coefficients across groups confound groups differences in the coefficients
with groups differences in residual variation
(see section \ref{groups-sec-theory-ident}).
He proposed a test of the equality of coefficients across groups
that is unaffected by group differences in unobserved heterogeneity. This is
accomplished by assuming that the regression coefficients
for one or more regressors are equal across groups
(see equation \ref{groups-eq-ystar-ratio}).
While assuming the equality of regression coefficients across groups 
deals with the problem caused by the scalar identification
of the coefficients, the results of the test depend on which variables are
assumed to have equal effects. 
To illustrate this, we test 
\uline{the racial equality of} 
regression coefficients for gender and obesity using 
\uline{three models that differ by}
which coefficients are assumed to be equal across groups.

\begin{center}--- Table
\ref{groups-tab-diabetes-allisontest}
here ---\end{center}

In model $M_1$ the coefficients for
\textit{ihsincome} are constrained to be equal;
in $M_2$ all coefficients that
include \textit{age} or \textit{active} are constrained 
\uline{(both \textit{age} and \textit{active}
are constrained due to the \textit{age} by \textit{active} interaction)}; and in
$M_3$ the coefficients for \textit{obese} are constrained. Models in which
the regression coefficients for being female, graduating from high school,
or being married were constrained  did not converge.
The results are shown in table \ref{groups-tab-diabetes-allisontest}.
Racial differences in the regression coefficients for \textit{female}
are significant ($p=.013$) when constraints are imposed on coefficients
involving either \textit{age} or \textit{active}, but not when
constraints are imposed on the coefficients
for \textit{ihsincome} ($p\!=\!.164$) or \textit{obese} ($p\!=\!.120$).
The regression coefficients for \textit{obese} are similar in 
magnitude and not significantly
different ($p\!=\!.810$) when the coefficients for \textit{ihsincome}
are constrained in $M_1$, but the difference is larger and marginally significant
($p\!=\!.064$) in $M_2$ when the coefficients for  \textit{age}
and \textit{active} are constrained.

Even though conclusions from the tests
vary depending on which coefficients are assumed to be equal across groups,
when a single pair of coefficients are constrained to be equal, such as $M_1$
and $M_3$, the predicted
probabilities and marginal effects are \textit{exactly} equal to those from
the full model. \uline{That is, the models are empirically indistinguishable.} 
\cite{Williams:2009} showed that Allison's test can be
computed using the heterogeneous choice model, also know as the location scale
model. A heterogeneous choice model predicting the variance of the error
for each group using  a single equality constraint on the coefficients 
for the regressors is simply a reparameterization of the
model without constraints in coefficients that assumes unobserved heterogeneity
is equal for both groups. When multiple constraints are imposed as in $M_2$,
the predictions have a correlation of .999 with the full model.
Williams (2009) showed that Allison's approach
to allow group differences in unobserved heterogeneity can be extended by allowing
regressors beyond group membership to predict the variance of the errors.
When we attempted Williams' procedure
using different sets of covariates, many models did not converge and the
interpretation of the coefficients of those that did converge 
changed based upon the identifying assumptions made.

Allison's approach deals with the residual variation issue by allowing error
variances to differ by group but requires assuming that the effects of at least
one regressor are the same across groups. While decisions about which coefficients
to constrain can affect the substantive conclusions, \uline{past research or
substantive theory is unlikely to provide insights into which constraints
should be used and there is no statistical test to help you decide  which coefficients  
should be assumed to be equal.}
Making an \textit{ad hoc} decision that some
regression coefficients are equal can lead to incorrect conclusions.
In our applications,
we did not have substantive reasons to constrain particular coefficients and
tried multiple specifications
that lead to substantively quite different conclusions.
The risk of specifying the inappropriate identifying assumptions does not exist
at the level of the probabilities.
More importantly from our perspective, tests of the equality
of effects across groups are most useful when those effects are measured in
the metric of the probability of the outcome.

% ===========================================================================
%
\section{Generalizations to other regression models
\label{groups-sec-generalize}}

\uline{While our paper focuses comparing groups  using 
the binary logit and probit models, our methods can be used with any regression
model where  predictions and marginal
effects can be estimated along with standard errors.
For example,
in models for categorical outcomes with more than two categories, our methods
can be used for the probability of each outcome. 
In models where the regression coefficients are the effects of interests,
such as the linear probability model where the coefficients equal
discrete changes for a unit increase in the regressor, our methods are equivalent
to those obtained by testing the equality of regression  coefficients. In linear models
where nonlinearities
are introduced  by transformations of the dependent variable (e.g.,
$ln y$) or by polynomials or interactions among the regressors, our approach provides insights that go
beyond those provided by tests of the regression coefficients. For example, if we used a linear probability model for diabetes, we would  include age and age-squared as regressors due
to the quadratic relationship
between age and diabetes.  For example, suppose that we
have the linear probability model}%
\begin{eqnarray}
    \text{Group 0:} &y
        = \beta_{0}^{0} + \beta_{x}^{0} x + \beta_{x^2}^{0} x^2 +
        \beta_z^{0} z  + \varepsilon_0\
\label{groups-eq-y-lrm-squared-A0}
    \\
    \text{Group 1:} &y
        = \beta_{0}^{1} + \beta_{x}^{1} x + \beta_{x^2}^{1} x^2 +
        \beta_z^{1} z  + \varepsilon_1
\label{groups-eq-y-lrm-squared-B1}
\end{eqnarray}
%
\uline{Since $x$ and $x^2$ are on the right hand side of the equation, the marginal
effect of $x$ depends on $\beta_{x}^{g}$ and $\beta_{x^2}^{g}$ as well as
the values of $x$ and $z$. In this case, testing the group equality of marginal
effects is more useful than testing the equality of regression coefficients.
 If $x^2$ is not in the model, our approach is equivalent to testing if  
$\beta_{x}^{0}=\beta_{x}^{1}$.}

%%
%%        $\beta_{0}^{0}=\beta_{0}^{1}$; $\beta_{x}^{0}=\beta_{x}^{1}$;
%%        $\beta_{x^2}^{0}=\beta_{x^2}^{1}$; and $\beta_2^{0}=\beta_2^{1}$,
%%the predicted values of $y$ and the 
%%While the predicted  $y$ conditional on  $x$, $x^2$, and $z$ and the
%%effects of $x$ are identical  across groups when differences exist between groups 
%it is more useful to compute marginal effects of $x$ by group and test if they are equal.
}
% ===========================================================================
%
\section{Conclusions
\label{groups-sec-conclusion}}




In this paper we have developed methods for comparing groups using
predicted probabilities
and marginal effects on probabilities for the binary regression model.
Since the model is nonlinear, conclusions on whether groups differ in the
probability of the outcome or in the effect
of a regressor depend on  where in the data the groups
are compared and how the effects of regressors are summarized.
Deciding how to make comparisons requires careful
consideration based on a substantive understanding of the process being modeled
and the  questions being asked.
While this is much harder than  routine tests of the equality of regression
coefficients, the more complex task of comparing predictions and marginal effects
provides greater substantive insights \uline{that reflect the complexity of the
substantive application.} 
\textbf{}

\uline{While our examples are relatively simple, the same methods can
be used with any number of groups and in models with many regressors including
higher order interactions.
In models such as binary logit or ordinal probit, an  advantage
of our approach is that it deals with issues of identification without additional, untestable assumptions. But, even
in models where the regression coefficients are identified, comparing groups
using predictions and marginal effects have advantages in any model in which the outcome has a nonlinear
relationship with regressors, including linear regression. 
Further, our methods can be  extended beyond testing for group differences to
interpreting interactions more generally, such as dichotomous by dichotomous
interactions, continuous by continuous interactions, and three-way interactions.
In general,
the methods we have developed can  effectively used in any model where your software can make predictions
and estimate marginal effects.
}

% ===========================================================================
%
\bibliographystyle{sj} %\bibliographystyle{plainnat}
\bibliography{d:/Dropbox/Bookshelf/Bibtex/scottlong}

\newpage

% ===========================================================================
%
\section{Figures}

% ------------------------------------
% prob y with sd=10
\begin{figure}[H]
\small
\caption{
The link between
$y^{\ast}=\beta_0+\beta_1x+\varepsilon$
and
$\Pr(y\!=\!1\mid x)$ with \textit{Var}$(\varepsilon)\,=\,\sigma^2$.
%%
[[PROVENANCE groups-didactic-probV1.do 2018-01-30]]
%%
\label{groups-fig-didactic-sd1}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .2in 0 0, clip]{figures/groups-didactic-probV1-sd10.eps}
\end{figure}

% ------------------------------------
% prob y with sd=20
\begin{figure}[H]
\small
\caption{
The link between
$\delta y^{\ast}=(\delta\beta_0) +(\delta\beta_1)x+\delta\varepsilon$
and
$\Pr(y\!=\!1\mid x)$ with
\textit{Var}$(\delta \varepsilon)\,=\,\delta^2\sigma^2$.
%%
[[PROVENANCE groups-didactic-probV1.do 2018-01-30]]
%%
\label{groups-fig-didactic-sd2}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .2in 0 0, clip]{figures/groups-didactic-probV1-sd20.eps}
\end{figure}

% ------------------------------------
% DCrace vs DCage by race
\begin{figure}[H]
\small
\caption{Group comparisons of probabilities and marginal effects.
%%
[[PROVENANCE groups-didactic-AMEvMEMV12.do 2017-11-29]]
%%
\label{groups-fig-probVeffect}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .5in 0 0, clip]{figures/groups-didactic-AMEvMEMV12-diabetes-probVdc.eps}
\end{figure}                                                 

% ------------------------------------
% ADC vs DCM
\begin{figure}[H]
\small
\caption{\uline{Group differences in the discrete change of age.}
%%
[[PROVENANCE groups-didactic-AMEvMEMV12.do 2017-11-29]]
%%
\label{groups-fig-didactic-ameVmem-youngW}}
\bigskip \centering
%\includegraphics[width=4.75in,trim=0 .55in 0 0, clip]{figures/groups-didactic-AMEvMEMV11-diabetes-youngW.eps}
\includegraphics[width=4.5in,trim=0 .55in 0 0, clip]{figures/groups-didactic-AMEvMEMV12-diabetes-youngN.eps}
\end{figure}

% ------------------------------------
% Pr health by age
\begin{figure}[H]
\small \caption{
Probability of good health for whites and nonwhites by age.
%%
[[PROVENANCE groups-goodhlthV7.do \#2.1 2018-01-30]]
%%
\label{groups-fig-goodhlth-agePR}}
\smallskip \centering
\includegraphics[width=4.5in,trim=0 .05in 0 0, clip]{figures/groups-goodhlthV7-agePR.eps}
\end{figure}

% ------------------------------------
% DCrace by age
\begin{figure}[H]
\small \caption{
Racial differences in good health by age.
%%
[[PROVENANCE groups-goodhlthV7.do \#2.1 2018-01-30]]
%%
\label{groups-fig-goodhlth-ageDC}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .05in 0 0, clip]{figures/groups-goodhlthV7-ageDCrace.eps}
\end{figure}

% ------------------------------------
% Pr diabetes by age
\begin{figure}[H]
\small \caption{
Probability of diabetes for whites and nonwhites by age.
%%
[[PROVENANCE groups-diabetesV7.do \#2.1 2018-01-30]]
%%
\label{groups-fig-diabetes-agePR}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .1in 0 0, clip]{figures/groups-diabetesV7-agePR.eps}
\end{figure}

% ------------------------------------
% DCrace by age
\begin{figure}[H]
\small \caption{
Racial differences in diabetes  by age.
%%
[[PROVENANCE groups-diabetesV7.do \#2.1 2018-01-30]] 
%%
\label{groups-fig-diabetes-ageDC}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .1in 0 0, clip]{figures/groups-diabetesV7-ageDCrace-reversed.eps}
\end{figure}

% ------------------------------------
% Pr diabetes by age and activity
\begin{figure}[H]
\small \caption{
Probability of diabetes for blacks and whites by age and physical activity.
%%
[[PROVENANCE groups-diabetesV7.do \#2.3 2018-01-30]] 
%%
\label{groups-fig-diabetes-ageactivePR}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .1in 0 0, clip]{figures/groups-diabetesV7-agePR-active.eps}
\end{figure}

% ------------------------------------
% DCrace by activity
\begin{figure}[H]
\small \caption{
Racial differences in diabetes  by age and physical activity.
Dashed lines indicate that the  difference in probabilities is not significant
at the .05 level.
%%
[[PROVENANCE groups-diabetesV7.do \#2.3a 2018-01-30]] 
%%
\label{groups-fig-diabetes-ageactiveDCrace}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .1in 0 0, clip]{figures/groups-diabetesV7-ageDCrace-active-reversed.eps}
\end{figure}

% ------------------------------------
% DC activity by race
\begin{figure}[H]
\small \caption{
Effects of activity by race and age.
Dashed lines indicate that the  difference in probabilities is not
significant at the .05 level.
%%
[[PROVENANCE groups-diabetesV7.do \#2.3b 2018-01-30]] 
%%
\label{groups-fig-diabetes-ageactiveDCactive}}
\bigskip \centering
\includegraphics[width=4.5in,trim=0 .1in 0 0, clip]{figures/groups-diabetesV7-ageDCactive-active.eps}
\end{figure}

% ===========================================================================
%
\section{Tables}

% ------------------------------------
\begin{table}[H]
\begin{center}
\caption{Descriptive statistics ($N$=16,226)
%%
[[PROVENANCE groups-descriptiveV7.do \#2, 3, 4 2018-01-29]] 
%%
\label{groups-tab-descriptive}}
\bigskip\footnotesize

\begin{tabular}{rrrrrrrrr}
\hline \noalign{\smallskip}
& \multicolumn{2}{c}{White} &
& \multicolumn{2}{c}{Nonwhite} &
& \multicolumn{2}{c}{Difference$\dagger$}
\\

\cline{2-3}\cline{5-6}\cline{8-9}

\noalign{\smallskip}
&  & Standard &     &  & Standard &     &  &
\\

Variable & Mean & Deviation &   & Mean & Deviation &    & $\Delta$\,Mean & $p$
\\

\noalign{\smallskip}\hline \noalign{\smallskip}

\begin{text}goodhlth\end{text}
& 0.769 & ------ &  & 0.565  & ------ &  & 0.205 & $<$.001\\
\begin{text}diabetes\end{text}
& 0.162 & ------ &  & 0.281 & ------ &  & -0.120 & $<$.001\\
\begin{text}female\end{text}
& 0.532 & ------ &  & 0.575 & ------ &  & -0.043 & $<$.001\\
\begin{text}highschool\end{text}
& 0.853 & ------ &  & 0.563 & ------ &  & 0.289 & $<$.001\\
\begin{text}married\end{text}
& 0.692 & ------ &  & 0.541 & ------ &  & 0.150 & $<$.001\\
\begin{text}income\end{text}
& 74.280 & 99.389 &  & 41.013 & 58.376 &  & 33.268 & $<$.001\\
\begin{text}ihsincome\end{text}
& 4.523 & 1.001 &  & 3.809 & 1.164 &  & 0.714 & $<$.001\\
\begin{text}age\end{text}
& 66.514 & 10.421 &  & 64.099 & 9.677 &  & 2.415 & $<$.001\\
\begin{text}active\end{text}
& 0.303 & ------ &  & 0.223 & ------ &  & 0.080 & $<$.001\\
\begin{text}obese\end{text}
& 0.286 & ------ &  & 0.390 & ------ &  & -0.104 & $<$.001\\

\noalign{\smallskip}\hline
\noalign{\smallskip}
$N$ & 12,427 &  &  & 3,799 &  &  &  & \\

\noalign{\smallskip}\hline

\end{tabular}\end{center}

\footnotesize
\vspace{-6pt}
\ \quad\quad\quad\quad
Note: $\dagger$ $\Delta$\,Mean is the group difference in the means;
$p$ is the significance level

\ \quad\quad\quad\quad
from testing if means are equal.

\end{table}

% ------------------------------------
%
\begin{table}[H]
\begin{center}
\caption{Logit model for good health ($N$=16,226).
%%
[[PROVENANCE groups-goodhlthV7.do \#1.1, 1.2 2018-01-29]] 
%%
\label{groups-tab-goodhlth-logit}}

\footnotesize\smallskip\smallskip

\begin{tabular}{rrrrrrrrrrrrr}
\hline \noalign{\smallskip}

& \multicolumn{4}{c}{{White}} &
& \multicolumn{4}{c}{{Nonwhite}} &
& \multicolumn{2}{c}{{$H_0\text{: }\beta^{\text{W}}\!=\!\beta^{\text{N}}$}} \\

\cline{2-5}\cline{7-10} \cline{12-13}

\noalign{\smallskip\smallskip}

{Variable}
& 1:\,$\beta^{\text{W}}$ & 2:\,$\text{OR}^{\text{W}}$ & 3:\,$t$ & 4:\,$p$ &
& 5:\,$\beta^{\text{N}}$ & 6:\,$\text{OR}^{\text{N}}$ & 7:\,$t$ & 8:\,$p$ &
& 9:\,$F$ & 10:\,$p$ \\

\noalign{\smallskip}\hline \noalign{\smallskip}

\begin{text}Constant\end{text}
& -0.488 & ------ & -1.75 & 0.086 &  & -1.541 & ------ & -4.00 & $<$.001 &  & 4.71 & 0.034\\
\begin{text}female\end{text}
& 0.144 & 1.155 & 2.89 & 0.006 &  & -0.118 & 0.888 & -1.37 & 0.176 &  & 6.96 & 0.011\\
\begin{text}highschool\end{text}
& 0.800 & 2.225 & 13.45 & $<$.001 &  & 0.816 & 2.262 & 9.19 & $<$.001 &  & 0.02 & 0.891\\
\begin{text}married\end{text}
& -0.056 & 0.945 & -0.96 & 0.341 &  & -0.169 & 0.844 & -1.56 & 0.124 &  & 0.70 & 0.406\\
\begin{text}ihsincome\end{text}
& 0.556 & 1.744 & 15.67 & $<$.001 &  & 0.583 & 1.792 & 10.06 & $<$.001 &  & 0.16 & 0.695\\
\begin{text}age\end{text}
& -0.018 & 0.982 & -6.17 & $<$.001 &  & -0.008 & 0.992 & -1.83 & 0.072 &  & 3.47 & 0.068\\
\begin{text}obese\end{text}
& -0.573 & 0.564 & -11.16 & $<$.001 &  & -0.361 & 0.697 & -3.25 & 0.002 &  & 3.10 & 0.084\\

\noalign{\smallskip}\hline

\end{tabular}\end{center}

\footnotesize
\vspace{-6pt}

\ Note: OR is the odds ratio.
Tests of $H_0\text{:}\,\beta^{\text{W}}\!=\!\beta^{\text{N}}$ are shown for
didactic purposes.
\end{table}

% ------------------------------------
\begin{table}[H]
\begin{center}
\caption{Logit model for diabetes ($N$=16,226).
%%
[[PROVENANCE groups-diabetesV7.do \#1.1, 1.2 2018-01-30]] 
%%
\label{groups-tab-diabetes-logit}}

\footnotesize\smallskip\smallskip

\begin{tabular}{rrrrrrrrrrrrr}
\hline \noalign{\smallskip}

& \multicolumn{4}{c}{{White }} &
& \multicolumn{4}{c}{{Nonwhite }} &
& \multicolumn{2}{c}{{$H_0\text{: }\beta^{\text{W}}\!=\!\beta^{\text{N}}$}} \\

\cline{2-5}\cline{7-10} \cline{12-13}

\noalign{\smallskip\smallskip}

{Variable}
& 1:\,$\beta^{\text{W}}$ & 2:\,$\text{OR}^{\text{W}}$ & 3:\,$t$ & 4:\,$p$ &
& 5:\,$\beta^{\text{N}}$ & 6:\,$\text{OR}^{\text{N}}$ & 7:\,$t$ & 8:\,$p$ &
& 9:\,$F$ & 10:\,$p$ \\
\noalign{\smallskip}\hline \noalign{\smallskip}

\begin{text}Constant\end{text}
& -9.627 & ------ & -6.66 & $<$.001 &  & -11.169 & ------ & -5.79 & $<$.001 &  & 0.40 & 0.529\\
\begin{text}female\end{text}
& -0.400 & 0.670 & -6.53 & $<$.001 &  & -0.079 & 0.924 & -0.80 & 0.427 &  & 7.27 & 0.009\\
\begin{text}highschool\end{text}
& -0.253 & 0.776 & -3.60 & 0.001 &  & -0.142 & 0.867 & -1.42 & 0.160 &  & 0.92 & 0.342\\
\begin{text}married\end{text}
& 0.070 & 1.073 & 0.98 & 0.333 &  & 0.064 & 1.066 & 0.60 & 0.548 &  & 0.00 & 0.960\\
\begin{text}ihsincome\end{text}
& -0.189 & 0.828 & -5.50 & $<$.001 &  & -0.131 & 0.877 & -3.93 & $<$.001 &  & 1.61 & 0.210\\
\begin{text}age\end{text}
& 0.243 & 1.274 & 6.18 & $<$.001 &  & 0.299 & 1.348 & 5.36 & $<$.001 &  & 0.65 & 0.422\\
\begin{text}agesq\end{text}
& -0.002 & 0.998 & -5.97 & $<$.001 &  & -0.002 & 0.998 & -5.15 & $<$.001 &  & 0.78 & 0.382\\
\begin{text}active\end{text}
& -4.048 & 0.017 & -1.04 & 0.302 &  & -2.557 & 0.078 & -0.42 & 0.678 &  & 0.04 & 0.849\\
\begin{text}activeXage\end{text}
& 0.115 & 1.122 & 0.98 & 0.331 &  & 0.052 & 1.053 & 0.28 & 0.783 &  & 0.07 & 0.791\\
\begin{text}activeXagesq\end{text}
& -.0009 & 0.999 & -1.02 & 0.310 &  & -$$.0003 & 1.000 & -0.21 & 0.835 &  & 0.11 & 0.737\\
\begin{text}obese\end{text}
& 1.163 & 3.199 & 17.01 & $<$.001 &  & 0.740 & 2.095 & 6.59 & $<$.001 &  & 9.35 & 0.003\\

\noalign{\smallskip}\hline

\end{tabular}\end{center}

\footnotesize
\vspace{-6pt}

Note: OR is the odds ratio. Tests of
$H_0\text{:}\,\beta^{\text{W}}\!=\!\beta^{\text{N}}$ are shown for
didactic purposes.

\end{table}

% ------------------------------------
%
\begin{table}[H]
\begin{center}
\small
\caption{The effects of obesity on diabetes by race and gender.
%%
[[PROVENANCE groups-diabetesV7.do \#3.1-3.4 2018-01-30]] 
%%
\label{groups-tab-diabetes-obesegender}}
\smallskip\smallskip\smallskip
\footnotesize
\begin{tabular}{rrrrrrrrrrrr}

\hline \noalign{\smallskip\smallskip}

& \multicolumn{5}{c}{{Probability of diabetes}}
\\
\cline{2-6}

\noalign{\smallskip}

& \multicolumn{2}{c}{{Women}} &  & \multicolumn{2}{c}{{Men}}
&  & \multicolumn{3}{c}{Effect of obesity}
\\

\cline{2-3} \cline{5-6} \cline{8-10}

\noalign{\smallskip}

&   1:\,Obese & 2:\,Not\phantom{$^*$}
& & 3:\,Obese & 4:\,Not\phantom{$^*$}
& & 5:\,Women & 6:\,Men\phantom{$^*$} & 7:\,Difference \\

\hline \noalign{\smallskip}

1:\,White   & 0.278\phantom{$^*$} & 0.107\phantom{$^*$} &
        & 0.365\phantom{$^*$} & 0.152\phantom{$^*$} &
        & 0.170$^*$           & 0.212$^*$           & -0.042$^*$ \\
2:\,Nonwhite
        & 0.389\phantom{$^*$} & 0.233\phantom{$^*$} &
        & 0.408\phantom{$^*$} & 0.248\phantom{$^*$} &
        & 0.156$^*$           & 0.161$^*$           & -0.005\phantom{$^*$}\\

\noalign{\smallskip}\hline\noalign{\smallskip}

3:\,Racial difference
        & -0.112$^*$           & -0.126$^*$ &
        & -0.044\phantom{$^*$} & -0.096$^*$ &
        & -0.014\phantom{$^*$} & -0.052$^{\dagger}$ & -0.038$^*$\\

\noalign{\smallskip}\hline

\end{tabular}\end{center}

\footnotesize
\vspace{-6pt}

\quad\
Note: Other variables held at their means.
$*=p\!<\!.01$; $\dagger=p\!<\!.10$ for two-tailed test.

\end{table}

% ------------------------------------
%
\begin{table}[H]
\begin{center}
\small
\caption{
Average discrete change and discrete change at the means for
logit model for diabetes ($N$=16,226).
%%
[[PROVENANCE groups-diabetesV7.do \#4.1, 4.2 2018-01-30]] 
%%
\label{groups-tab-diabetes-dcsummary}}
\footnotesize
\smallskip\smallskip\smallskip\smallskip

\begin{tabular}{rrrrrrrrrrrrr}

\hline \noalign{\smallskip}

\noalign{\smallskip\smallskip}

\multicolumn{5}{l}{\text{Panel 1}: Average discrete change} \\

\noalign{\smallskip\smallskip}

\hline \noalign{\smallskip}

& \multicolumn{2}{c}{White} & & \multicolumn{2}{c}{Nonwhite} &
& \multicolumn{2}{c}{Difference} \\

\cline{2-3} \cline{5-6} \cline{8-9}

\noalign{\smallskip\smallskip}

{Variable}
& 1:\,$\text{ADC}^{\text{W}}$  & 2:\,$p$\phantom{x} &
& 3:\,$\text{ADC}^{\text{N}}$ & 4:\,$p$\phantom{x} &
& 5:\,$\text{ADC}$ & 6:\,$p$\phantom{x} \\

\noalign{\smallskip}\hline \noalign{\smallskip}

\begin{text}female\end{text}
& -0.051 \phantom{a}& $<$0.001 &  & -0.015 \phantom{a}& 0.431 &  & -0.036 \phantom{a}& 0.089\\
\begin{text}highschool\end{text}
& -0.033 \phantom{a}& 0.001 &  & -0.027 \phantom{a}& 0.160 &  & -0.006 \phantom{a}& 0.763\\
\begin{text}married\end{text}
& 0.009 \phantom{a}& 0.330 &  & 0.012 \phantom{a}& 0.546 &  & -0.003 \phantom{a}& 0.875\\
\begin{text}ihsincome\end{text}
& -0.022 \phantom{a}& $<$0.001 &  & -0.024 \phantom{a}& $<$0.001 &  & 0.002 \phantom{a}& 0.779\\
\begin{text}age\end{text}
& 0.011 \phantom{a}& $<$0.001 &  & 0.027 \phantom{a}& $<$0.001 &  & -0.016 \phantom{a}& 0.002\\
\begin{text}active\end{text}
& -0.053 \phantom{a}& $<$0.001 &  & -0.084 \phantom{a}& $<$0.001 &  & 0.031 \phantom{a}& 0.110\\
\begin{text}obese\end{text}
& 0.169 \phantom{a}& $<$0.001 &  & 0.146 \phantom{a}& $<$0.001 &  & 0.022 \phantom{a}& 0.408\\

\noalign{\smallskip}\hline \noalign{}

\noalign{\smallskip\smallskip\smallskip}

\noalign{\smallskip\smallskip}

\multicolumn{5}{l}{\text{Panel B}: Discrete change at the mean} \\

\noalign{\smallskip\smallskip}

\hline \noalign{\smallskip}

& \multicolumn{2}{c}{White} & & \multicolumn{2}{c}{Nonwhite} &
& \multicolumn{2}{c}{Difference} \\

\cline{2-3} \cline{5-6} \cline{8-9}

\noalign{\smallskip\smallskip}

{Variable}
& 1:\,$\text{DCM}^{\text{W}}$ & 2:\,$p$\phantom{x} &
& 3:\,$\text{DCM}^{\text{N}}$ & 4:\,$p$\phantom{x} &
& 5:\,$\text{DCM}$ & 6:\,$p$\phantom{x} \\

\noalign{\smallskip}\hline \noalign{\smallskip}

\begin{text}female\end{text}
& -0.057 \phantom{a}& $<$0.001 &  & -0.016 \phantom{a}& 0.431 &  & -0.041 \phantom{a}& 0.070\\
\begin{text}highschool\end{text}
& -0.038 \phantom{a}& 0.001 &  & -0.029 \phantom{a}& 0.162 &  & -0.008 \phantom{a}& 0.716\\
\begin{text}married\end{text}
& 0.010 \phantom{a}& 0.328 &  & 0.013 \phantom{a}& 0.545 &  & -0.003 \phantom{a}& 0.895\\
\begin{text}ihsincome\end{text}
& -0.025 \phantom{a}& $<$0.001 &  & -0.026 \phantom{a}& $<$0.001 &  & 0.001 \phantom{a}& 0.916\\
\begin{text}age\end{text}
& 0.014 \phantom{a}& $<$0.001 &  & 0.023 \phantom{a}& $<$0.001 &  & -0.009 \phantom{a}& 0.169\\
\begin{text}active\end{text}
& -0.049 \phantom{a}& $<$0.001 &  & -0.083 \phantom{a}& 0.006 &  & 0.034 \phantom{a}& 0.319\\
\begin{text}obese\end{text}
& 0.190 \phantom{a}& $<$0.001 &  & 0.158 \phantom{a}& $<$0.001 &  & 0.032 \phantom{a}& 0.264\\

\noalign{\smallskip}\hline \noalign{}

\end{tabular}\end{center}

\footnotesize
\vspace{-6pt}

\quad\quad\quad\quad\quad\quad
Note: The effect of \text{age} is for a five-year change.

\end{table}

% ------------------------------------
%
\begin{table}[H]
\begin{center}
\small
\caption{Testing the equality of regression coefficients in models for
diabetes ($N$=16,226).
%%
[[PROVENANCE groups-diabetesV7.do \#5.1 5.2a,b,c 2018-01-30]] 
%%
\label{groups-tab-diabetes-allisontest}}
\footnotesize
\bigskip
\footnotesize

\begin{tabular}{rrrrrrrrrrrr}

\hline \noalign{\smallskip}

& \multicolumn{2}{c}{} &
& \multicolumn{8}{c}{Coefficients constrained to be equal}
\\

\cline{5-12}

\noalign{\smallskip}

& \multicolumn{2}{c}{Full model} &
& \multicolumn{2}{c}{$M_1$:\ \text{ihsincome}} &
& \multicolumn{2}{c}{$M_2$:\ \text{age, active}$\dagger$} &
& \multicolumn{2}{c}{$M_3$:\ \text{obese}}
\\

\cline{2-3} \cline{5-6} \cline{8-9} \cline{11-12}

\noalign{\smallskip}

Variable
& $\Delta \beta$\phantom{i} & $p$\phantom{X} & & $\Delta \beta$\phantom{i}
& $p$\phantom{X} &
& $\Delta \beta$\phantom{i} & $p$\phantom{X} & & $\Delta \beta$\phantom{ix}
& $p$\phantom{Xx}
\\

\noalign{\smallskip}\hline \noalign{\smallskip}

\begin{text}female\end{text}
& -0.321 & 0.009 &  & -0.199 & 0.164 &  & -0.363 & 0.013 &
& -0.176\phantom{$^\ddagger$} & 0.120\phantom{$^\ddagger$} \\
\begin{text}obese\end{text}
& 0.423 & 0.003 &   & 0.069 & 0.810 &   & 0.530 & 0.064 &
& 0.000$^\ddagger$ & 1.000$^\ddagger$ \\

\noalign{\smallskip}\hline

\end{tabular}\end{center}

\footnotesize
\vspace{-6pt}

\quad\quad\quad
Note: Results for the full model are from
table \ref{groups-tab-diabetes-logit}. Tests from models with coefficients

\quad\quad\quad
constrained to be equal were estimated with a location scale model.
$\dagger$ All coefficients

\quad\quad\quad
involving \text{age} and/or \text{active} are constrained to be equal.
$\ddagger$ Coefficient for \text{obese} are

\quad\quad\quad
constrained to be equal.

\end{table}

%% DROPPED
% =========================================================================== %
\iffalse 

%%SAM's review revised a-- see revision that follows ( The question of how to
test for group differences in logistic models has attracted considerable
attention across many disciplines. We are not the first to identify the
problems. Scholars from sociology (e.g., \cite{Allison:1999}, economics (e.g.,
\cite{norton:2004}, psychiatry (e.g., \cite{Kendler:2010}, epidemiology (e.g.,
\cite{Rothman:2008}), and political science (ADD HERE) have identified issues
with testing for group differences in these models particularly, and with
testing statistical interaction more generally. Conventional techniques are
flawed in several ways, with extant research largely focusing on two main
themes: that residual variances can distort group differences in coefficients
and that group differences in baseline values can distort product terms. In this
paper, we confine out attention to the former, but our proposed solution is
equally effective in dealing with other problems that arise when testing
interactions in logit and probit models.

We are also not the first to propose a solution involving predictions.
\cite{Mood:2010} and \cite{Landerman:2011}, for example, both demonstrate how
differences in predicted probabilities can be used to test group differences.
Yet, previous work has largely focused on first differences involving two
variables (e.g. a grouping variable and a regressor). We take this as a starting
point, but then expand this approach by examining group differences in the
effects of the regressor on the probability of an outcome across levels of
another variable and by going beyond first differences, —which are a simplistic
way to assess average group differences, —to second differences, which allow us
to test more complex hypotheses about whether regressors have a differential
impact on the probability of an outcome for each group. Our predictive methods
yield graphs and tables which can be used to address a variety of complex
research questions about group differences. In sum, we offer an interpretive
framework for application to a broad class of questions and models, including
group differences in logit and probit models, as well as  interactions more
generally across other types of models for categorical data analysis (e.g.,
Poisson, ordered logit, etc.).

\fi
% moved into text below
% ===========================================================================

\end{document}

