texreg

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

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

texreg-ing multiple multinom models

 ̄綄美尐妖づ 提交于 2020-12-13 07:24:21
问题 I'm having a bit of trouble using texreg to create output TeX files for multiple multinom models. Let's use a version of this multionmial logit setup for concreteness: library(foreign) library(nnet) library(data.table) ml <- data.table(read.dta("http://www.ats.ucla.edu/stat/data/hsbdemo.dta")) mnl<-lapply(c(model1="male",model2="female"), function(x){multinom(prog ~ ses + write, data = ml[female==x,])}) I want to create two tables: one for coefficients corresponding to "academic" and one

How to show significance stars in R Markdown (rmarkdown) html output notes?

血红的双手。 提交于 2020-03-01 14:34:01
问题 I want to show regression outputs in HTML documents using R Markdown. I tried the texreg and stargazer packages. My problem is now, that in the notes I can't bring the significance stars to life. Due to automatic generation it seems I can't escape them. I've been puzzling around with this and this but with no success. What am I missing? Thanks a lot!! Here's some code: ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r data} library(car) lm1 <- lm(prestige ~ income +

How to show significance stars in R Markdown (rmarkdown) html output notes?

妖精的绣舞 提交于 2020-03-01 14:32:09
问题 I want to show regression outputs in HTML documents using R Markdown. I tried the texreg and stargazer packages. My problem is now, that in the notes I can't bring the significance stars to life. Due to automatic generation it seems I can't escape them. I've been puzzling around with this and this but with no success. What am I missing? Thanks a lot!! Here's some code: ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r data} library(car) lm1 <- lm(prestige ~ income +

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

get rid of captions when using texreg in Rmarkdown

大城市里の小女人 提交于 2019-12-22 18:11:11
问题 How do you suppress captions for a texreg table? I'm using Rmarkdown to generate a LaTeX file. Here's a simple example: ```{r, echo=FALSE, message=FALSE, results="asis"} library(texreg) data <- data.frame(a=c(1,2,3,4), b=c(6,3,4,4)) texreg(lm(a~b, data=data), caption="", custom.note="", float.pos="h!") ``` The table I get has a caption on the bottom that says "Table 1:". How do I get rid of it? Thanks. 回答1: In the YAML section where LaTeX packages can be included, add the caption package:

Format model display in texreg or stargazer R as scientific

随声附和 提交于 2019-12-21 00:04:47
问题 I just ran a statisitical model and i want it to display the results of the model as a table using stargazer. However, the large numbers are displayed in full. fit2<-lm(A~B,data=C) stargazer(fit2,type="text") With this table as result =================================================== Dependent variable: ------------------------------- A --------------------------------------------------- B -0.599 (1.698) 32,126,391.000 (24,004,268.000) ---------------------------------------------------