% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multiplicity.R
\name{fseqbon}
\alias{fseqbon}
\title{Group Sequential Trials Using Bonferroni-Based Graphical
Approaches}
\usage{
fseqbon(
  w,
  G,
  alpha = 0.025,
  kMax,
  typeAlphaSpending = NULL,
  parameterAlphaSpending = NULL,
  maxInformation = NULL,
  incidenceMatrix = NULL,
  k1,
  p,
  information,
  spendingTime = NULL,
  nthreads = 0
)
}
\arguments{
\item{w}{The vector of initial weights for elementary hypotheses.}

\item{G}{The initial transition matrix.}

\item{alpha}{The significance level. Defaults to 0.025.}

\item{kMax}{The maximum number of stages.}

\item{typeAlphaSpending}{The vector of alpha spending functions for
the hypotheses. Each element is one of the following:
\code{"sfOF"} for O'Brien-Fleming type spending function,
\code{"sfP"} for Pocock type spending function,
\code{"sfKD"} for Kim & DeMets spending function,
\code{"sfHSD"} for Hwang, Shi & DeCani spending function.
Defaults to \code{"sfOF"} if not provided.}

\item{parameterAlphaSpending}{The vector of parameter values for the
alpha spending functions for the hypotheses. Each element corresponds
to the value of \eqn{\rho} for \code{"sfKD"} or
\eqn{\gamma} for \code{"sfHSD"}.
Defaults to missing if not provided.}

\item{maxInformation}{The vector of target maximum information for each
hypothesis. Defaults to a vector of 1s if not provided.}

\item{incidenceMatrix}{The \code{kMax x m} incidence matrix indicating
whether the specific hypothesis will be tested at the given look.
If not provided, defaults to testing each hypothesis at all study looks.}

\item{k1}{The number of study looks at the interim analysis.}

\item{p}{The matrix of raw p-values for each hypothesis by study look.}

\item{information}{The matrix of observed information for each hypothesis
by study look.}

\item{spendingTime}{The spending time for alpha spending by study look.
If not provided, it is the same as \code{informationRates} calculated
from \code{information} and \code{maxInformation}.}

\item{nthreads}{The number of threads to use in simulations (0 means
the default RcppParallel behavior).}
}
\value{
A vector to indicate the first look the specific hypothesis is
rejected (0 if the hypothesis is not rejected).
}
\description{
Obtains the test results for group sequential trials using
graphical approaches based on weighted Bonferroni tests.
}
\examples{

# Case study from Maurer & Bretz (2013)

fseqbon(
  w = c(0.5, 0.5, 0, 0),
  G = matrix(c(0, 0.5, 0.5, 0,  0.5, 0, 0, 0.5,
               0, 1, 0, 0,  1, 0, 0, 0),
             nrow=4, ncol=4, byrow=TRUE),
  alpha = 0.025,
  kMax = 3,
  typeAlphaSpending = rep("sfOF", 4),
  maxInformation = rep(1, 4),
  k1 = 2,
  p = matrix(c(0.0062, 0.017, 0.009, 0.13,
               0.0002, 0.0035, 0.002, 0.06),
             nrow=2, ncol=4, byrow=TRUE),
  information = matrix(c(rep(1/3, 4), rep(2/3, 4)),
                       nrow=2, ncol=4, byrow=TRUE),
  nthreads = 1)


}
\references{
Willi Maurer and Frank Bretz. Multiple testing in group sequential
trials using graphical approaches. Statistics in Biopharmaceutical
Research. 2013; 5:311-320.
}
\author{
Kaifeng Lu, \email{kaifenglu@gmail.com}
}
