Type=response in glm function in R

r
machine_learning
technique

#1

Can anyone please explain me the difference between the below statements?

  1. QualityLog = glm(PoorCare ~ StartedOnCombination + OfficeVisits + Narcotics, data = qualityTrain, family = “binomial”) #Here we are building a logistic regression model

  2. predict_1 = predict(QualityLog,new_data=test_data) # here we are making validations on the test dataset using the model which was trained by the training dataset

  3. predict_2 = predict(QualityLog,type=“response”)

Can any one please explain me what exactly happens in Step 3? What will be the outputs in Step 3?


#2

type = "response" gives the predicted probabilities.

See ?predict in R for more information