R/print.qtest.mvmeta.R

Defines functions print.qtest.mvmeta

Documented in print.qtest.mvmeta

###
### R routines for the R package mvmeta (c)
#
print.qtest.mvmeta <-
function(x, digits=3, ...) {
#
################################################################################
# 
  # FORMAT
  signif <- symnum(x$pvalue,corr=FALSE,na=FALSE,cutpoints=c(0, 
    0.001,0.01,0.05,0.1,1),symbols=c("***","**","*", ".", " "))
  Q <- formatC(x$Q,digits=digits,format="f")
  pvalue <- formatC(x$pvalue,digits=digits,format="f")
  table <- cbind(Q,df=x$df,"p-value"=pvalue,signif)
  colnames(table)[4] <- ""
#
  # PRINT
  cat(if(x$k==1L) "Uni" else "Multi","variate ","Cochran Q-test for ",
    if(x$residual) "residual ", "heterogeneity","\n",sep="")
  if(x$k>1L) cat("\nOverall test:","\n")
  cat("Q = ",Q[1]," (df = ",x$df[1],"), p-value = ",pvalue[1],"\n",sep="")
  if(x$k>1L) {
    cat("\nTests on single outcome parameters:","\n")
    print(table[-1,,drop=FALSE],quote=FALSE,right=TRUE,print.gap=2)
    cat("---\nSignif. codes: ", attr(signif, "legend"), "\n")
  }
  cat("\n")
}

Try the mvmeta package in your browser

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

mvmeta documentation built on Dec. 10, 2019, 5:07 p.m.