Nothing
#' Update seqtest
#'
#' This function updates the \code{seqtest} object
#'
#' @param object \code{cor.seqtest} object.
#' @param x data for group 1.
#' @param y data for group 2.
#' @param initial logical, used internally for creating a \code{seqtest} object
#' @param output logical: if \code{TRUE}, output is shown.
#' @param plot logical: if \code{TRUE}, plot is shown.
#' @param ... further arguments passed to or from other methods.
#'
#' @author
#' Takuya Yanagida \email{takuya.yanagida@@univie.ac.at}
#'
#' @seealso
#' \code{\link{seqtest.cor}},
#'
#' @references
#' Rasch, D., Pilz, J., Verdooren, L. R., & Gebhardt, G. (2011).
#' \emph{Optimal experimental design with R}. Boca Raton: Chapman & Hall/CRC.
#'
#' Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). \emph{Statistics in psychology - Using R and SPSS}.
#' New York: John Wiley & Sons.
#'
#' Schneider, B., Rasch, D., Kubinger, K. D., & Yanagida, T. (2015).
#' A Sequential triangular test of a correlation coefficient's null-hypothesis: 0 \eqn{< \rho \le \rho}0.
#' \emph{Statistical Papers, 56}, 689-699.
#'
#' @method update seqtest
#'
#' @export
#'
#' @examples
#' #--------------------------------------
#' # Sequential triangular test for the product-moment correlation coefficient
#'
#' seq.obj <- seqtest.cor(0.46, k = 14, rho = 0.3, delta = 0.2,
#' alpha = 0.05, beta = 0.2, plot = TRUE)
#'
#' seq.obj <- update(seq.obj, c(0.56, 0.76, 0.56, 0.52))
update.seqtest <- function(object, x = NULL, y = NULL, initial = FALSE, output = TRUE, plot = TRUE, ...) {
#-----------------------------------------------------------------------------------
# Input check
if (!inherits(object, "seqtest")) {
stop("Object is not a seqtest object")
}
###
if (object$res$decision != "continue") {
stop("Sequential triangular test is already finished")
}
###
if (object$type == "cor") {
if (any(x < -1) || any(x > 1)) {
stop("Correlation coefficient out of bound, only values between -1 and 1 are allowed for x")
}
}
#-----------------------------------------------------------------------------------
# Main function
# seqtest.cor
if (object$type == "cor") {
print.step <- 0
print.max <- length(x)
for (x.i in x) {
print.step <- print.step + 1
object <- internal.seqtest.cor(object, x = x.i, initial = TRUE,
print.step = print.step, print.max = print.max, output = output, plot = plot)
if (object$res$decision != "continue") break
}
}
#-----------------------------------------------------------------------------------
return(invisible(object))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.