Learn R Programming

relevance (version 2.1)

print.inference: Print Tables with Inference Measures

Description

Print methods for objects of class "inference", "termtable", "termeffects", or "printInference".

Usage

# S3 method for inference
print(x, show = getOption("show.inference"), print=TRUE,
  digits = getOption("digits.reduced"), transpose.ok = TRUE,
  legend = NULL, na.print = getOption("na.print"), ...)

# S3 method for termtable print(x, show = getOption("show.inference"), ...)

# S3 method for termeffects print(x, show = getOption("show.inference"), transpose.ok = TRUE, single = FALSE, print = TRUE, warn = TRUE, ...)

# S3 method for printInference print(x, ...)

Value

A kind of formatted version of x, with class

printInference. For print.inference, it will be a character vector or a data.frame with attributes

head and tail if applicable. For print.termeffects, it will be a list of such elements, with its own head and tail. It is invisibly returned.

Arguments

x

object to be printed

show

determines items (columns) to be shown

digits

number of significant digits to be printed

transpose.ok

logical: May a single column be shown as a row?

single

logical: Should components with a single coefficient be printed?

legend

logical: should the legend(s) for the symbols characterizing p-values and relevances be printed? Defaults to regroptions("show.symbolLegend").

na.print

string by which NAs are shown

print

logical: if FALSE, no printing will occur, used to edit the result before printing it.

warn

logical: Should the warning be issued if termeffects has nothing to print since there are no terms with more than one degree of freedom

...

further arguments, passed to print.data.frame().

Author

Werner A. Stahel

Details

The value, if assigned to rr, say, can be printed by using print.printInference, writing print(rr), which is just what happens internally unless print=FALSE is used. This allows for editing the result before printing it, see Examples.

printInference objects can be a vector, a data.frame or a matrix, or a list of such items. Each item can have an attribute head of mode character that is printed by cat before the item, and analogous with a tail attribute.

See Also

twosamples, termtable, termeffects, inference.

Examples

Run this code
data(d.blast)
r.blast <-
  lm(log10(tremor)~location+log10(distance)+log10(charge), data=d.blast)
rt <- termtable(r.blast)
## print() : first default, then "classical" :
rt
print(rt, show="classical")

class(te <- termeffects(r.blast)) #  "termeffects"
rr <- print(te, print=FALSE)
attr(rr, "head") <- sub("lm", "Linear Regression", attr(rr, "head"))
class(rr) # "printInference"
rr # <==>  print(rr)

str(rr)

Run the code above in your browser using DataLab