cces18D <- svydesign(id = ~1, data = cces18, weights = ~commonweight)
m2 <- svyglm(repubtax ~ CC18_325d + ideo5 + CC18_325d, design = cces18D,family = "quasibinomial")
summary(m2)
predict.frame <- expand.grid(CC18_325d = levels(cces18$CC18_325d), ideo5 = levels(cces18$ideo5))
prediction <- predict.glm(m2, newdata = predict.frame, type = "response", se.fit = T)
prediction <- as.tibble(cbind(prediction,predict.frame))
prediction <- mutate(prediction, upr = fit + se.fit1.96, lwr = fit - se.fit1.96 )
p2 <- ggplot(data = prediction, aes(x = CC18_325d, y = fit, color = ideo5, shape = ideo5))
p2 + geom_pointrange(aes(ymin = lwr, ymax = upr))
Error in eval(family$initialize) : y values must be 0 <= y <= 1
-
stop("y values must be 0 <= y <= 1")
-
eval(family$initialize)
-
eval(family$initialize)
-
glm.fit(x = structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
-
eval(call(if (is.function(method)) "method" else method, x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, "intercept") > 0L, singular.ok = singular.ok))
-
eval(call(if (is.function(method)) "method" else method, x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, "intercept") > 0L, singular.ok = singular.ok))
-
glm(formula = repubtax ~ CC18_325d + ideo5 + CC18_325d, family = "quasibinomial", weights = .survey.prob.weights, data = data)
-
eval(g)
-
eval(g)
-
eval(substitute(expr), data, enclos = parent.frame())
-
eval(substitute(expr), data, enclos = parent.frame())
-
with.default(list(data = data), eval(g))
-
with(list(data = data), eval(g))
-
svyglm.survey.design(...)
-
survey::svyglm(...)
-
svyglm(repubtax ~ CC18_325d + ideo5 + CC18_325d, design = cces18D, family = "quasibinomial")