coefs.table: Create Table of Coefficients

View source: R/g.prints.R

coefs.tableR Documentation

Create Table of Coefficients

Description

This function summarizes a list of estimated models (output of estim.? functions) and creates a table of coefficients.

Usage

coefs.table(
  estimList,
  depList = NULL,
  tableFun = "coef_star",
  formatNumFun = NULL,
  regInfo = NULL,
  textFun = NULL,
  textFun_sub = NULL,
  textFun_max = 20,
  expList = NA,
  latex = TRUE,
  numFormat = "%.2f"
)

Arguments

estimList

A named list where each element is output from a estim.? function, all belonging to a common analysis.

depList

List of endogenous variable name to be included in the columns of the table. If NULL, everything is added.

tableFun

Function with arguments coef, std, pvalue, minInColm, maxInCol for formatting estimated coefficients. Can also use one of the following character strings for predefined formatting: sign, sign_star, coef, coef_star, coef_star_std.

formatNumFun

Function to format numbers if tableFun uses predefined formatting. It takes two arguments: colIndex (determines the column index) and x (determines the value).

regInfo

List of keys (such as num_eq, num_dep, ...) to determine information at bottom of table. Use "" (empty) for empty rows. A list of available options is given in the details section.

textFun

Function to change any text in columns or rows of the table to a more informative text. It has two arguments: text and type.

textFun_sub

List for replacing special characters. If NULL, 'list(c("%", "\\%"), c("", "\\"))' is used.

textFun_max

Maximum length for texts in the table.

expList

Determines the name of the explanatory variables to insert in table. If NA, it inserts all coefficients. If it is an integer, it insert that number of explanatory variables in the table. It can be a list of available explanatory variables. Use ... for empty rows.

latex

If TRUE, default options are for 'latex', otherwise, 'html'.

numFormat

default formatting for the numbers.

Details

The first part of the table is the header, followed by the coefficients. At the bottom, you can insert the following items by specifying regInfo:

  • An empty character string (i.e., "") for inserting empty line.

  • "sigma2" for the covariance of regression, if it is available.

  • An available metric name in the row names of estimList[[...]]$metrics.

Furthermore, second argument in textFun can be:

  • hname: shows that the text is a header name from the estimList elements.

  • dname: shows that the text is an endogenous variable name from the columns of coefs matrix.

  • rname: shows that the text is a key given in regInfo.

  • ename: shows that the text is an explanatory variable name from the rows of coefs matrix.

  • NULL: shows that the text is a specific code or something else.

Value

A data frame with (formatted) requested information.

Examples

# See 'search.?' or 'estim.?' functions for some examples.


ldt documentation built on Sept. 11, 2024, 5:25 p.m.