R/Q.R

Defines functions Q

Documented in Q

#' Q test statistics
#'
#' This function calculates the Q test quantity.
#'
#' @param beta The original or the simulated estimated effects.
#' @param se2 The squared standard errors of the estimated effects.
#' @param barbeta The estimated true underlying effect.
#' @param phi2 The value of the hyperparameter phi.
#' @param m The number of replications
#'
#' @return The Q test statistic value
#'
#' @export
#' @keywords internal
#'
Q <- function(beta,se2,barbeta,phi2,m){
  q_test = sum((beta - barbeta)^2 / (se2 + phi2))
  return(q_test)
}

Try the PRP package in your browser

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

PRP documentation built on Dec. 13, 2021, 9:06 a.m.