stargazer

How do I fix the unrecognized object error in Stargazer with a dynlm model?

假如想象 提交于 2021-02-20 19:01:47
问题 I calculated a dynlm model and now want to get stargazer to export that. However, stargazer does not return any output, instead gives me the Unrecognized object type Error. I already checkd if dynlm objects were supported by stargazer and according to the package page it is. Anyone have any idea what I'm getting wrong here? I know how to export the output with stargazer, but in this case it doesn't even show me the results inside of R. This is the model I used and the stargazer command, which

Generalized Linear Model output through texreg

为君一笑 提交于 2021-02-19 06:15:48
问题 I can use texreg to get beautiful output of glm to be used for knitr . Sometimes we need to convert the output of glm back to response using inverse link. I wonder how to get inverse link output with texreg . Something like texreg(exp(glm.D93)) . counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) d.AD <- data.frame(treatment, outcome, counts) glm.D93 <- glm(counts ~ outcome + treatment, family = poisson()) library(texreg) texreg(glm.D93) which produces \begin

Generalized Linear Model output through texreg

余生长醉 提交于 2021-02-19 06:15:14
问题 I can use texreg to get beautiful output of glm to be used for knitr . Sometimes we need to convert the output of glm back to response using inverse link. I wonder how to get inverse link output with texreg . Something like texreg(exp(glm.D93)) . counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) d.AD <- data.frame(treatment, outcome, counts) glm.D93 <- glm(counts ~ outcome + treatment, family = poisson()) library(texreg) texreg(glm.D93) which produces \begin

Generalized Linear Model output through texreg

痞子三分冷 提交于 2021-02-19 06:15:09
问题 I can use texreg to get beautiful output of glm to be used for knitr . Sometimes we need to convert the output of glm back to response using inverse link. I wonder how to get inverse link output with texreg . Something like texreg(exp(glm.D93)) . counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) d.AD <- data.frame(treatment, outcome, counts) glm.D93 <- glm(counts ~ outcome + treatment, family = poisson()) library(texreg) texreg(glm.D93) which produces \begin

Generate table with side-by-side node models of `partykit:mob()` object

有些话、适合烂在心里 提交于 2021-02-18 07:51:08
问题 Let's say I fit a model using partykit:mob() . Afterward, I would like to generate a side-by-side table with all the nodes (including the model fitted using the whole sample). Here I attempted to do it using stargazer() , but other ways are more than welcome. Below an example and attempts to get the table. library("partykit") require("mlbench") ## Pima Indians diabetes data data("PimaIndiansDiabetes", package = "mlbench") ## a simple basic fitting function (of type 1) for a logistic

Formatted latex regression tables with multiple models from broom output?

冷暖自知 提交于 2021-02-16 07:01:33
问题 I have several models such as the example below for which I have estimates, standard errors, p-values, r2 etc. as data.frames in tidy format, but I don't have the original model objects (analysis was run on a different machine). require(broom) model <- lm(mpg ~ hp + cyl, mtcars) tidy_model <- tidy(model) glance_model <- glance(model) # tidy_model # # A tibble: 3 x 5 # term estimate std.error statistic p.value # <chr> <dbl> <dbl> <dbl> <dbl> # 1 (Intercept) 36.9 2.19 16.8 1.62e-16 # 2 hp -0

how to work with prais.winsten results in stargazer and broom (r)

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 09:13:58
问题 The package "prais" contains the function prais.winsten to run a regression models with Prais Winsten estimator. However, neither stargazer nor broom packages seem to work with the results from the prais.winsten function. After fitting a model of the form pw<- prais.winsten(speed ~ dist, cars) When I try to report the results with stargazer I get the following error: stargazer(pw, out = "pw.html") Error: $ operator is invalid for atomic vectors and likewise tidying the model with the broom

RStudio - Stargazer issue - text table

一笑奈何 提交于 2021-01-29 12:02:04
问题 I am currently learning RStudio (beginner level) and I have a question regarding stargazer function and especially how to create the table of descriptive statistics. I did start by updloading my dataset (called d ) and all relevant libraries like stargazer . I did run command line: stargazer(d, type = 'text', title = "Statistiques descriptives",digits = 1, out="table1.txt") There is an error message: *Error in if (nchar(text.matrix[r, c]) > max.length[real.c]) { : missing value where TRUE /

Is there a way to automatically left-align first column of stargazer output within R?

久未见 提交于 2021-01-29 10:22:01
问题 I need to produce a LaTeX table completely in R, so that if the values in the table change over the course of analysis, the formatting of the table remains the same. I am passing a matrix of values (a balance table for an RCT if there are any economists out there) into stargazer. It mostly gets the table right. However, the first column is center-aligned and I need it to be left-aligned. No online solutions have worked to date. I have read this solution (how to align stargazer table to the

How to align coefficients using stargazer in R Markdown?

对着背影说爱祢 提交于 2021-01-29 03:39:44
问题 Every time I add align=TRUE the document won't knit. I would like to align each column's coefficients so that their decimals are directly above/below each other. Here is my "chunk code" ```{r, results="asis", echo="FALSE", eval="TRUE"} library(stargazer) stargazer(model1, model2, model3, type = "latex", title = "Country Deaths from Political Violence in 1975", dep.var.labels.include = FALSE, dep.var.caption = "Deaths", digits = 1, header = FALSE, covariate.labels = c("Intercept", "Sanctions",