Learn R Programming

gets (version 0.22)

printtex: Generate LaTeX code of an estimation result

Description

Convenience function that generates LaTeX-code of an estimation result (e.g. an arx-object, gets-object or isat-object) in equation-form. Can, in principle, be applied to any object for which coef, vcov and logLik methods exist. Note: The generated LaTeX-code contains an eqnarray environment, which requires that the amsmath package is loaded in the preamble of the LaTeX document.

Usage

printtex(x, fitted.name=NULL, xreg.names=NULL, digits=3,
    intercept=TRUE, gof=TRUE, diagnostics=TRUE)

Arguments

x

an estimation result, e.g. arx, gets or isat object

fitted.name

name of left-hand side variable

xreg.names

names of regressors

digits

number of digits to be printed

intercept

whether one of the regressors is an intercept or not, or its location. If TRUE, then the intercept is assumed to be located at coef(x)[1], and hence the regressor-name of location 1 is excluded from the print. If FALSE, then it is assumed that there is no intercept among the regressors. If numeric, then it is assumed that the regressors contain an intercept at the location equal to the numeric value

gof

logical, whether to include goodness-of-fit in the print

diagnostics

logical, whether to include diagnostics in the print

Value

LaTeX code of an estimation result

See Also

arx, getsm, getsv, isat

Examples

Run this code
# NOT RUN {
##simulate random variates, estimate model:
y <- rnorm(30)
mX <- matrix(rnorm(30*2), 30, 2)
mymod <- arx(y, mc=TRUE, ar=1:3, mxreg=mX)

##print latex code of estimation result:
printtex(mymod)

##add intercept, at the end, to regressor matrix:
mX <- cbind(mX,1)
colnames(mX) <- c("xreg1", "xreg2", "intercept")
mymod <- arx(y, mxreg=mX)

##set intercept location to 3:
printtex(mymod, intercept=3)

# }

Run the code above in your browser using DataLab