print.coefmat              package:base              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:

     print.coefmat(x, digits=max(3, getOption("digits") - 2),
                   signif.stars = getOption("show.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(",
                   na.print = "", ...)

_A_r_g_u_m_e_n_t_s:

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

  digits: number of 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(.)'.

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

  cs.ind: indices (integer) of column numbers which are (like)
          coefficients and standard 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
          `link{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 iff `P.values' (above).

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

     ...: Further arguments for `print(..)'.

_D_e_t_a_i_l_s:

     Despite its name, this is not (yet) a method for the generic
     `print' function, because there is no class `"coefmat"'.

_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)")
     print.coefmat(cmat[,1:3])
     print.coefmat(cmat)
     options(show.coef.Pvalues = FALSE)
     print.coefmat(cmat, digits=2)
     print.coefmat(cmat, digits=2, P.values = TRUE)
     options(show.coef.Pvalues = TRUE)# revert

