nes_1976 <- nes %>%   filter(year == 1976) nes_1976$rep_pres_intent <- as.factor(nes_1976$rep_pres_intent) myvars <- c("ideo7", "black", "female", "rep_pres_intent", "presapprov", "age",             "educ1", "urban", "income", "union", "perfin1") newdata <- nes_1976[myvars] data.num <- newdata %>%   mutate(ideo7=as.numeric(ideo7)) %>%   mutate(black=as.numeric(black)) %>%   mutate(female=as.numeric(female)) %>%   mutate(presapprov=as.numeric(presapprov)) %>%   mutate(educ1=as.numeric(educ1)) %>%   mutate(urban=as.numeric(urban)) %>%   mutate(income=as.numeric(income)) %>%   mutate(union=as.numeric(union)) %>%   mutate(perfin1=as.numeric(perfin1)) lm2 <- glm(rep_pres_intent ~., data = data.num, family = binomial) summary(lm2) mmplot(lm2) ## this blows up the memory allocated to it. Less smooth fits require ## more memory. After looking at help(mmplot), help(locfit), ## help(locfit.raw), and help(lp) [and some web spelunking], I ## determined that the following makes a reasonable tradeoff between ## not blowing up memory and not having too smooth a fit: ## ## ## mmplot(lm2,locfit.control=list(nn=1),layout=c(4,3)) ## ## ## Details on the parameters that can affect smoothing (with different ## names) can be found in Chapter 2 of ## ## Loader, C. (1999). Local regression and likelihood. Springer ## Science & Business Media. ## ## A pdf of the book can be had for free from springer link.