texreg

R markdown “texreg”

╄→гoц情女王★ 提交于 2019-12-12 23:56:40
问题 I would like to get latex table of regression results by using following comments; Analysis1 <- glm(y~x, data=data1, family=quasibinomial(link="logit")) summary(Analysis1) texreg(list(Analysis1),dcolumn = TRUE, booktabs = TRUE, use.packages = TRUE, label = "tab:1", caption = "Regression Estimation Results",float.pos = "hb") However, this "texreg" commands gives raw output instead of clean table; \begin{table}[ht] \centering \begin{tabular}{rrrrr} \hline & Estimate & Std. Error & t value & Pr(

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

texreg-ing Tobit output from zelig package (R)

£可爱£侵袭症+ 提交于 2019-12-11 08:59:08
问题 This is a strange question, but here goes: I am trying to output my model results into a TeX table with texreg . reg <- zelig(Y ~ X, model = "tobit", below = 0, above = Inf) However, I'm getting an error from texreg : texreg(reg) Error in .local(model, ...) : Only the following Zelig models are currently supported: logit, ls, mlogit, ologit, probit, relogit. My question is basically: is this an error from Zelig or from texreg ? 回答1: UPDATE 2015-07-20: extract.zelig now has a tobit method (

dcolumn not available. Solution or alternative (for use with texreg)?

会有一股神秘感。 提交于 2019-12-11 06:28:50
问题 I would like to use dcolumn to align table columns in a texreg output, as recommended in the user guide for texreg . However, dcolumn seems not available for the current version of R: > install.packages("dcolumn") Warning in install.packages : package ‘dcolumn’ is not available (for R version 3.4.3) Any solution/recommendation for an alternative approach? (Tables will be compiled with knitr in RStudio.) 回答1: dcolumn is not an R package (CRAN) but it is a LaTex package (CTAN). Have you tried

Issue creating model summary table using package texreg with RStudio/rmarkdown/knitr

和自甴很熟 提交于 2019-12-08 02:11:39
问题 I'm using the RStudio IDE (v 0.99.323) with rmarkdown and am attempting to produce model tables via knitr using htmlreg to produce MSWord output. Suspect I've missed something simple. The rmarkdown chunk appended below creates a separate word file 'mytable.doc' with a beautiful table. However, when I click 'Knit Word' in the RStudio IDE, the line htmlreg(m) generates html table code in the MSWord document. What am I doing wrong? Many thanks! --Dale ```{r, results='asis'} library(MASS) library

Computing p.values in spatial econometric models: why are there inconsistencies between summary() and texreg()?

痴心易碎 提交于 2019-12-07 09:25:25
问题 I am estimating some spatial econometric models that contain both a spatial autoregressive term rho and a spatial error term lambda. In attempting to communicate my results I was using the texreg package, which accepts the sacsarlm models I am working with. I noticed, however, that texreg is printing p-values for the rho and lambda parameters that are identical. Texreg appears to be returning the p-value found in the model@LR1$p.value slot of the model object. The parameters rho and lambda

Clustered standard errors with texreg?

雨燕双飞 提交于 2019-12-06 15:12:06
问题 I'm trying to reproduce this stata example and move from stargazer to texreg . The data is available here. To run the regression and get the se I run this code: library(readstata13) library(sandwich) cluster_se <- function(model_result, data, cluster){ model_variables <- intersect(colnames(data), c(colnames(model_result$model), cluster)) model_rows <- as.integer(rownames(model_result$model)) data <- data[model_rows, model_variables] cl <- data[[cluster]] M <- length(unique(cl)) N <- nrow(data

get rid of captions when using texreg in Rmarkdown

匆匆过客 提交于 2019-12-06 10:13:14
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. In the YAML section where LaTeX packages can be included, add the caption package: header-includes: - \usepackage{caption} Then at the beginning of the RMarkdown document body add: \captionsetup

How to decimal-align regression coefficients in Latex table output in rmarkdown document

我只是一个虾纸丫 提交于 2019-12-06 07:49:59
问题 In an rmarkdown document, I'm creating a Latex table of regression coefficients with standard errors to compare several regression models in a single table. I'd like to vertically align the coefficients for each model so that the decimal points of the coefficients line up vertically down a column. I'm using texreg to create the table. The coefficients aren't decimal-aligned by default (instead, each string is centered within its column) and I'm looking for a way to get the coefficents decimal

Robust se. (vcovHC) to be shown with texreg in R

為{幸葍}努か 提交于 2019-12-04 04:29:54
问题 I am doing some regressions with the plm package, then if needed, I also obtain heteroskedasticity consistent coefficients. Below are the commands that I run; library(plm) data("Produc", package = "plm") zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, index = c("state","year")) summary(zz) coeftest(zz, vcovHC) My problem starts here. Below is the list of commands to obtain a Latex output with the help of the texreg. How can I integrate the result obtained with the