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
3
votes
1 answer

How can I remove the citation in stargazer?

I am using stargazer to output regresson tables in R. However, at the start of each table, the output says % Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu % Date and time: Sat, Dec 19,…
Han
  • 41
  • 3
3
votes
2 answers

How to extract LME4 output to latex tables?

I usually use modelsummary() or stargazer() for extracting tables to latex in R. However, they seem to not work with lme4. Does someone know a way to extract this reproducible example to a nice latex table? Here is my model: df <- tibble( y =…
Jack
  • 813
  • 4
  • 17
3
votes
2 answers

Get stargazer to print number of observations in multinomial logistic regression

is there a way to print the number of observations for the multinomial logistic regression model in a stargazer table? This sample code illustrates the problem. Thank you. var1<-sample(c('A', 'B', 'C'), size=1000,…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
3
votes
0 answers

R Stargazer table ASCII text output formatting (line break, alignment & reference group)

For better or worse, I don't use LaTeX (yet). I like producing stargazer formatted tables on the fly for class examples in both HTML and in the console. However, I'm having trouble with 3 formatting elements; so far I've found solutions for LaTeX…
Shawn Janzen
  • 369
  • 3
  • 15
3
votes
1 answer

How to show only coefficients rounded to whole numbers in LaTeX tables?

Table generation in LaTeX using R's stargazer works great. But I can't figure how to format my numbers to whole numbers (this post is related, but different). Due to data scale, I want coefficients and standard errors to show no decimal. I therefore…
emagar
  • 985
  • 2
  • 14
  • 28
3
votes
0 answers

Caption Outside Float Error When Using Stargazer in R Markdown

I try to make a table of summary statistics using R Markdown. Below is my code. {r new, echo=TRUE, results='asis'} ws <- t(as.matrix(summary(merged$WS))) ows <- t(as.matrix(summary(merged$OWS))) summary1 <- rbind(ws, ows) rownames(summary1) <-…
Xito Parlo
  • 41
  • 2
3
votes
1 answer

How do I change model coefficients to compare a model in the literature?

I'd like to compare the coefficients from my own replication of a statistical model in the literature with the coefficients in the literature. I thougth I could just duplicate my model, and then plug in the coefficients from the literature and print…
spindoctor
  • 1,719
  • 1
  • 18
  • 42
3
votes
1 answer

How to create a table with descriptive statistics in Rstudio (stargazer)?

I am currently learning RStudio (beginner level) and I have a question regarding stargazer function and especially how to create the table of descriptive statistics. I did start by updloading my dataset (called df1) and all relevant libraries like…
3
votes
1 answer

Reporting regression marginal effects in stargazer()

I want to report the marginal effects in the place of the usual estimated effects, using stargazer() When the marginal effects are estimated, the results are turned into a vector, which I couldn't report in a pratical way and with the same kind of…
Flower
  • 43
  • 5
3
votes
0 answers

Include full mgcv::gam() summary() with stargazer()

I am trying to create a table of my mgcv::gam() summary with the stargazer package. See code below. library(stargazer) library(mgcv) set.seed(2) ## simulate some data... dat <- gamSim(1,n=400,dist="normal",scale=2) b <-…
ecology
  • 606
  • 3
  • 9
  • 29
3
votes
1 answer

Editing stargazer source code -- saved edits don't render to pdf

So I'm also preparing a table or regression results in stargazer, and I'm only showing the t-scores in the table from 10 different models side by side. I have the same question as in this earlier post on how to remove the "t = " from the stargazer…
anguyen1210
  • 513
  • 5
  • 21
3
votes
1 answer

Bug? Stargazer fails to properly display fixed effects/factor labels with "omit" options?

When I generate a table in stargazer and omit fixed effects, then specify the omit.labels option, stargazer (version 5.2.2) shows "No" for every column. Here's an example: library(stargazer) # generate example data set.seed(1) list_of_states <-…
Michael A
  • 4,391
  • 8
  • 34
  • 61
3
votes
0 answers

Using stargazer for ridge regression results (glmnet package)

I've run a ridge regression using the following code: # Download and clean data library(ISLR) Hitters.data <- Hitters Hitters.data <- na.omit(Hitters.data) Hitters.data$League <- as.numeric(Hitters.data$League == "A") Hitters.data$Division <-…
H.Z
  • 79
  • 5
3
votes
1 answer

How to omit begin table in stargazer output

library(stargazer) stargazer(mtcars) I want to omit the table setup part so instead of: % Table created by StarGazer v.3.0.1 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu % Date and time: Thu, May 09, 2013 -…
wolfsatthedoor
  • 7,163
  • 18
  • 46
  • 90
3
votes
2 answers

Stargazer output appears below text - rmarkdown to pdf

The Problem When using rmarkdown in RStudio, my stargazer(glm()) output gets positioned below the text that I would like it to. It gets positioned in a different spot than the r chunk is. The PDF is created perfectly, it's just the position of the…