---
title: "Table 1"
author: "Philip He"
date: "2024-04-16"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


After install the package, load the functions in the package.
```{r}
#(1) Install devtools if not installed. Remove # below to install the package

#install.packages("devtools")

#(2) Install BayesianHybridDesign. Remove # below to install the package

#devtools::install_github("phe9480/BayesianHybridDesign")

library(BayesianHybridDesign)
```


## Table 1

This is an R Markdown document for producing Table 1.


```{r}

pc_hat = c(0.1, 0.2, 0.3, 0.4, 0.5)

wEB1 = wEB2 = wEB3 = rep(NA, length(pc_hat))

for (i in 1:length(wEB)){
  wEB1[i] = borrow.wt(Yc=40*pc_hat[i], nc=40, Ych=200*0.3, nch=200, nche=40, 
                      a0c=0.001, b0c=0.001,
                      delta_threshold=0.1, method="Empirical Bayes")$wd
  wEB2[i] = borrow.wt(Yc=40*pc_hat[i], nc=40, Ych=200*0.3, nch=200, nche=40, 
                      a0c=0.5, b0c=0.5,
                      delta_threshold=0.1, method="Empirical Bayes")$wd
  wEB3[i] = borrow.wt(Yc=40*pc_hat[i], nc=40, Ych=200*0.3, nch=200, nche=40, 
                      a0c=1, b0c=1,
                      delta_threshold=0.1, method="Empirical Bayes")$wd
}

round(cbind(wEB1, wEB2, wEB3), 3)
```
