-
Notifications
You must be signed in to change notification settings - Fork 36
/
proportions.Rmd
34 lines (26 loc) · 972 Bytes
/
proportions.Rmd
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
# Proportions
## Beta Regression
This is for a response variable that is a proportion, $y_i \in (0, 1)$,
$$
y_i \sim \dbeta(\alpha_i, \beta_i)
$$
and
$$
\begin{aligned}[t]
\mu_i &= g^{-1}(\vec{x}_i' \vec{\gamma}) \\
\alpha_i &= \mu_i \phi \\
\beta_i &= (1 - \mu_i) \phi
\end{aligned}
$$
Additionally, the $\phi$ parameter could also be modeled.
In Stan:
- `beta(y | alpha, beta)` with positive prior successes plus one,
$\alpha > 0$, and negative prior failures plus one, $\beta > 0$.
Then $\E(Y) = \alpha / (\alpha + \beta)$ and
$\Var(Y) = \alpha\beta / ((\alpha + \beta)^2 (\alpha + \beta + 1))$.
**rstanarm** function `r rdoc("rstasnarm", "stan_betareg")`
See:
- @FerrariCribari-Neto2004a, @Cribari-NetoZeileis2010a, and
@GruenKosmidisZeileis2012a on beta regression.
- **rstanarm** documentation [Modeling Rates/Proportions using beta
regression with rstanarm](https://cran.r-project.org/web/packages/rstanarm/vignettes/betareg.html)