johnny_trfc
johnny_trfc

Reputation: 55

Running Logistic Regression in R

I'm running logistic regression in R for the first time. Usually I do this in SPSS but my output in R is different.

In SPSS I'd run it like this:

LOGISTIC REGRESSION VARIABLES benefits
/METHOD=ENTER hhinc_band
/CONTRAST (hhinc_band)=INDICATOR
/PRINT=SUMMARY CI(95)
/CRITERIA=PIN(0.05) POUT(0.10) ITERATE(20) CUT(0.5).

In R, I'm doing this:

logistic <- glm(benefits ~ hhinc_band, 
data=data2017)    

In order to achieve the same output do I need to run anything extra in R?

Grateful for any guidance.

Cheers.

Upvotes: 0

Views: 250

Answers (1)

desval
desval

Reputation: 2435

I think the default option in glm is gaussian. You can run a logistic model by specifying the family:

 glm(benefits ~ hhinc_band, data=data2017, family = "binomial") 

See here for more info https://stats.idre.ucla.edu/r/dae/logit-regression/

Upvotes: 2

Related Questions