# Testing a linear restriction on coefficients of a logistic regression (in SPSS)

I have a logistic regression model $$P(Y=1|X_1,X_2,X_3)=\frac{1}{1+\exp[-(\beta_0+\beta_1 X_1+\beta_2 X_2+\beta_3 X_3)]}.$$ I would like to test a null hypothesis $$H_0\colon \beta_2=c\beta_1$$. However, I am not sure how to do this using SPSS. Therefore, I have an idea to reformulate the model as follows: $$P(Y=1|X_1,X_2,X_3)=\frac{1}{1+\exp[-(\beta_0+\gamma_1 Z_1+\gamma_2 X_2+\gamma_3 X_3)]}$$ where $$Z_1:=X_1+cX_2$$ and then test $$H_0\colon \gamma_2=0$$ instead (which I know how to do using SPSS).

Is this reformulation valid, i.e. am I still testing the hypothesis I am after, or am I fooling myself?
And if I am, how else can I solve this problem?

(I know that asking for SPSS code or instructions is off topic, so I am not doing that. But it would be extra nice if you included some hints of that in your answer in addition to answering my direct question.)

• Algebra tells you the two models are identical.
– whuber
Commented Jan 26, 2022 at 16:18
• Yes, this reformulation is valid and correct. Commented May 30 at 7:42

Here is a simulation in R that shows the idea to be working: the distribution of the relevant $$p$$-values under $$H_0$$ is close to uniform, while it is concentrated close to zero under $$H_1$$.

m=1e3               # number of simulations
pvals=rep(NA,m)     # a vector to save p-values in
n=1e3               # sample size
for(i in 1:m){
set.seed(i+0); e =rnorm(n)
set.seed(i+1); x1=rnorm(n)
set.seed(i+2); x2=rnorm(n)
set.seed(i+3); x3=rnorm(n)
b0=1; b1=1; b2=1; b3=3; z1=x1+x2
#  b2=2              # uncomment this line for simulation under H1
p=1/(1+exp(-(b0+b1*x1+b2*x2+b3*x3))) # probabilities for generating the dependent variable in logistic regression
set.seed(0); u=runif(n,min=0,max=1)
y=as.numeric(u<p) # the dependent variable
m1=glm(y~z1+x2+x3,family=binomial)
pvals[i]=coef(summary(m1))[3,4]
}
hist(pvals)