res2tex: Facility to export the results of multiple 'femlm'...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/MiscFuns.R

Description

This function aggregates the results of multiple estimations and display them in the form of one Latex table whose rownames are the variables and the columns contain the coefficients and standard-errors.

Usage

1
2
3
4
5
6
res2tex(..., se = c("standard", "white", "cluster", "twoway", "threeway",
  "fourway"), cluster, digits = 4, pseudo = TRUE, title, sdBelow = TRUE,
  drop, order, dict, file, append = TRUE, convergence = FALSE,
  signifCode = c(`***` = 0.01, `**` = 0.05, `*` = 0.1), label, aic = FALSE,
  sqCor = FALSE, subtitles, showClusterSize = FALSE, bic = TRUE,
  loglik = TRUE, yesNoCluster = c("Yes", "No"), keepFactors = FALSE)

Arguments

...

Used to capture different femlm objects. Note that any other type of element is discarded. Note that you can give a list of femlm objects.

se

Character scalar. Which kind of standard error should be prompted: “standard” (default), “White”, “cluster”, “twoway”, “threeway” or “fourway”?

cluster

A list of vectors. Used only if se="cluster", “se=twoway”, “se=threeway” or “se=fourway”. The vectors should give the cluster of each observation. Note that if the estimation was run using cluster, the standard error is automatically clustered along the cluster given in femlm. For one-way clustering, this argument can directly be a vector (instead of a list).

digits

Integer. The number of digits to be displayed.

pseudo

Logical, default is TRUE. Should the pseudo R2 be displayed?

title

Character scalar. The title of the Latex table.

sdBelow

Logical, default is TRUE. Should the standard-errors be displayed below the coefficients?

drop

Character vector. This element is used if some variables are not to be displayed. This should be a regular expression (see regex help for more info). There can be more than one regular expression. Each variable satisfying the regular expression will be discarded.

order

Character vector. This element is used if the user wants the variables to be ordered in a certain way. This should be a regular expression (see regex help for more info). There can be more than one regular expression. The variables satisfying the first regular expression will be placed first, then the order follows the sequence of regular expressions.

dict

A named character vector. If provided, it changes the original variable names to the ones contained in the dict. Example: I want to change my variable named "a" to "$log(a)$" and "b3" to "$bonus^3$", then I used dict=c(a="$log(a)$",b3="$bonus^3$").

file

A character scalar. If provided, the Latex table will be saved in a file whose path is file.

append

Logical, default is TRUE. Only used if option file is used. Should the Latex table be appended to the existing file?

convergence

Logical, default is TRUE. Should the convergence state of the algorithm be displayed?

signifCode

Named numeric vector, used to provide the significance codes with respect to the p-value of the coefficients. Default is c("***"=0.01, "**"=0.05, "*"=0.10).

label

Character scalar. The label of the Latex table.

aic

Logical, default is FALSE. Should the AIC be displayed?

sqCor

Logical, default is FALSE. Should the squared correlation be displayed?

subtitles

Character vector of the same lenght as the number of models to be displayed. If provided, subtitles are added underneath the dependent variable name.

showClusterSize

Logical, default is FALSE. If TRUE and clusters were used in the models, then the number "individuals" of per cluster is also displayed.

bic

Logical, default is TRUE.Should the BIC be reported?

loglik

Logical, default is TRUE. Should the log-likelihood be reported?

yesNoCluster

A character vector of lenght 2. Default is c("Yes", "No"). This is the message displayed when a given cluster is (or is not) included in a regression.

keepFactors

Logical, default is FALSE. By default, when factor variables are contained in the estimation, they are printed as if they were a cluster variable. Put to TRUE to display all the coefficients of the factor variables.

Value

There is nothing returned, the result is only displayed on the console or saved in a file.

Author(s)

Laurent Berge

See Also

See also the main estimation function femlm. Use summary.femlm to see the results with the appropriate standard-errors, getFE to extract the cluster coefficients, and the functions res2table and res2tex to visualize the results of multiple estimations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
n = 100
x = rnorm(n, 1, 5)**2
y = rnorm(n, -1, 5)**2
z = rpois(n, x*y) + rpois(n, 2)
base = data.frame(x, y, z)

# Results of the Poisson..
est_poisson = femlm(z~log(x)+log(y), base, family="poisson")
# .. and of the Negative Binomial
est_negbin = femlm(z~log(x)+log(y), base, family="negbin")

# We export the two results in one Latex table:
res2tex(est_poisson, est_negbin)

# Changing the names & significance codes
res2tex(est_poisson, est_negbin, dict = c("log(x)" = "First variable (ln)"),
        signifCode = c("a" = 0.001, "$$" = 0.1))

FENmlm documentation built on April 27, 2018, 1:03 a.m.