I'm running a multivariate regression in R with 5 separate OLS regressions in a single model.
set.seed(1)
SampleData <- data.frame(X = sample(1:10), X1 = sample(1:10),
X2=sample(1:10), X3=sample(1:10), X4=sample(1:10), Y=sample(c("yes", "no"),
10, replace = TRUE))
OLS1 <- lm(X~X1, data=SampleData)
OLS2 <- lm(X~X1+X2, data=SampleData)
OLS3 <- lm(X~X1+X2+X3, data=SampleData)
OLS4 <- lm(X~X1+X2+X3+Y, data=SampleData)
OLS5 <- lm(X~X1+X2+X3+Y+X4, data=SampleData)
library(stargazer)
stargazer(OLS1, OLS2, OLS3, OLS4, OLS5,
type="text", omit="X4", omit.labels="X4 Omitted?")
For the last column (5) in the stargazer output
, I include variable year
and omit from model.
omit="year",
omit.labels="Year Omitted?"
However, each column of the "X4 Omitted?" row reads "No" in the model, while I want columns 1-4 to indicate "Yes" and column 5 to indicate "No":
I had thought omit.labels
would identify this in the model and can't seem to find a formula to fix. Appreciate any help, thanks.