R/BF.coeftest.R

Defines functions BF.coeftest

#BF method for coeftest class objects

#' @method BF coeftest
#' @export
BF.coeftest <- function(x,
                     hypothesis = NULL,
                     prior.hyp = NULL,
                     complement = TRUE,
                     ...){

  Sigma <- diag(x[, 2L]^2)
  n <- attr(x, "nobs")

  if(is.null(n)) stop("'BF.coeftest' only works if 'nobs.coeftest' gives the number of observations.")
  if(!is.null(hypothesis)) warning("constrained hypothesis testing is not supported for objects of class 'coeftest'")
  if(!is.null(prior.hyp)) warning("prior specification via 'prior.hyp' is not supported for objects of class 'coeftest'")
  #if(!exploratory) stop("only exploratory hypothesis testing is supported for objects of class 'coeftest'")

  out <- BF.default(x[, 1L], Sigma = Sigma, n = n, ...)
  out$model <- x
  out$call <- match.call()
  out

}

Try the BFpack package in your browser

Any scripts or data that you put into this service are public.

BFpack documentation built on Oct. 20, 2023, 5:09 p.m.