Hi,
I want to compare two nested models in stargaze. There is a way to do so by using keep.stats.
Example:
# Set the seed for reproducibility
set.seed(123)
# Generate data
Modelling_fw_data <- data.frame(
x1 = runif(100, min = 1, max = 10),
x2 = runif(100, min = 1, max = 10),
x3 = runif(100, min = 1, max = 10),
x4 = runif(100, min = 1, max = 10),
y = runif(100, min = 1, max = 10)
)
GLM_modelling_fw_example1 <- glm(
y ~ log(x1)
,data = Modelling_fw_data ,family = inverse.gaussian(link = "log") ,weights = x4)
GLM_modelling_fw_example2 <- glm(
y ~ log(x1) + x2 + x3 ,data = Modelling_fw_data ,family = inverse.gaussian(link = "log") ,weights = x4)
stargazer(GLM_modelling_fw_example1 ,GLM_modelling_fw_example2
,keep.stat = c('all')
,title='CM & RM model summary'
,model.names = FALSE
,column.labels=c('CM', 'RM')
,align=TRUE
,type = "html")
The above stargazer prints non of the statistics. Does anyone know why is that?
Thanks