Created
July 31, 2021 10:24
-
-
Save arimitramaiti/3c81a3aa99c82b8379c062e51d00c945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r echo=FALSE, results='asis'} | |
library("rmarkdown") | |
library("tinytex") | |
library("stargazer") | |
library("sandwich") | |
m1 = lm(drat~ disp + hp + wt, data = mtcars) | |
m2 = lm(mpg~ disp + hp + wt, data = mtcars) | |
model.lst = list(m1, m2) | |
stargazer(m1, | |
m2, | |
title="Displaying results for multiple response variables", | |
type = "latex", | |
float = TRUE, | |
report = "vcs*", | |
se=lapply(model.lst, function(x) sqrt(diag(vcovHC(x, type = "HC1")))), | |
no.space = TRUE, | |
header=FALSE, | |
single.row = TRUE, | |
font.size = "small", | |
intercept.bottom = F, | |
covariate.labels = c("Displacement (cu.in.)", "Gross horsepower", "Weight (lb/1000)"), | |
column.labels = c("Rear axle ratio", "Miles per gallon"), | |
column.separate = c(1, 1), | |
digits = 2, | |
t.auto = F, | |
p.auto = F, | |
notes.align = "l", | |
notes = c("datasets::mtcars", "lm() function with Robust SE"), | |
notes.append = TRUE | |
) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment