two.grp.fixed.a0 {BayesPPD} | R Documentation |
Model fitting for two groups (treatment and control group, no covariates) with fixed a0
Description
Model fitting using power priors for two groups (treatment and control group, no covariates) with fixed
Usage
two.grp.fixed.a0(
data.type,
y.c,
n.c,
v.c,
historical = matrix(0, 1, 4),
prior.mu.c.shape1 = 1,
prior.mu.c.shape2 = 1,
nMC = 10000,
nBI = 250
)
Arguments
data.type |
Character string specifying the type of response. The options are "Normal", "Bernoulli", "Poisson" and "Exponential". |
y.c |
Sum of responses for the control group. |
n.c |
Sample size of the control group. |
v.c |
(For normal data only) sample variance of responses for the control group. |
historical |
(Optional) matrix of historical dataset(s). If
For all other data types,
Each row represents a historical dataset. |
prior.mu.c.shape1 |
First hyperparameter of the initial prior for |
prior.mu.c.shape2 |
Second hyperparameter of the initial prior for |
nMC |
(For normal data only) number of iterations (excluding burn-in samples) for the Gibbs sampler. The default is 10,000. |
nBI |
(For normal data only) number of burn-in samples for the Gibbs sampler. The default is 250. |
Details
The power prior is applied on the data of the control group only. Therefore, only summaries of the responses of the control group need to be entered.
If data.type
is "Bernoulli", "Poisson" or "Exponential", a single response from the treatment group is assumed to follow Bern(), Pois(
) or Exp(rate=
), respectively,
where
is the mean of responses for the treatment group. The distributional assumptions for the control group data are analogous.
If data.type
is "Bernoulli", the initial prior for is beta(
prior.mu.t.shape1
, prior.mu.t.shape2
).
If data.type
is "Poisson", the initial prior for is Gamma(
prior.mu.t.shape1
, rate=prior.mu.t.shape2
).
If data.type
is "Exponential", the initial prior for is Gamma(
prior.mu.t.shape1
, rate=prior.mu.t.shape2
).
The initial priors used for the control group data are analogous.
If data.type
is "Normal", the responses are assumed to follow where
is the mean of responses for the control group
and
is the precision parameter. Each historical dataset
is assumed to have a different precision parameter
.
The initial prior for
is the Jeffery's prior,
, and the initial prior for
is
. The initial prior for the
is the uniform improper prior.
Posterior samples are obtained through Gibbs sampling.
Value
The function returns a S3 object with a summary
method. If data.type
is "Normal", posterior samples of ,
and
's (if historical data is given) are returned
in the list item named
posterior.params
.
For all other data types, two scalars, and
, are returned in the list item named
posterior.params
, representing the two parameters of the posterior distribution of .
For Bernoulli responses, the posterior distribution of
is beta(
,
).
For Poisson responses, the posterior distribution of
is Gamma(
,
) where
is the rate parameter.
For exponential responses, the posterior distribution of
is Gamma(
,
) where
is the rate parameter.
References
Chen, Ming-Hui, et al. "Bayesian design of noninferiority trials for medical devices using historical data." Biometrics 67.3 (2011): 1163-1170.
See Also
Examples
data.type <- "Bernoulli"
y.c <- 70
n.c <- 100
# Simulate three historical datasets
historical <- matrix(0, ncol=3, nrow=3)
historical[1,] <- c(70, 100, 0.3)
historical[2,] <- c(60, 100, 0.5)
historical[3,] <- c(50, 100, 0.7)
set.seed(1)
result <- two.grp.fixed.a0(data.type=data.type, y.c=y.c, n.c=n.c, historical=historical)
summary(result)