11.1 Fitting GLMs

All regression models aim to model the expected value of the response variable \(Y\) given the observed data \(X\), through some link function \(C\)

\[E(Y|X) = C(X)\]

Depending on the data type of \(Y\), this link function takes different forms. Examples include:

  • Linear regression: C = Identity function (no change)
  • Logistic regression: C = logit function
  • Poisson regression: C = log function

R

The general syntax is similar to lm(), with the additional required family= argument. See ?family for a list of options. Example for Logistic regression would be:

glm(y ~ x1 + x2 + x3, data=DATA, family="binomial") 

SPSS

File menu: Regression –> Binary Logistic.

Syntax:

logistic regression Y with x1 x2 x3
   /categorical = x2

https://www.ibm.com/support/knowledgecenter/en/SSLVMB_26.0.0/statistics_reference_project_ddita/spss/regression/syn_logistic_regression_overview.html

Stata

logistic Y x1 x2

https://www.stata.com/features/overview/logistic-regression/