star_panel | R Documentation |
Currently only the same lhs variables and the same summary statistics across all panels are allowed
star_panel(
...,
starlist = NULL,
panel.names,
reg = TRUE,
same.lhs.vars = TRUE,
same.summary.stats = TRUE,
panel.label.fontface = "plain"
)
... |
|
starlist |
a list of |
panel.names |
the names for the panels in the same order as the stargazer output |
reg |
(logical) set to TRUE if the panels are regression output; defualt is TRUE |
same.lhs.vars |
(logical) set to |
same.summary.stats |
(logical) set to |
panel.label.fontface |
The fontface for the panel labels. Options are "plain", "italic", "bold", "bold.italic". Default is "plain". |
the updated stargazer
output
## -- Regressoin example -- ##
library(stargazer)
data(mtcars)
##First set up models without weight
mod.mtcars.1 <- lm(mpg ~ hp, mtcars)
mod.mtcars.2 <- lm(mpg ~ hp + cyl, mtcars)
star.out.1 <- stargazer(mod.mtcars.1, mod.mtcars.2, keep.stat = "n")
##Second set of models with weight as a regressor
mod.mtcars.3 <- lm(mpg ~ hp + wt, mtcars)
mod.mtcars.4 <- lm(mpg ~ hp + cyl + wt, mtcars)
star.out.2 <- stargazer(mod.mtcars.3, mod.mtcars.4, keep.stat = c("n", "rsq"))
##stargazer panel -- same summary statistics across panels.
star.panel.out <- star_panel(star.out.1, star.out.2,
panel.names = c("Without Weight", "With Weight")
)
print(star.panel.out)
##write to a tex file and compile to check output
## Not run:
tex_write(star.panel.out, file = "my_tex_file.tex", headers = TRUE)
## End(Not run)
##stargazer panel -- different summary statistics across panels.
star.panel.out2 <- star_panel(star.out.1, star.out.2,
same.summary.stats = FALSE,
panel.names = c("Without Weight", "With Weight")
)
print(star.panel.out2)
##write to a tex file and compile to check output
## Not run:
tex_write(star.panel.out2, file = "my_tex_file2.tex", headers = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.