Having performanced a logistic regression in R with the glm function, I'm not sure how to interpret the results for the Intercept (as shown below).

So I found that my intercept is significant but all the predictors coefficients was non significant, May I consider that the intercept significance give us any inference about the relationship between variables?

 Call: glm(formula = Sales~ Service, family = binomial, data = train)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.4337  -1.4337   0.9411   0.9411   0.9411  

             Estimate Std. Error z value Pr(>|z|)    
(Intercept)    0.5849     0.1998   2.927  0.00342 ** 
Service2   -17.1510  1696.7344  -0.010  0.99193    
Service3    15.9811  2399.5447   0.007  0.99469

--- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 147.13  on 111  degrees of freedom 
Residual deviance: 142.17  on 109  degrees of freedom AIC: 148.17

Number of Fisher Scoring iterations: 15

I decided to perform the Hypothesis Test on the same data and I found that there is a relationship between the two variables, then I can reject the null hypothesis H0 because the p-value is less than small threshold (0,05).

            Welch Two Sample t-test

data: sales and service
t = -9.6086, df = 215.53, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0

95 percent confidence interval:
 -0.4820527 -0.3179473
sample estimates:
mean of x mean of y 
  0.63125   1.03125

If There is a relationship between the variables why when I use gml function in my model the dependent variables return insignificant?

Additional: My dataset

       Sales     1   2   3
             0  56   3   0
             1 100   0   1

1 Answer 1


First, the 0 cells mean that you will have quasicomplete separation, which makes the results of logistic regression look the way yours did - that is, huge standard errors around the parameter estimates.

Second, I'm not sure what you are doing a t-test on, but a t-test compares two means. You don't have two means.

Third, if this is really all the data you have (and all the variables you have) then you could try an exact chi-square test. R code:

sales <- c(rep(0, 59), rep(1, 101))
service <- c(rep(1, 56), rep(2, 3), rep(3, 0), rep(1, 100), rep(2, 0), rep(3, 1))

table(sales, service)

chisq.test(x = sales, y = service, simulate.p.value = TRUE)

yields p = 0.048, but I'd be leery of relying on this for much.

  • 2
    $\begingroup$ Hi @PeterFlom, your answer was very useful. I've checked once again all my data and variables available then after adding more data it has returned a significant result with a *** p value for independent variable. I don't know if this is the best coding practice in R but I had to convert my data to numeric. $\endgroup$
    – Stankevix
    Commented Sep 16, 2019 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.