# testing nonlinear hypothesis glm R

I estimate probit model: \begin{align*} P(y=1|x_1, x_2, x_3) = \Phi(\alpha_0 + \alpha_1 x_1 + \alpha_2 x_2+ \alpha_3 x_3) \end{align*} using: probitMain <- glm(y~x1+x2+x3, family=binomial(link="probit"), data=MD).
I want to test nonlinear hypothesis $f(\alpha_0, \alpha_1, \alpha_2, \alpha_3) = 0$, where $f$ is a rational function $f(\alpha_0,\alpha_1, \alpha_2, \alpha_3) = \frac{\alpha_2 + \alpha_0 \frac{\alpha_3}{\alpha_1}}{1+\frac{\alpha_3}{\alpha_1}}$. I have tried to use nlWaldTest package for nonlinear Wald test, but it doesn't seem to work with glm objects.

Is there any other R package that can test nonlinear hypothesis for glm?

• What's the rational function? Some functions at least will allow manipulations that simplify the problem. Feb 3, 2016 at 1:39
• Thanks. I have included the explicit definition of the function in the question. Feb 4, 2016 at 6:50
• If $a_1\neq 0$ then you can multiply numerator and denominator by $a_1$ and get: $f = \frac{a_2a_1 + a_0a_3}{a_1 + a_3}$. Now if $(a_1+a_3)\neq 0$ then $f=0$ if $a_2a_1 + a_0a_3 = 0$. That's still nonlinear, but it is at least a little simpler. Feb 4, 2016 at 8:19
• Thanks. In the end I have manipulated the likelihood function for probit so it can be written in the suitable form and estimated parameters using max likelihood and retrieved the appropriate standard errors. Feb 10, 2016 at 13:48
• Do you think what you did might work as a kind of answer for your question? I'm thinking mainly that if there are other people with a similar problem describing what you ended up doing to solve the problem might be useful. Feb 11, 2016 at 0:20

I solve the problem like this. Write the probit equation as: \begin{align} P(y=1|x_1, x_2, x_3)=\Phi \left(\gamma_1 + \gamma_2 x_1 + (\gamma_3 + \gamma_3 \gamma_4 -\gamma_1)x_2 + \gamma_2 \gamma_4 x_3 \right) \end{align} I estimate this equation using ML with respect to $\gamma's$ (with function mle2 from bbmle package). Note that $\gamma_2$ is exactly the parameter I was originally interested in. From Hessian of the ML estimation I can retrieve standard errors.