stargazer

Stargazer notes line wrap?

こ雲淡風輕ζ 提交于 2019-12-19 06:46:09
问题 Is there a way to get notes in stargazer to wrap lines instead of running off the page? stargazer(fit.1, notes="A very very long note that I would like to put below the table, but currently runs off the side of the page when I compile my document. How do I get this to wrap into paragraph form?") Which produces: \hline \\[-1.8ex] \textit{Notes:} & \multicolumn{2}{l}{$^{*}$P $<$ .05} \\ & \multicolumn{2}{l}{$^{**}$P $<$ .01} \\ & \multicolumn{2}{l}{$^{***}$P $<$ .001} \\ & \multicolumn{2}{l}{A

P-values significance not showed in stargazer html regression table

孤人 提交于 2019-12-14 03:58:11
问题 I am having trouble with the Notes significance (asterisks) not appearing when using stargazer to format html tables. The result is ok when using latex. Here is my source file "teste.Rmd" --- title: "Untitled" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r data} #some data set.seed(123) X = rnorm(500,10,3) Y = 10+ 3*I(X^1.2) + rnorm(500) # models m1 = lm(Y~X) m2 = lm(Y~X+I(X^2)) ``` ```{r res,warning=FALSE,message=FALSE,results='asis'}

how to flip a regression table in stargazer?

我们两清 提交于 2019-12-14 01:15:43
问题 I would like to "flip" the row/columns in a regression table. The latest stargazer manuals says that now the flip argument also works with regression tables (previously it only worked with summary stats). However I am unable to make it work. Here is an example with stargazer 5.2.1 library(stargazer) stargazer(attitude) linear.1 <- lm(rating ~ complaints + privileges + learning + raises + critical, data=attitude) linear.2 <- lm(rating ~ complaints + privileges + learning, data=attitude) ##

Exporting output of custom multiple regressions from R to Latex

十年热恋 提交于 2019-12-13 03:24:13
问题 I am trying to export the results of multiple regressions in a single table. Ideally, it should be formatted similar to stargazer() output. The problem is that I have not found reliably working R functions for the kind of regressions I need (Fama-MacBeth regressions), so I use my custom regression functions, which produce all necessary output (estimates of coefficients, standard errors, t-stat, R^2). Does stargazer() or other similar function have the parameters, which allow me to export

R - stargazer add reference categories

╄→尐↘猪︶ㄣ 提交于 2019-12-12 18:31:45
问题 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 = factor(mtcars$gear) mtcars$carb = factor(mtcars$carb) I run an ols with lm1 = lm(disp ~ gear + carb, mtcars) and stargaze the results. stargazer(lm1, single.row = TRUE, omit.table.layout = "sn") I get However, I find myself always going back to the tex file to custom the

Including standardized coefficients in a stargazer table

a 夏天 提交于 2019-12-12 17:56:06
问题 I have a series of linear models and I'd like to report the standardized coefficients for each. However, when I print the models in stargazer, it looks like stargazer automatically prints the significance stars for the standardized coefficients as if they were unstandardized coefficients. You can see how the differences emerge below. Is it statistically wrong to print the significance stars based on the unstandardized values? How is this done in stargazer? Thanks! #load libraries library

R :How to get a proper latex regression table from a dataframe?

℡╲_俬逩灬. 提交于 2019-12-12 17:50:00
问题 Consider the following example inds <- c('var1','','var2','') model1 <- c(10.2,0.00,0.02,0.3) model2 <- c(11.2,0.01,0.02,0.023) df = df=data.frame(inds,model1,model2) df inds model1 model2 var1 10.20 11.200 0.00 0.010 var2 0.02 0.020 0.30 0.023 Here you have the output of a custom regression model with coefficients and P-values (I actually can show any other statistics if I need to, say, the standard errors of the coefficients). There are two variables, var1 and var2 . For instance, in model1

How to display numbers in scientific notation in ASCII tables?

喜夏-厌秋 提交于 2019-12-12 10:43:44
问题 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 xtable in HTML, but not ASCII. Stargazer seems not have the option to display numbers in scientific notation. Below is an example: library(stargazer) example <- data.frame(parameter = letters, value = runif(26, min = 1E-14, max = 5E-14)) stargazer

Using stargazer with a list of lm objects created by lapply-ing over a split data.frame

蹲街弑〆低调 提交于 2019-12-12 07:19:14
问题 I'm trying to create a stargazer table for a set of regressions, where I ran each regression on a subset of my data. The natural way to do this, I would think, is to use split to create a list of data.frames from my data, create a list of lm objects by using lapply on the list of data.frames, and then feed that list to stargazer . For example, library(MASS) library(stargazer) data(Boston) # This doesn't work by.river <- split(Boston, Boston$chas) fit <- lapply(by.river, lm, formula = crim ~

Extending Stargazer to multiwaycov

放肆的年华 提交于 2019-12-12 05:19:59
问题 I'm using stargazer to create regression outputs for my bachelor thesis. Due to the structure of my data I have to use clustered models (code below). I'm using the vcovclust command from the multiwaycov package, which works perfectly. However, stargazer does not support it. Do you know another way to create outputs as nice as stargazer does? Or do you know an other package/command to cluster the models, which is suppported by stargazer? model1.1.2 <- lm(leaflet ~ partisan + as.factor(gender)