print.wald: Print method for wald objects

Usage Arguments Examples

View source: R/wald.R

Usage

1
print.wald(x, round = 6, pround = 5, ...)

Arguments

x
round
pround
...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, round = 6, pround = 5, ...) 
{
    pformat <- function(x, digits = pround) {
        x <- format(xx <- round(x, digits))
        x[as.double(xx) == 0] <- paste(c("<.", rep("0", digits - 
            1), "1"), collapse = "")
        x
    }
    rnd <- function(x, digits) {
        if (is.numeric(x)) 
            x <- round(x, digits = digits)
        format(x)
    }
    for (ii in 1:length(x)) {
        nn <- names(x)[ii]
        tt <- x[[ii]]
        ta <- tt$anova
        ta[["p-value"]] <- pformat(ta[["p-value"]])
        print(as.data.frame(ta, row.names = nn))
        te <- tt$estimate
        rowlab <- attr(te, "labs")
        te[, "p-value"] <- pformat(te[, "p-value"])
        if (!is.null(round)) {
            for (ii in 1:length(te)) {
                te[[ii]] <- rnd(te[[ii]], digits = round)
            }
        }
        labs(te) <- rowlab
        print(te, digits = round, ...)
        cat("\n")
    }
    invisible(x)
  }

gmonette/spida documentation built on May 17, 2019, 7:25 a.m.