stargazer

Stargazer output is code, not a table

*爱你&永不变心* 提交于 2019-12-06 04:30:48
问题 I am trying to use the package stargazer in RStudio to generate a summary table of my data. For some reason, I am not able to view the table in the output when I use either the html or latex code, but I can see it when I output as text. An example: library(stargazer) stargazer(attitude, type = 'text') Output looks like (as it is supposed to): ## ## ===================================== ## Statistic N Mean St. Dev. Min Max ## ------------------------------------- ## rating 30 64.633 12.173 40

Order variables with interaction in stargazer regression output

怎甘沉沦 提交于 2019-12-06 04:13:00
I have the following regressions: fit1 <- lm(y ~ x1, data = data) fit2 <- lm(y ~ x1 + x2, data = data) fit3 <- lm(y ~ x3 * x1, data = data) I want in the output the explanatory variables to be order (x1, x2, x3 and finally the interaction). I try the following with order but still the interaction appears second after x1. What may be wrong here? stargazer(fit1, fit2, fit3, align=TRUE, table.placement="H",omit.stat=c("f", "ser"), order=c("x1", "x2", "x3", "x3:x1")) The help-file for order states "order - a vector of regular expressions (or of numerical indexes) that indicates the order in which

Cluster-Robust Standard Errors in Stargazer

孤街浪徒 提交于 2019-12-06 02:55:40
问题 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 stargazer as in http://jakeruss.com/cheatsheets/stargazer.html#robust-standard-errors-replicating-statas-robust-option. I'm using lm to get my regression models, and I'm clustering by firm (a factor variable that I'm not including in the regression models)

Unprecise p-values in Stargazer

倾然丶 夕夏残阳落幕 提交于 2019-12-05 17:46:56
问题 I want the same stars for significancies in regression output in stargazer as in the "normal output". I produce data library("stargazer"); library("lmtest"); library("sandwich") set.seed(1234) df <- data.frame(y=1001:1100) df$x <- c(1:70,-100:-71) + rnorm(100, 0, 74.8) model <- lm(log(y) ~ x, data=df) and get some model estimates where the coefficient on x has a p-value of 0.1023 coeftest(model, vcov = vcovHC(model, type="HC3")) I want to have these results in LaTeX. Based on the same

Spaces between columns in stargazer type = “html” table output

别说谁变了你拦得住时间么 提交于 2019-12-05 03:50:21
I`m searching for a method (or alternative) to get spaces between the columns of an stargazer html-table output. As stargazer::stargazer(mtcars, type = "html") results in which is not very good to read... Thank´s in advance! Samuel If you are writing an RMarkdown document, you can customize your HTML tables using stylesheets. This can be done adding the option CSS to your YAML header. Something like this: --- title: "My HTML Doc" output: html_document: css: styles.css --- To increase the spacing between columns you could, for example, add some padding to the left of the cells. So, in your

Printing nice cross-tabulations in knitr

亡梦爱人 提交于 2019-12-04 16:26:46
问题 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 either xtabs or ftable. What I want is something like a nicely printed version of the R console output. > x Col Row A B C D 15 9 7 E 13 14 9 F 8 8 17 > f Col A B C Row D 15 9 7 E 13 14 9 F 8 8 17 I've tried several different solutions, none of which

stargazer left align LaTeX table columns

一曲冷凌霜 提交于 2019-12-04 15:40:29
问题 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: <<load, echo=FALSE, warning=FALSE, message=FALSE>>= opts_chunk$set(eval=TRUE, echo=FALSE, warning=FALSE, message=FALSE, dpi=300) @ \documentclass[a4paper,11pt]{article} \usepackage{lipsum} % Required to insert dummy text \begin{document} \title{} \author{} \date{\today} \maketitle \section{Header} Lorem ipsum dolor sit amet, consectetur

Stargazer output is code, not a table

Deadly 提交于 2019-12-04 11:25:25
I am trying to use the package stargazer in RStudio to generate a summary table of my data. For some reason, I am not able to view the table in the output when I use either the html or latex code, but I can see it when I output as text. An example: library(stargazer) stargazer(attitude, type = 'text') Output looks like (as it is supposed to): ## ## ===================================== ## Statistic N Mean St. Dev. Min Max ## ------------------------------------- ## rating 30 64.633 12.173 40 85 ## complaints 30 66.600 13.315 37 90 ## privileges 30 53.133 12.235 30 83 ## learning 30 56.367 11

Cluster-Robust Standard Errors in Stargazer

北城以北 提交于 2019-12-04 07:29:21
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 stargazer as in http://jakeruss.com/cheatsheets/stargazer.html#robust-standard-errors-replicating-statas-robust-option . I'm using lm to get my regression models, and I'm clustering by firm (a factor variable that I'm not including in the regression models). I also have a bunch of NA values, which makes me think multiwayvcov is going to be the best package

Add a row with notes using stargazer

落爺英雄遲暮 提交于 2019-12-03 13:05:49
问题 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, data=attitude) stargazer(linear.1, linear.2, type="text", keep.stat=c("n")) I want to add a couple of rows the the table with "X" for some of the specifications. That is: rating (1) (2) ----------------------------------------------------------------- complaints 0