-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcount-vars.qmd
135 lines (86 loc) · 2.83 KB
/
count-vars.qmd
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
:::{#def-count}
#### Count variable
A **count variable** is a random variable whose possible values are some subset of the non-negative integers; that is, a random variable $X$ such that:
$$\rangef{X} \in \Nat$$
:::
---
::: {#exr-count-examples}
What are some examples of count variables?
:::
---
::: solution
{{< include exm-count-vars.qmd >}}
:::
---
#### Exposure magnitude
:::{#def-exposure}
##### Exposure magnitude
For many count outcomes,
there is some sense of
**exposure magnitude**,
**population size**, or
**duration of observation**.
:::
---
:::{#exr-exposure-magnitude}
What are some examples of exposure magnitudes?
:::
---
::: {.solution .smaller}
outcome | exposure units
-----------------------------| -------------
disease incidence | number of individuals exposed; time at risk
car accidents | miles driven
worksite accidents | person-hours worked
population size | size of habitat
: Examples of exposure units {#tbl-exposure-units}
:::
:::: notes
Exposure units are similar to
the number of trials in a binomial distribution,
but **in non-binomial count outcomes, there can be more than one event per unit of exposure**.
We can use $t$ to represent continuous-valued exposures/observation durations,
and $n$ to represent discrete-valued exposures.
::::
---
::: {#def-event-rate}
#### Event rate
:::: notes
For a count outcome $Y$ with exposure magnitude $t$,
the **event rate** (denoted $\lambda$)
is defined as the mean of $Y$ divided by the the exposure magnitude.
That is:
::::
$$\mu \eqdef \Expp[Y|T=t]$$
$$\lambda \defeq \frac{\mu}{t}$$ {#eq-def-event-rate}
:::
::: notes
Event rate is somewhat analogous to odds in binary outcome models;
it typically serves as an intermediate transformation between the mean of the outcome and the linear component of the model.
However, in contrast with the odds function, the transformation $\lambda = \mu/t$ is *not* considered part of the Poisson model's link function, and it treats the exposure magnitude covariate differently from the other covariates.
:::
---
:::{#thm-mean-vs-event-rate}
#### Transformation function from event rate to mean
For a count variable with mean $\mu$, event rate $\lambda$, and exposure magnitude $t$:
$$\tf \mu = \lambda \cdot t$${#eq-lambda-to-mu}
:::
---
::: solution
Start from definition of event rate and use algebra to solve for $\mu$.
:::
---
@eq-lambda-to-mu is analogous to the inverse-odds function for binary variables.
---
::: {#thm-non-exposed}
When the exposure magnitude is 0, there is no opportunity for events to occur:
$$\Expp[Y|T=0] = 0$$
:::
---
::: proof
$$\Expp[Y|T=0] = \lambda \cdot 0 = 0$$
:::
---
#### Probability distributions for count outcomes
- [Poisson distribution](#sec-poisson-dist)
- [Negative binomial distribution](#sec-nb-dist)