if (FALSE) { # rlang::is_installed("systemfit")
set.seed(27)
# load libraries for models and data
library(systemfit)
# generate data
df <- data.frame(
X = rnorm(100),
Y = rnorm(100),
Z = rnorm(100),
W = rnorm(100)
)
# fit model
fit <- systemfit(formula = list(Y ~ Z, W ~ X), data = df, method = "SUR")
# summarize model fit with tidiers
tidy(fit)
tidy(fit, conf.int = TRUE)
}
Run the code above in your browser using DataLab