File: print.eco.R

package info (click to toggle)
r-cran-eco 4.0-1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 772 kB
  • sloc: ansic: 4,214; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
print.eco <- function(x, digits = max(3, getOption("digits") -3),
                      ...){ 
  cat("\nCall:\n", deparse(x$call), "\n\n", sep="")
  
  if (is.null(x$N))
    N <- rep(1, nrow(x$X))
  else N <- x$N

  W.mean <- cbind(mean(x$W[,1,] %*% (x$X*N/sum(x$X*N))),
                  mean(x$W[,2,] %*% ((1-x$X)*N/sum((1-x$X)*N))))
  colnames(W.mean) <- c("W1", "W2")
  rownames(W.mean) <- "posterior mean"
  
  cat("Aggregate In-sample Estimates:\n\n")
  print.default(format(W.mean, digits = digits), print.gap = 2, quote =
                FALSE)
  cat("\n")
  invisible(x)
}