I fitted a Poisson model using svyglm in R. The null and residual deviances from the svyglm model are as expected. For the degrees of freedom however, I get confusing results. With a sample size of n=4526 and 7 parameters in the model (including the intercept), I expected a null degrees of freedom of 4526-1 = 4525, and a residual degrees of freedom of 4526-7 = 4519. This is exactly what I got with the glm model. The svyglm gives me the expected degrees of freedom for the null (4525) but not the residual. Could someone please explain what is happening here?
For simplicity, I am stripping down the output to the most critical elements:
#OUTPUT FROM SVYGLM. Degrees of Freedom: 4525 Total (i.e. Null); 33 Residual (1138 observations deleted due to missingness) Null Deviance: 1189 Residual Deviance: 770.7 AIC: NA
#OUTPUT FROM GLM. Degrees of Freedom: 4525 Total (i.e. Null); 4519 Residual (9433 observations deleted due to missingness) Null Deviance: 1339 Residual Deviance: 945.7 AIC: 1404
The respective codes used were:
svyglm(rhs, design = svyobject, family=quasipoisson(), rescale= TRUE)
glm(formula = rhs, family = poisson(), data = s)
Where rhs represents the equation ever_ecig ~ relevel(as.factor(current_shisha), ref = "0") + relevel(as.factor(saw_smoking), ref = "0") + relevel(as.factor(current_cigarette), ref = "0") + relevel(as.factor(enjoy), ref = "0") + relevel(as.factor(favor_ban_indoor), ref = "0") + relevel(as.factor(susceptible), ref = "0")