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
86
votes
3 answers

Get coefficients estimated by maximum likelihood into a stargazer table

Stargazer produces very nice latex tables for lm (and other) objects. Suppose I've fit a model by maximum likelihood. I'd like stargazer to produce a lm-like table for my estimates. How can I do this? Although it's a bit hacky, one way might be…
Adrian
  • 3,138
  • 2
  • 28
  • 39
26
votes
5 answers

Using stargazer with Rstudio and Knitr

I'm struggling to use stargazer output in knitr, using RStudio. For example, I paste the code below into a .Rmd file, then click Knit HTML. The first block between [ and ] is rendered as equations. The second block is from stargazer. It remains as…
Isaiah
  • 2,091
  • 3
  • 19
  • 28
23
votes
2 answers

How to suppress stargazer() information in output file

I'm using the stargazer package to output an R dataframe as latex code: library(stargazer) stargazer(mtcars) And this is the output % Table created by StarGazer v.3.0.1 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu % Date…
luciano
  • 13,158
  • 36
  • 90
  • 130
22
votes
1 answer

stargazer left align LaTeX table columns

stargazer automatically centres values within tables. How can I left align the columns? Put this code in an .Rnw file and use knitr to convert to .tex: <>= opts_chunk$set(eval=TRUE, echo=FALSE,…
luciano
  • 13,158
  • 36
  • 90
  • 130
20
votes
4 answers

Odds ratios instead of logits in stargazer() LaTeX output

When using stargazer to create a LaTeX table on a logistic regression object the standard behaviour is to output logit-values of each model. Is it possible to get exp(logit) instead? That is, can i get the Odds-ratios instead? In the stargazer…
Rasmus Larsen
  • 5,721
  • 8
  • 47
  • 79
18
votes
2 answers

Multinomial logit in R: mlogit versus nnet

I want to run a multinomial logit in R and have used two libraries, nnet and mlogit, which produce different results and report different types of statistics. My questions are: What is the source of discrepency between the coefficients and standard…
splinter
  • 3,727
  • 8
  • 37
  • 82
18
votes
4 answers

Printing nice cross-tabulations in knitr

What I want is to print nice crosstabulations, either in a pdf file, or in a html file, from RStudio, using R, Markdown and knitr. I suspect I am missing something really obvious, because I cannot believe this is so hard. I make cross-tabs with…
astaines
  • 872
  • 2
  • 9
  • 20
17
votes
3 answers

How to fix 'Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : missing value where TRUE/FALSE needed' using stargazer in rstudio?

I'm trying to print a table of combined lm's in Rstudio using Stargazer and I keep getting this message: Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : missing value where TRUE/FALSE needed This is the code I'm…
Jonathan Ackley
  • 171
  • 1
  • 1
  • 4
16
votes
1 answer

Add a row with notes using stargazer

I want to run some regressions and create a table with stargazer. For example linear.1 <- lm(rating ~ complaints + privileges + learning + raises + critical, data=attitude) linear.2 <- lm(rating ~ complaints + privileges + learning,…
Ignacio
  • 7,646
  • 16
  • 60
  • 113
14
votes
5 answers

How to resize tables generated by Stargazer in R Markdown?

I included resize.height=0.5,resize.width=0.5 in the code chunk, but still can't resize the table generated by stargazer. Can anyone tell me why? My code chunk options look like…
yuan-ning
  • 537
  • 1
  • 4
  • 12
14
votes
4 answers

Stargazer: Save to file, don't show in console

When I want to save my regression results with stargazer(regressions[[reg]], out=myFile, out.header=FALSE stargazer keeps also displaying/printing the result into the console. As I'm iterating over dozens of results, this ruins my overview and the…
FooBar
  • 15,724
  • 19
  • 82
  • 171
14
votes
4 answers

Obtaining Separate Summary Statistics by Categorical Variable with Stargazer Package

I would like to use stargazer to produce summary statistics for each category of a grouping variable. I could do it in separate tables, but I'd like it all in one – if that is not unreasonably challenging for this package. For…
Michael
  • 1,537
  • 6
  • 20
  • 42
13
votes
2 answers

Cluster-Robust Standard Errors in Stargazer

Does anyone know how to get stargazer to display clustered SEs for lm models? (And the corresponding F-test?) If possible, I'd like to follow an approach similar to computing heteroskedasticity-robust SEs with sandwich and popping them into…
RSS
  • 163
  • 1
  • 2
  • 11
13
votes
3 answers

Decimal numbers in R stargazer

I am using the R package stargazer to generate tables in Latex. It works great but I cannot figure out how to format my numbers correctly. I want all numbers to show exactly one decimal place (e. g. 1.0, 0.1, 10.5 etc.). I therefore use the option…
lilaf
  • 359
  • 1
  • 5
  • 10
13
votes
3 answers

using stargazer in R without knowing anything about latex

I'm about to teach an R course for social scientists. They are likely to know nothing about LaTeX, and reluctant to hear about it (R is complex enough for them). Yet, they are likely to love the sort of tables that the stargazer package creates to…
amit
  • 3,332
  • 6
  • 24
  • 32
1
2 3
39 40