Test if two coefficients are statistically different in logistic regression? I am doing the logistic regression with logit link in MATLAB
[b, ~, stats] = glmfit(X, [Y N], 'binomial', 'link', 'logit');

I can find the $p$-values for each coefficient in stats, but this tests if a coefficient is equal to 0.
How do I test, say, if the first coefficient is statistically different from the second?
Note that I am asking this from a stats perspective, so the answers are not necessarily MATLAB-specific.
 A: You can specify two models: 1) Model with parameter restrictions 2) Model without these.  
Next you can test via likelihood ratio test if your restricted model should be abandoned in favor of unrestricted one. So null hypothesis is restricted model, which is not accepted but can only be rejected.  
Here is link to implementation in MATLAB:  
http://se.mathworks.com/help/econ/lratiotest.html 
Unfortunately I cannot help you further since I do not have MATLAB software myself. 
A: There's a couple of these questions floating around that essentially have the same answer. There are essentially two approaches to testing what are model constraints.
Given a regression $Y = \beta_0 + \beta_1X_1 + \beta_2X_2 $, you can
1. Modify ("constrain") the regression structure and perform some kind of test
Write out what you want to test and substitute into the regression formula , e.g.
$\beta_1 = \beta_2$
which substitutes in as
$Y = \beta_0 + \beta_1 X_3 $ where $X_3 = X_1 + X_2$
You now have two models, the original and restricted, and you perform a likelihood ratio test between the two. This is the method discussed by @Sid and @Analyst using lratiotest
Alternatively in the same spirit:
$\beta_1 = \beta_2$ equivalent to
$\beta_1 - \beta_2 = 0$  which can be rewritten as
$\beta_1 - \beta_2 = \alpha$
Substitute this back into the original regression formulation
$ Y = \beta_0 + (\alpha + \beta_2) X_1 + \beta_2X_2 $
$ Y = \beta_0 + \alpha X_1 + \beta_2 X_3 $ after rearranging
Here, a test of $\alpha$ is a test of $\beta_1 = \beta_2$ in the original regression. This is the method shown by @Glen_b here.
This method is usable with other hypothesis as well, like $\beta_1 = 0.5$ or $\beta_1 = 3\beta_2$; just substitute as appropriate.
2. Perform what are known as "general linear hypothesis" or "regression Wald tests" after estimation. They have more names, another common one is "linear contrasts", and I've seen others as well. 
Once you have your vector of regression coefficients
$\mathbf{B} = [\text{b x 1}] = [\beta_0, \beta_1, \beta_2]'$
and their var-covariance matrix
$\mathbf{V} = [\text{b x b}] = [\text{stuff}]$
You construct a vector defining your hypothesis. So in this case, where we want to test $\beta_1 - \beta_2 = 0$, we have
$H = [\text{1 x b}] = [0,1,-1]$
resulting in a hypothesis of
$HB = [0,1,-1] \times [\beta_0, \beta_1, \beta_2]'$
If you wanted to test against something other than 0, then you would subtract the constant as such
$HB - c$ 
Then you calculate the test statistic
$S = (HB - c)'(HVH')^{-1}(HB -c)$
This is distributed $~\chi^2_1$ for logistic regression (in linear regression, it is an F-statistic). 
In MATLAB, it looks like linhyptest is what you want for this.
As with #1, this is usable with any other hypothesis that involve linear combinations of the coefficients. $\beta_1 = 0.5$ or $\beta_1 = 3\beta_2$ fit easily into this framework; construct $H$ and $c$ as appropriate. 

I have a preference for the second method. It has the advantage of not requiring refitting a second model, reducing the work in sorting out how the second model should be formulated, especially if you have multiple hypothesis. In addition, multiple hypothesis can be tested jointly as well by "stacking" the $H$ and $c$ vectors, turning $H$ into a $\text{q x b}$ and $c$ into a $\text{q x 1}$, with the resulting test statistic having $q$ degrees of freedom instead of 1.
A: Questions of this form in hypothesis testing are generally answered by testing the hypothesis that the difference of two parameters is greater than zero. I am not aware of a direct approach, but this is one possibility. Suppose you want to test if $a$ is statistically different from $b$ in 
$logit (z) = aX + bY$ ..(1)
fit 
$logit(z) = aX + aY$ ..(2)
and compare the fits in (1) and (2) using methods described by @Analyst. If the fits are drastically different, I would conclude the parameters are statistically different
A: LR test may be similar to F-test in linear regression. If individual coefficients are to be compared, something like t-test may be more relevant.
GLM, if estimated by maximum likelihood estimation, coefficient estimators follow the normal distribution asymtotically and this is why Z-test is normally performed rather than t-test for individual coefficients. Then it'd be quite similar to testing of mean difference.
