Questions tagged [stargazer]

Stargazer is an R package that produces LaTeX code for well-formatted tables that hold regression analysis results from several models side-by-side, as well as summary statistics.

Stargazer is an package that produces code for well-formatted tables that hold regression analysis results from several models side-by-side, as well as summary statistics.

Repositories

Vignettes

588 questions
7
votes
2 answers

Reference category in regression table

I've got results from a linear regression model with a factor variable in R that I would like pretty up and then output into LaTeX. Ideally the factor variable would be presented in the table via a row that gives the name of the variable and the…
RoyalTS
  • 9,545
  • 12
  • 60
  • 101
6
votes
2 answers

Is there a reasonable way with texreg or similar in R (making html tables) to round coefficients to different digits than goodness-of-fit measures?

I am using texreg to show regressions side-by-side, including SUR systems with systemfit, but I have some formatting constraints/preferences. I would like to be able to round the coefficients one way, while rounding the goodness-of-fit measures to…
Andrew A
  • 185
  • 2
  • 11
6
votes
1 answer

stargazer error "length of NULL cannot be changed"

I'm trying to produce a proper table with stargazer in markdown. The linear model code is as follows: k <- lm(mean_p ~ P*MA, data=d) Calling the following stargazer-function however does not work, produces the error length of NULL cannot be…
Jan
  • 61
  • 1
  • 8
6
votes
1 answer

report regression result using stargazer to add separate column for standard error

I am trying to use stargazer() to export my regression result. I wanted to be able to report both coefficient and standard error in separate columns see this pic here: However I can only get coefficient and standard error in the same row using…
pastabasta
  • 61
  • 2
6
votes
2 answers

Formatted latex regression tables with multiple models from broom output?

I have several models such as the example below for which I have estimates, standard errors, p-values, r2 etc. as data.frames in tidy format, but I don't have the original model objects (analysis was run on a different machine).…
benedikt
  • 177
  • 1
  • 10
6
votes
2 answers

R - stargazer add reference categories

I was wondering if someone came with a solution to show up the reference categories of categorical variables using stargazer? library(stargazer) Let us imagine that gear and carb are categorical variables mtcars$gear =…
giac
  • 4,261
  • 5
  • 30
  • 59
6
votes
2 answers

How to change Stargazer HTML table width?

I really like the styling of tables that the stargazer package uses. The tables render fine in pdf using Knitr and Rstudio. However when I try to knit my .Rmd into an html page, the tables end up squished together. Chunk option fig.width does not…
TDP
  • 335
  • 1
  • 3
  • 9
6
votes
3 answers

Print "pretty" tables for h2o models in R

There are multiple packages for R which help to print "pretty" tables (LaTeX/HTML/TEXT) from statistical models output AND to easily compare the results of alternative model specifications. Some of these packages are apsrtable, xtable, memisc,…
majom
  • 7,863
  • 7
  • 55
  • 88
6
votes
1 answer

Embedding existing HTML in R markdown

Simple question, is there a function to embedded an existing HTML output, in this case a table output from the stargazer package in R into an R Markdown script?
Nick Reid
  • 63
  • 1
  • 4
6
votes
2 answers

How to display numbers in scientific notation in ASCII tables?

I am trying to display extremely small numbers (<1E-12) in an ASCII table. (Believe me, I can't find any alternative.) So far I've tried stargazer and xtable. Neither of them seems to work. I can display the numbers in scientific notation with…
Jin
  • 103
  • 6
6
votes
2 answers

Adding two rows of column names in Stargazer regression table

I'm actually surprised to find that no one has asked this question. Here it goes. I have a 3 models, first 2 computed for black people and the last one for whites. I produce a regression output with stargazer and over the first two models I write…
cimentadaj
  • 1,414
  • 10
  • 23
6
votes
1 answer

Regression table in latex from splm

I would like to know which is the easiest way to put a regression output (splm object) in TeX. Stargazer, texreg, latex does not recognize this type of object so the table would have to be done kind of manually. I already put the coefficients and…
user2246905
  • 1,029
  • 1
  • 12
  • 31
6
votes
1 answer

Multicolumn output of stargazer to be used in knitr

Here is MWE: library(pscl) data("bioChemists", package = "pscl") fm_pois <- glm(art ~ ., data = bioChemists, family = poisson) fm_qpois <- glm(art ~ ., data = bioChemists, family = quasipoisson) fm_nb <- glm.nb(art ~ ., data = bioChemists) fm_zinb…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
6
votes
2 answers

Capture R output and replace with LaTeX code

I'm trying to capture the output from some R code and replace it with latex code. If you run this code: library(stargazer) x <- capture.output(stargazer(mtcars[1:5, 1:3], summary = FALSE, title="The main caption of the table.")) x This is the…
luciano
  • 13,158
  • 36
  • 90
  • 130
6
votes
4 answers

Output each factor level as dummy variable in stargazer summary statistics table

I'm using the R package stargazer to create high-quality regression tables, and I would like to use it to create a summary statistics table. I have a factor variable in my data, and I would like the summary table to show me the percent in each…
Jake Fisher
  • 3,220
  • 3
  • 26
  • 39