# Testing a Multiple Logistic regression Model Goodness of Fit and accuracy

by MhQ-6   Last Updated September 13, 2018 20:19 PM

I am trying to create a predictive model that will determine the likelihood that a lead will take a specific action. I used a Logistic regression because either the Lead does (1) or does not (0) take action. Now I want to test my model, which tests should I use for the goodness of fit and accuracy?

Variables - Age Bal D2R

R Code:

```rs4= glm(Action ~ D2R+Age+Bal, data = res, family = binomial, na.action = na.omit) confint(rs4) wald.test(b = coef(rs4), Sigma = vcov(rs4), Terms = 2) with(rs4, null.deviance - deviance) with(rs4, df.null - df.residual) with(rs4, pchisq(null.deviance - deviance, df.null - df.residual, lower.tail = FALSE))```

Results:

```Deviance Residuals: Min 1Q Median 3Q Max -1.1542 -0.8003 -0.6261 -0.2466 3.5193 Coefficients:``` `Estimate Std. Error z value Pr(>|z|)`
`(Intercept) -3.060e-01 5.927e-02 -5.164 2.42e-07 ***` `Dcny2Rcvd -6.726e-04 2.525e-05 -26.642 < 2e-16 ***` `Age -1.217e-02 1.929e-03 -6.308 2.82e-10 ***` `Balance -7.573e-07 2.572e-06 -0.294 0.768`

```Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for binomial family taken to be 1)```

``````Null deviance: 23037  on 21545  degrees of freedom
``````

`Residual deviance: 21934 on 21542 degrees of freedom` `(4238 observations deleted due to missingness)`

`AIC: 21942`

`Number of Fisher Scoring iterations: 6`

`confint(rs1)`

``````                    2.5 %        97.5 %
(Intercept) -4.218641e-01 -1.895478e-01
Dcny2Rcvd   -7.225235e-04 -6.235534e-04
Age         -1.597191e-02 -8.409363e-03
Balance     -5.930319e-06  1.501410e-06

with(rs1, null.deviance - deviance)
[1] 1102.956
with(rs1, df.null - df.residual)
[1] 3
with(rs1, pchisq(null.deviance - deviance, df.null - df.residual, lower.tail = FALSE))
[1] 8.313415e-239
``````

Tags :