% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fahb_analysis.R
\name{fahb_analysis}
\alias{fahb_analysis}
\title{Build a \code{fahb} analysis object}
\usage{
fahb_analysis(n_pilot, t_pilot, problem, site_t = NULL, bayes_model = NULL)
}
\arguments{
\item{n_pilot}{integer vector of numbers recruited at each open site.}

\item{t_pilot}{numeric vector of time (in years) each site has been open.}

\item{problem}{object of class \code{fahb_problem}.}

\item{site_t}{In the case of an external pilot, the time taken for all
pilot sites to open.}

\item{bayes_model}{optional object of class \code{brmsfit} which will be used in
the Bayesian analysis via \code{brms::update()} to avoid compiling a new model.}
}
\value{
An object of class \code{fahb_analysis}.
}
\description{
Given a \code{fahb_problem} object calculate summary statistics which can inform
progression decisions. These include both standard progression criteria
statistics, and the expectation of the posterior predictive distribution of
the time until the trial recruits.
}
\examples{
## Example illustrating a full analysis workflow
## (Not run on CRAN due to Bayesian model fitting)

\donttest{
problem <- fahb_problem()
problem <- forecast(problem)

## Pilot trial data
n_pilot <- c(3, 5, 2)
t_pilot <- c(0.5, 0.6, 0.4)

analysis <- fahb_analysis(
  n_pilot = n_pilot,
  t_pilot = t_pilot,
  problem = problem
)

print(analysis)
plot(analysis)
}
}
