stargazer

Order variables with interaction in stargazer regression output

℡╲_俬逩灬. 提交于 2020-01-02 19:12:16
问题 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")) 回答1: The help-file for order

Regression Tables in R Markdown / rmarkdown (html/pdf)

人盡茶涼 提交于 2019-12-31 01:56:07
问题 For the purpose of publishing I often need both a PDF and a HTML version of my work including regression tables and I want to use R Markdown. For PDF the stargazer and the texreg packages produce wonderful tables. Now trying to generate an equally attractive HTML output I'm facing different issues. Both methods for HTML output are lacking significance stars in the notes. As they are automatically generated I don't know how to escape them. (I think this might be a minor problem and therefore I

Using stargazer with Zelig

允我心安 提交于 2019-12-30 10:55:23
问题 I am trying to use stargazer (Version 5.2) to output the standard summary() results of a regression estimated with Zelig (Version 5.0.13). However, I obtain the error Error in envRefInferField(x, what, getClass(class(x)), selfEnv) : ‘result’ is not a valid field or method name for reference class “Zelig-ls” when trying to feed the estimated model into stargazer. A minimal working example reproducing the error would be library(Zelig) library(stargazer) data("swiss") z <- zls$new() z$zelig

Waldtest in R to get adjust F statistic with plm and result shown with stargazer?

谁说我不能喝 提交于 2019-12-25 04:49:15
问题 I am working with an unbalanced short panel. Raw data: bankFull.xlsx What I actually want is only get the regression results with two side fixed effects and robust S.E reported, which is very easy in Stata. I followed online tutorial but ran into some problem always with # Adjust F statistic wald_results <- waldtest(FE1, vcov = cov1) Error in model.matrix.pFormula(formula, data, rhs = 1, model = model, : NA in the individual index variable no matter how I adjusted the data! It almost drives

how to export a dataframe to latex with some minimal formatting?

别来无恙 提交于 2019-12-24 19:23:31
问题 Consider this simple example library(dplyr) dataframe <- data_frame(mytext1 = c('HELLO', 'WORLD'), mytext2 = c('HELLO', 'AGAIN'), value1 = c(1,2), value2 = c(1,2)) # A tibble: 2 x 4 mytext1 mytext2 value1 value2 <chr> <chr> <dbl> <dbl> 1 HELLO HELLO 1 1 2 WORLD AGAIN 2 2 I would like to export this dataframe to a latex table, but with some little (but important) tweaks. In particular, I would like, in the latex output, to add a supercolumn that separates the text variables and another that

how to align stargazer table to the left when type=“latex”?

北城余情 提交于 2019-12-23 12:50:49
问题 I use stargazer package in my automated rmarkdown pdf documents to make nice looking tables. Stargazer places its tables in the center of the page, by default. How can I let stargazer generate latex code that aligns the table to the left? here is an example of what I mean: library(stargazer) data_object <- structure(list(test = structure(c(1L, 1L, 2L, 2L), .Label = c("test1", "test2"), class = "factor"), test2 = structure(1:4, .Label = c("1", "2", "3", "4"), class = "factor")), .Names = c(

Does stargazer interpreting data.frame data as latex code constitute a bug or is this intended?

安稳与你 提交于 2019-12-23 09:33:31
问题 I am experiencing a problem where the Stargazer function is interpreting data in my data.frame as a latex command. I would like to find a way to suppress this feature of stargazer. See below. z <- c("Bank of America Corp", "Citigroup Inc", "JPMorgan Chase & Co", "Morgan Stanley", "Wells Fargo & Co") s <- data.frame(z=z, l= c(100000, 25, 10000, 24, 100000)) library(stargazer) stargazer(s, type = "text", summary = FALSE) # prints out ============================== z l --------------------------

How to display coefficients in scientific notation with stargazer

南楼画角 提交于 2019-12-23 07:13:26
问题 I want to compare the results of different models (lm, glm, plm, pglm) in a table in R using stargazer or a similar tool. However I can't find a way to display the coefficients in scientific notation. This is kind of a problem because the intercept is rather large (about a million) while other coefficients are small (about e-7) which results in lots of useless zeros making it harder to read the table. I found a similar question here: Format model display in texreg or stargazer R as scientific

How to print a long column from a dataframe splited in two columns side by side

自古美人都是妖i 提交于 2019-12-23 04:51:15
问题 I have a dataframe with 60 rows of data, here I'm posting a single column of it, so we have some data to work: local N 1 IPA 0.164 2 IPA 0.045 3 IPA 0.069 4 IPA 0.100 5 IPA 0.050 . . . . . . . . . 28 IPA 0.078 29 IPA 0.121 30 IPA 0.104 31 OPA 0.035 32 OPA 0.057 33 OPA 0.043 . . . . . . . . . 55 OPA 0.021 56 OPA 0.004 57 OPA 0.043 58 OPA 0.002 59 OPA 0.005 60 OPA 0.034 Observe that the local for the 30 first reading is IPA and the local for the last 30 readings is OPA. I'm using knitr to make

report regression result using stargazer to add separate column for standard error

筅森魡賤 提交于 2019-12-22 08:42:53
问题 i am trying to use stargazer to export my regression result. I wanted to be able to report both coefficient and standard error in separate columns see this pic here: Formatted I wanted to be able to achieve However I can only get coefficient and standard error in the same row using single.row = TRUE. Is there something to achieve the desired result?Thank you so much! My current format 来源: https://stackoverflow.com/questions/52172469/report-regression-result-using-stargazer-to-add-separate