stargazer

Estimating multiple `lm` models and returning output in one table, with map()

半城伤御伤魂 提交于 2020-01-24 12:33:16
问题 I need to estimate a number of linear models on the same dataset, and put the regression results all into one table. For a reproducible example, here's a simplification using mtcars : formula_1 = "mpg ~ disp" formula_2 = "mpg ~ log(disp)" formula_3 = "mpg ~ disp + hp" Currently, my approach has been to: Create a list that contains all of the formulae. use purrr:map() to estimate all of the lm models. use stargazer:: to produce output tables. library(tidyverse) library(stargazer) formula_1 =

Estimating multiple `lm` models and returning output in one table, with map()

ぃ、小莉子 提交于 2020-01-24 12:32:55
问题 I need to estimate a number of linear models on the same dataset, and put the regression results all into one table. For a reproducible example, here's a simplification using mtcars : formula_1 = "mpg ~ disp" formula_2 = "mpg ~ log(disp)" formula_3 = "mpg ~ disp + hp" Currently, my approach has been to: Create a list that contains all of the formulae. use purrr:map() to estimate all of the lm models. use stargazer:: to produce output tables. library(tidyverse) library(stargazer) formula_1 =

Display p-values under 0.1 in r stargazer

半世苍凉 提交于 2020-01-24 10:23:39
问题 I have regression coefficients at p-value 0.06. The output table of stargazer does not display the dot (.) signalling p-values under 0.1. How do I make stargazer to signal p-values below 0.1 in the output table? *It would be hard to find or create a reproducible example with p-values above 0.05 and below 0.1. If needed, I'll try and find something. But hopefully this is a softball question with a quick solution. 回答1: You can do this with the star.cutoffs and star.char arguments. Some fake

Display p-values under 0.1 in r stargazer

拜拜、爱过 提交于 2020-01-24 10:22:32
问题 I have regression coefficients at p-value 0.06. The output table of stargazer does not display the dot (.) signalling p-values under 0.1. How do I make stargazer to signal p-values below 0.1 in the output table? *It would be hard to find or create a reproducible example with p-values above 0.05 and below 0.1. If needed, I'll try and find something. But hopefully this is a softball question with a quick solution. 回答1: You can do this with the star.cutoffs and star.char arguments. Some fake

Stargazer: model names instead of numbers?

北战南征 提交于 2020-01-21 08:58:06
问题 Is it possible to change the default of stargazer so that it displays some custom model shortcut instead of the model number? I found the model.number parameter but this is a on-/off parameter. Ideally, I could pass something like model.names=c("hhc", "dca", "bpc") to stargazer and this would replace the automatic numbering. 回答1: At the moment you could get your desires under the condition that those were the names of the model-objects, but not if they had other names, by doing this:

Stargazer Title Not Showing (Non-reproducible Error)

别等时光非礼了梦想. 提交于 2020-01-16 18:57:29
问题 WARNING: I was not able to reproduce the error in a separate R/RStudio session, so I am hoping just to get some leads on trouble shooting my current .rmd script. The Problem All of a sudden, the stargazer title argument seemed to stop working. No matter what the title was or where I placed the argument within the function, it does not seem to work. Additionally, and maybe related, I started getting this warning message: the condition has length > 1 and only the first element will be used

Stargazer Title Not Showing (Non-reproducible Error)

五迷三道 提交于 2020-01-16 18:54:53
问题 WARNING: I was not able to reproduce the error in a separate R/RStudio session, so I am hoping just to get some leads on trouble shooting my current .rmd script. The Problem All of a sudden, the stargazer title argument seemed to stop working. No matter what the title was or where I placed the argument within the function, it does not seem to work. Additionally, and maybe related, I started getting this warning message: the condition has length > 1 and only the first element will be used

Using stargazer with memory greedy glm objects

坚强是说给别人听的谎言 提交于 2020-01-06 03:07:05
问题 I'm trying to run the following regression: m1=glm(y~x1+x2+x3+x4,data=df,family=binomial()) m2=glm(y~x1+x2+x3+x4+x5,data=df,family=binomial()) m3=glm(y~x1+x2+x3+x4+x5+x6,data=df,family=binomial()) m4=glm(y~x1+x2+x3+x4+x5+x6+x7,data=df,family=binomial()) and then to print them using the stargazer package: stargazer(m1,m2,m3,m4 type="html", out="models.html") Thing is, the data frame df is rather big (~600MB) and thus each glm object I create is at least ~1.5GB. This creates a memory issue

Stargazer and gam - how to include the whole summary output?

北城以北 提交于 2020-01-04 01:51:20
问题 When fitting a generalized additive model with smoothed splines stargazer only returns the main effects and not the smooth terms which you can see in summary(pros.gam) . Can stargazer return these as well? Or is there another function or package that can do the job? library(ElemStatLearn) library(mgcv) library(stargazer) pros.gam=gam(lpsa~s(lcavol)+s(lweight)+s(age)+s(lbph)+svi +s(lcp)+gleason+s(pgg45),data=prostate) summary(pros.gam) # Table should include the smooth terms that are visible

Capture R output and replace with LaTeX code

只愿长相守 提交于 2020-01-03 11:02:22
问题 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 output: [1] "" [2] "% Table created by stargazer v.5.1 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu" [3] "% Date and time: Sat, Jun 27, 2015 - 11:36:07" [4] "\\begin{table}[!htbp] \\centering " [5] " \\caption{The main caption