0
$\begingroup$

I came up with below for my glm analysis but I need to calculate R-squared to cite in the paper? anyone can help me with this please?

summary(lrfit)

Call:

glm(formula = cbind(CumNumberTakeOff, CumNumberNOTakeOff) ~ Sex + 
    PlantQuality + Minlog + Temperature + Temperaturetm + +Temperature:Sex + 
    Temperature:PlantQuality + Sex:PlantQuality + Minlog:PlantQuality, 
    family = binomial, data = expdataNo20)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-2.3724  -0.6914  -0.2577  -0.0168   3.1202  

Coefficients:

                             Estimate Std. Error z value Pr(>|z|)    
(Intercept)                 -38.04288    2.22259 -17.116  < 2e-16 ***
SexMale                      10.20370    1.78445   5.718 1.08e-08 ***
PlantQualityF/W              19.99712    1.84748  10.824  < 2e-16 ***
Minlog                        1.01936    0.04873  20.918  < 2e-16 ***
Temperature                   1.21796    0.08583  14.191  < 2e-16 ***
Temperaturetm                -0.52639    0.02479 -21.235  < 2e-16 ***
SexMale:Temperature          -0.35374    0.06807  -5.197 2.03e-07 ***
PlantQualityF/W:Temperature  -0.68000    0.07118  -9.553  < 2e-16 ***
SexMale:PlantQualityF/W      -1.13717    0.17008  -6.686 2.29e-11 ***
PlantQualityF/W:Minlog       -0.38413    0.06478  -5.930 3.03e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

$\endgroup$
1
$\begingroup$

There is no R-squared for glm's.

Closes thing are so-called "pseudo-R" statistics derived from the deviance and/or likelihood.

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/Psuedo_RSquareds.htm

| cite | improve this answer | |
$\endgroup$
1
$\begingroup$

As @Analyst noted, there is no R-Squared for logistic regression. While there are several 'pseudo-R-squared' options available, I would advise against using them - there are simply too many and none of them properly get at the issue you are trying to solve. Remember that the purpose of logistic regression is different from OLS regression. In the latter, you minimize the squared error, and the R^2 is conceptually straightforward - the total % variance accounted for by the model. In contrast, logistic regression seeks classification accuracy. This can be assessed numerically in several ways, using such metrics as AUC (area under the ROC curve), confusion matrices, positive predictive value (PPV), etc, etc. For AUC/ROC, I suggest you look into R package 'pROC'. For confusion matrices, PPV, etc., try R package 'caret'.

| cite | improve this answer | |
$\endgroup$
-2
$\begingroup$

You should look at the confusion metric and then calculate the specificity and sensitivity using different variable selection. This would help to calculate accuracy of the model

| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Could you explain what you mean in a little more detail? (And presumably that should be "confusion matrix"). $\endgroup$ – Scortchi - Reinstate Monica Aug 28 '15 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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