O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – fitting the logistic regression model

The logistic regression model is built using the glm function with the family = 'binomial' option. We will obtain the pseudo-R2 values using the pR2 function from the pscl package.

  1. Fit the logistic regression model for the Pass as a function of the Sat using the option family = 'binomial' in the glm function:
    pass_logistic <- glm(Pass~Sat,data=sat,family = 'binomial')
  2. The details of the fitted logistic regression model is obtained using the summary function: summary(pass_logistic).

    In the summary you will see two statistics called Null deviance and Residual deviance. In general, a deviance is a measure useful for assessing the goodness-of-fit, and for the logistic regression model it plays the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required