-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path_sec_pois-reg_intro.qmd
More file actions
121 lines (97 loc) · 2.75 KB
/
Copy path_sec_pois-reg_intro.qmd
File metadata and controls
121 lines (97 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{{< include latex-macros/macros.qmd >}}
::: notes
This chapter presents models for
[count data](data.qmd#sec-count-vars) outcomes.
With covariates,
the event rate $\lambda$
becomes a function of the covariate vector
$\vX = \tp{(X_1, \dots, X_p)} \in \reals^p$.
Typically, count data models use
a $\logf{}$ link function,
and thus an $\exp{}$ inverse-link function.
Specifically, the model relates the expected outcome count
to the event rate and linear predictor as:
:::
$$
\ba
\Expp[Y \mid \vX = \vx, T = t] &= \mu(\vx,t) \\
\mu(\vx,t) &= \lambda(\vx)\cdot t \\
\lambda(\vx) &= \exp{\eta(\vx)} \\
\eta(\vx) &= \beta_0 + \beta_1 x_1 + \dots + \beta_p x_p
\ea
$${#eq-mean-poisson}
::: notes
The term $T=t$ represents the [exposure magnitude](probability.qmd#def-exposure)
(such as person-years or observation time)
and plays a structural role in scaling rates to expected counts.
:::
---
:::{#exr-analogy-pois-offset-binom}
Where have we seen a relationship like
$$\mu = \lambda \cdot t$$
before?
:::
---
:::{#sol-analogy-pois-offset-binom}
The relationship
$$\mu = \lambda \cdot t$$
in count regression models
is analogous to the relationship
$$\mu = n \pi$$
in Binomial models.
:::
---
::: notes
We can also express the exposure magnitude $t$
directly as a component of the linear predictor:
:::
$$
\ba
\logf{\Expp[Y \mid \vX = \vx, T = t]}
&= \logf{\mu(\vx, t)} \\
&\quad \text{(definition of the conditional mean)} \\
&= \logf{\lambda(\vx) \cdot t} \\
&\quad \text{(substituting the rate relationship)} \\
&= \logf{\lambda(\vx)} + \logf{t} \\
&\quad \text{(logarithmic product rule)} \\
&= \logf{\exp{\eta(\vx)}} + \logf{t} \\
&\quad \text{(substituting the rate function)} \\
&= \eta(\vx) + \logf{t} \\
&\quad \text{(by inverse relationship of log and exp)} \\
&= (\beta_0 + \beta_1 x_1 + \dots + \beta_p x_p) + \logf{t} \\
&\quad \text{(expanding the linear predictor } \eta(\vx)\text{)}
\ea
$$
::: notes
In contrast with the other covariates (represented by $\vX$),
$t$ enters this expression with a $\log{}$ transformation
and without an estimated $\beta$ coefficient;
in other words, $\logf{t}$ is an [offset term](probability.qmd#def-offset).
:::
---
:::{#exr-eq-mean-poisson}
What are the units of $\mu$ in @eq-mean-poisson?
:::
---
:::{#sol-eq-mean-poisson}
$\mu$ is the expected value of $Y$.
Because $Y$ represents a count of events,
$\mu$ is expressed in units of event counts;
for example:
- 3.1 cyclones,
- 10.23 ER visits,
- 15.01 infections.
:::
---
:::{#exr-eq-rate-poisson}
What are the units of $\lambda$ in @eq-mean-poisson?
:::
---
:::{#sol-eq-rate-poisson}
$\lambda = \mu/t$,
so $\lambda$ is an event rate per unit of exposure $t$.
For example:
- 3.1 cyclones *per year*,
- 2.023 ER visits per 10 person-years,
- 15.01 infections per 1000 person-years at risk.
:::