2
$\begingroup$

I am running a logistic regression in R and I noticed that the output does not include the F-statistic which shows the overall significance of the model.

In another post, the formula for the F-statistic is given for a linear regression. My question is, is the F-statistic a valid measure of significance for the logistic model? if so, how can I calculate it?

$\endgroup$
4
  • $\begingroup$ You would be better served with a chi-squared test or an ROC curve. There is also a R^2 for Logistic regression $\endgroup$
    – akash87
    Commented May 16, 2019 at 18:01
  • 1
    $\begingroup$ Run the first example on the help page for glm to see what can be done. Notice that the usual summary gives you a null and residual deviance: those are what you use instead of the F statistic. See stats.stackexchange.com/search?q=analysis+of+deviance+score%3A2. $\endgroup$
    – whuber
    Commented May 16, 2019 at 20:42
  • $\begingroup$ First, you may want to use car:: Anova with the wald test, to look at individual effects. If you want to test the model overall, perhaps fit a model result ~ 1 and use lmtest to compare that to your full model. $\endgroup$ Commented Nov 16, 2019 at 15:56
  • $\begingroup$ So, to be clear, neither of the things I'm suggesting are an F statistic. But the chi-square statistics may serve better. $\endgroup$ Commented Nov 16, 2019 at 16:11

1 Answer 1

1
$\begingroup$

TSS

TSS <- function(y){
  y_ = mean(y)
  y = y - y_
  y = y^2
  sum(y)
}

RSS

RSS <- function(error){
  sum(error^2)
}

F-statistics

FS <- function(tss, rss, num_of_predictors, num_of_sample){
  a=(tss-rss)/num_of_predictors
  b = rss/(num_of_sample-num_of_predictors-1)
  a/b
}

num_of_predictors = length(cars)-1
num_of_sample = length(y)
error = fit$residuals
$\endgroup$

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.