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:
SPSS
File menu: Regression
–> Binary Logistic.
Syntax:
logistic regression Y with x1 x2 x3
/categorical = x2
Stata
logistic Y x1 x2
https://www.stata.com/features/overview/logistic-regression/