knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(tibble) library(stargate)
n <- 1e3 df <- tibble( x1 = rnorm(n), x2 = rnorm(n), x3 = rnorm(n), e = rnorm(n), y = x1 - 2 * x2 + 3 * x3 + e ) m1 <- lm(y ~ x1 + x2, df) m2 <- lm(y ~ x1 + x2 + x3, df) m3 <- lm(y ~ x1 + x2 * x3, df) # library(fixest) # m4 <- feols(y ~ x1 + x2 + x3, df)
sm1 <- sg_model(m1) sm2 <- sg_model(m2) sm3 <- sg_model(m3) # sm4 <- sg_model(m4)
st <- sg_table(m1, sm2) st <- sg_table(st, m3) #, m4) st
st <- sg_rename(st, stats = sg_standard_stats()) st
sft <- sg_format(st, nsmall = 3) sft
library(kableExtra) kbl(sft) |> kable_classic() |> row_spec(5, hline_after = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.