It appears that the stargazer package's "Observations" is incorrect if factor interactions are dropped from a model:
Here's the issue using R's built-in dataset:
data(mtcars)
names(mtcars)
mtcars$gear.f = as.factor(mtcars$gear) # create two sets of factors
mtcars$carb.f = as.factor(mtcars$carb)
fit.1 <- lm(mpg ~ gear.f*carb.f, data=mtcars)
stargazer(fit.1) # Observations is listed as 39 instead of 32
Does anyone know why this happens or how to sidestep it?