Skip to content

Commit

Permalink
Add Bayesian CI code
Browse files Browse the repository at this point in the history
  • Loading branch information
jarad committed Oct 7, 2024
1 parent 177efb6 commit 1b72d71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ library("plyr")
library("dplyr")
library("tidyr")
library("ggplot2")
theme_set(theme_bw())
@

<<set_seed, echo=FALSE>>=
Expand Down Expand Up @@ -255,8 +256,7 @@ ggplot(d, aes(z_crit, t_crit, group=n, linetype=n, color=n)) +
geom_line() +
geom_abline(intercept = 0, slope = 1, color='gray') +
# coord_fixed() +
labs(x = "z critical values", y = "t critical values") +
theme_bw()
labs(x = "z critical values", y = "t critical values")
@

\end{frame}
Expand Down Expand Up @@ -323,7 +323,11 @@ Y_i \ind Ber(\theta) & \theta & \hat\theta=\overline{y} & \hat{\theta} \pm z_{a/

\vspace{0.1in} \pause

Bayesian credible intervals generally provide approximate confidence intervals.
The Bayesian credible intervals we discuss provide approximate confidence intervals. For example, for binomial data the following is an approximate confidence interval:

<<binomial-credible-interval, eval=FALSE, echo=TRUE>>=
qbeta(c(a/2, 1-a/2), 1 + y, 1 + n - y)
@

\vspace{0.1in} \pause

Expand Down
Binary file not shown.

0 comments on commit 1b72d71

Please sign in to comment.