You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/glms.qmd
+35-18Lines changed: 35 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -25,36 +25,53 @@ by Annette J. Dobson and Adrian G. Barnett:
25
25
26
26
# Choosing a model
27
27
28
-
The type of predictive model one uses depends on several issues; one is the type of response.
28
+
The choice of statistical model depends on several considerations,
29
+
primary among which is the type of response variable.
29
30
30
-
* Measured values such as quantity of a protein, age, weight usually can be handled in an ordinary linear regression model, possibly after a log transformation.
31
+
* Measured continuous values such as protein level, age, or weight can usually be modeled using linear regression,
32
+
possibly after applying a logarithmic transformation.
31
33
32
-
* Patient survival, which may be censored, calls for a different method (survival analysis, Cox regression).
34
+
* Patient survival times, which may be right-censored, call for time-to-event methods
35
+
such as Kaplan-Meier estimation or Cox proportional hazards regression.
33
36
34
-
* If the response is binary, then can we use logistic regression models
37
+
* If the outcome is binary (0/1),
38
+
we can use logistic regression models.
35
39
36
-
* If the response is a count, we can use Poisson regression
40
+
* If the outcome is a count,
41
+
we can use Poisson regression.
37
42
38
-
* If the count has a higher variance than is consistent with the Poisson, we can use a negative binomial or over-dispersed Poisson
43
+
* If count data exhibit greater variance than assumed under the Poisson model,
44
+
we can use negative binomial regression or overdispersed Poisson models.
39
45
40
-
* Other forms of response can generate other types of generalized linear models
46
+
* Other outcome structures correspond to other families within the generalized linear model framework.
41
47
42
-
We need a linear predictor of the same form as in linear regression $\beta x$. In theory, such a linear predictor can generate any type of number as a prediction, positive, negative, or zero
48
+
In generalized linear modeling, we specify a linear predictor $\eta \eqdef \reglincomb$ of the same form as in linear regression.
49
+
In principle, a linear predictor can yield any real value,
50
+
whether positive, negative, or zero.
43
51
44
-
We choose a suitable distribution for the type of data we are predicting
45
-
(normal for any number, gamma for positive numbers, binomial for binary responses, Poisson for counts)
52
+
We then select an appropriate outcome distribution matched to the data type
53
+
(for example, Gaussian for unbounded continuous values,
54
+
gamma for positive continuous quantities,
55
+
binomial for binary outcomes,
56
+
and Poisson for counts).
46
57
47
-
We create a link function
48
-
which maps the mean of the distribution
49
-
onto the set of all possible linear prediction results,
50
-
which is the whole real line ($-\infty, \infty$).
51
-
The inverse of the link function takes the linear predictor to the actual prediction.
58
+
Finally, we specify a link function $g(\cdot)$
59
+
that maps the expected outcome $\mu \eqdef \E{Y \mid \vX = \vx}$
60
+
onto the real line $(-\infty, \infty)$ of the linear predictor.
61
+
The inverse link function $g^{-1}(\cdot)$
62
+
transforms the linear predictor back to the scale of the expected outcome.
52
63
53
-
* Ordinary linear regression has identity link (no transformation by the link function) and uses the normal distribution
64
+
* Standard linear regression uses the identity link function $g(\mu) \eqdef \mu$
65
+
and assumes a Gaussian response distribution.
54
66
55
-
* If one is predicting an inherently positive quantity, one may want to use the log link since ex is always positive.
67
+
* When predicting an inherently positive outcome,
68
+
a log link function $g(\mu) \eqdef \logf{\mu}$ is often appropriate,
69
+
since $\expf{\eta} > 0$ for all real $\eta$.
56
70
57
-
* An alternative to using a generalized linear model with a log link is to transform the outcome using the log transformation. This outcome transformation works well with positive measurement data and may be usable in other continuous cases, but it cannot be used directly for 0/1 binary data or for count data that may be 0.
71
+
* An alternative to fitting a generalized linear model with a log link
72
+
is to apply a log transformation directly to the outcome.
73
+
While log-transforming the outcome works well for positive continuous measurements,
74
+
it cannot be applied directly to binary outcomes or to count outcomes that can equal zero.
Copy file name to clipboardExpand all lines: chapters/time-to-event-models.qmd
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,9 @@ In many health sciences applications, binary outcomes are *incompletely observed
15
15
For example, if we are studying whether cancer patients experience a relapse after an initial remission,
16
16
we may not be able to follow patients to the end of their lives;
17
17
instead, we may only know whether each patient has relapsed before the end of the study.
18
-
If a patient has not relapsed by that point, we might not know if they will relapse at some other date or if they will stay cancer-free for the rest of their lives.
18
+
If a patient has not relapsed by that point,
19
+
we might not know if they will relapse at some other date
20
+
or if they will stay cancer-free for the rest of their lives.
19
21
^[Binary outcomes are typically defined *for a specific time-point*.
20
22
It is important to clearly define whether we are interested in outcome status at end of study, at end of life, or at some other time.]
21
23
Their recurrence status at end-of-life is *missing data*.
0 commit comments