# How to calculate Prob > chi2 in R to test model fit of conditional logistic regression

I used the clogit function (from the survival package) to run a conditional logistic regression in R with a big dataset of 1:M matched pairs with n=300368964 and number of events= 39995.

model <- clogit(Alliance ~ OVB + CVC + BVB + strata(Strata), method="exact")


                 coef  exp(coef)   se(coef)       z Pr(>|z|)
OVB        -0.0498174  0.9514031  0.0166275  -2.996  0.00273 **
BVB         0.0277405  1.0281289  0.0304956   0.910  0.36300
CVC         1.1709851  3.2251683  0.1089709  10.746  < 2e-16 ***
EarlyStage -1.3215824  0.2667129  0.0205851 -64.201  < 2e-16 ***
AvgVCSize   0.0087976  1.0088364  0.0002035  43.224  < 2e-16 ***
NumberVC    0.0643579  1.0664740  0.0034502  18.653  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Rsquare= 0   (max possible= 0.001 )
Likelihood ratio test= 6511  on 6 df,   p=0
Wald test            = 6471  on 6 df,   p=0
Score (logrank) test = 6801  on 6 df,   p=0


Since Rsquare equals 0 and the test ratios seems very high, I tried to plot the results to check whether the model fits. But I wasn't able to plot it properly.

I would online many papers which use the ratio Prob > chi2 = 0 from Stata as test ratio to proof the model fit.

How could I calculate this ratio in R? Are there any other ways I could check the model fit of my clogit results?

I would appreciate any help.

Thanks you very much in advance.

• Your $n$ is a third of a billion observations and you have 40K events. It's not remotely surprising your p-values are all zero, even though the model doesn't explain a lot of the variation (& how is $R^2$ defined here?). I have no idea what you mean by "use the ratio Prob > chi2 = 0 ... as test ratio to proof the model fit". First, you don't 'prove' a model fit, and secondly, your initial expression is unclear. Prob-what is greater than $\chi^2$-what? Are you referring to the p-value for one of the model hypothesis tests? What about it? A low p-values doesn't imply the model is a good fit. – Glen_b Jan 25 '14 at 6:54
• Sorry for the unclear expression. Prob is the probability of obtaining the chi-square statistic given that the null hypothesis is true. In other words, this is the probability of obtaining this chi-square statistic (6511) if there is in fact no effect of the independent variables, taken together, on the dependent variable. This is the p-value, which is compared to a critical value, perhaps .05 or .01 to determine if the overall model is statistically significant. – user37838 Jan 25 '14 at 13:27
• If the p-value would be less than .000, I could say that the model is statistically significant. Is there maybe also a way to infer from the given model hypothesis tests whether the model could be significant? Or does the high number of observations compared to the events make it very unlikely that the model is statistically significant? – user37838 Jan 25 '14 at 13:50
• p-values are conditional probabilities - they can't ever be less than zero. It sounds like your understanding of p-values (and statistical significance) is wrong. – Glen_b Jan 25 '14 at 14:24
• With "less than .000", I meant that the p-value is very close to 0. I found the explanantion for the logit estimates here. – user37838 Jan 25 '14 at 14:44 