stargazer

How can I make a collapse with glue package using RMarkdown?

别等时光非礼了梦想. 提交于 2020-07-16 07:00:52
问题 I've been trying to automate the results of some df table in latex using the glue and stargazer packages, but I haven't had any results (what I want is for the meaning "^{*}" to appear next to each value as it is in the table) to use then RMarkdown. What I want to get: My current ugly and error-prone fix: library(dplyr) library(glue) library(stargazer) X1 = c(4.70e1, 4.72e1, 4.76e1, 2.73e20) X2 = c(4.67e1, 4.69e1, 4.77e1, 2.05e20) tab.out = data.frame(X1, X2) tab.out$max<-apply(tab.out, 1,

How to resize tables generated by Stargazer in R Markdown?

≡放荡痞女 提交于 2020-07-06 08:17:42
问题 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 this: echo=FALSE,warning=FALSE,results='asis',resize.height=0.5,resize.width=0.5} The stargazer codes are like this: stargazer(did.student,student.control.kmt,student.control.neu,student.control.dpp,header = FALSE, title="DD Model", covariate.labels = c("Treatment","group","Treatment*group"), dep.var.labels =

How to resize tables generated by Stargazer in R Markdown?

[亡魂溺海] 提交于 2020-07-06 08:17:30
问题 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 this: echo=FALSE,warning=FALSE,results='asis',resize.height=0.5,resize.width=0.5} The stargazer codes are like this: stargazer(did.student,student.control.kmt,student.control.neu,student.control.dpp,header = FALSE, title="DD Model", covariate.labels = c("Treatment","group","Treatment*group"), dep.var.labels =

Summary Statistics table with factors and continuous variables

萝らか妹 提交于 2020-06-27 03:55:07
问题 I am trying to create a simple summary statistics table (min, max, mean, n, etc) that handles both factor variables and continuous variables, even when there is more than one factor variable. I'm trying to produce good looking HTML output, eg stargazer or huxtable output. For a simple reproducible example, I'll use mtcars but change two of the variables to factors, and simplify to three variables. library(tidyverse) library(stargazer) mtcars_df <- mtcars mtcars_df <- mtcars_df %>% mutate(vs =

Stargazer: line type

心已入冬 提交于 2020-06-16 03:32:31
问题 I am struggling with working out how to control the line style settings in stargazer. Below is my current working example. I like the double line at the top of the table, but I would like to replace the double line at the bottom of the table with a single line, and I would also like to replace the single solid line that separates the slope and intercept information from the summary information with a dashed/dotted line. For all steps up to this point I have been able to follow the stargazer

Omit output of a factor variable in stargazer?

霸气de小男生 提交于 2020-06-14 06:08:19
问题 If I'm running a fixed effects model in r using lm and the factor command, how can I suppress the factor variable coefficients in a stargazer model? i.e. my model is: m1<-lm(GDP~pop_growth + factor(city)) and I want to report findings with only an intercept and coefficient on pop_growth, not coefficients on every dummy variable for cities. EDIT: Issue was, as it turns out, with variable name encoding. omit="city" works. 来源: https://stackoverflow.com/questions/49368917/omit-output-of-a-factor

Potential bug in stargazer omit.labels

馋奶兔 提交于 2020-06-10 12:58:43
问题 There appears to be a bug in version 5.2 of the stargazer package, where the omit.label functionality does not work consistently depending on the order of the included models: library(stargazer) library(ggplot2) as.data.frame(data("midwest")) fit.1 <- lm(poptotal ~ popadults, data = midwest) fit.2 <- lm(poptotal ~ popadults + state, data = midwest) # Works, column listed as "Yes": stargazer(fit.2, omit = c("state"), omit.labels = c("States")) # Does not work, both columns listed as "No":

Potential bug in stargazer omit.labels

ぃ、小莉子 提交于 2020-06-10 12:58:07
问题 There appears to be a bug in version 5.2 of the stargazer package, where the omit.label functionality does not work consistently depending on the order of the included models: library(stargazer) library(ggplot2) as.data.frame(data("midwest")) fit.1 <- lm(poptotal ~ popadults, data = midwest) fit.2 <- lm(poptotal ~ popadults + state, data = midwest) # Works, column listed as "Yes": stargazer(fit.2, omit = c("state"), omit.labels = c("States")) # Does not work, both columns listed as "No":