printCoefmat              package:stats              R Documentation

_P_r_i_n_t _C_o_e_f_f_i_c_i_e_n_t _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Utility function to be used in "higher level" 'print' methods,
     such as 'print.summary.lm', 'print.summary.glm' and 'print.anova'.
      The goal is to provide a flexible interface with smart defaults
     such that often, only 'x' needs to be specified.

_U_s_a_g_e:

     printCoefmat(x, digits=max(3, getOption("digits") - 2),
                  signif.stars = getOption("show.signif.stars"),
                  signif.legend = signif.stars,
                  dig.tst = max(1, min(5, digits - 1)),
                  cs.ind = 1:k, tst.ind = k + 1, zap.ind = integer(0),
                  P.values = NULL,
                  has.Pvalue = nc >= 4 &&
                               substr(colnames(x)[nc],1,3) == "Pr(",
                  eps.Pvalue = .Machine$double.eps,
                  na.print = "NA", ...)

_A_r_g_u_m_e_n_t_s:

       x: a numeric matrix like object, to be printed.

  digits: minimum number of significant digits to be used for most
          numbers.

signif.stars: logical; if 'TRUE', P-values are additionally encoded
          visually as "significance stars" in order to help scanning of
          long coefficient tables.  It defaults to the
          'show.signif.stars' slot of 'options'.

signif.legend: logical; if 'TRUE', a legend for the  "significance
          stars" is printed provided 'signif.stars=TRUE'.

 dig.tst: minimum number of significant digits for the test statistics,
          see 'tst.ind'.

  cs.ind: indices (integer) of column numbers which are (like)
          *c*oefficients and *s*tandard errors to be formatted
          together.

 tst.ind: indices (integer) of column numbers for test statistics.

 zap.ind: indices (integer) of column numbers which should be formatted
          by 'zapsmall', i.e., by "zapping" values close to 0.

P.values: logical or 'NULL'; if 'TRUE', the last column of 'x' is
          formatted by 'format.pval' as P values.  If 'P.values =
          NULL', the default, it is set to 'TRUE' only if
          'options("show.coef.Pvalue")' is 'TRUE' _and_ 'x' has at
          least 4 columns _and_ the last column name of 'x' starts with
          '"Pr("'.

has.Pvalue: logical; if 'TRUE', the last column of 'x' contains P
          values; in that case, it is printed if and only if 'P.values'
          (above) is true.

eps.Pvalue: number,..

na.print: a character string to code 'NA' values in printed output.

     ...: further arguments for 'print'.

_V_a_l_u_e:

     Invisibly returns its argument, 'x'.

_A_u_t_h_o_r(_s):

     Martin Maechler

_S_e_e _A_l_s_o:

     'print.summary.lm', 'format.pval', 'format'.

_E_x_a_m_p_l_e_s:

     cmat <- cbind(rnorm(3, 10), sqrt(rchisq(3, 12)))
     cmat <- cbind(cmat, cmat[,1]/cmat[,2])
     cmat <- cbind(cmat, 2*pnorm(-cmat[,3]))
     colnames(cmat) <- c("Estimate", "Std.Err", "Z value", "Pr(>z)")
     printCoefmat(cmat[,1:3])
     printCoefmat(cmat)
     options(show.coef.Pvalues = FALSE)
     printCoefmat(cmat, digits=2)
     printCoefmat(cmat, digits=2, P.values = TRUE)
     options(show.coef.Pvalues = TRUE)# revert

