#Here is the data for the GLM code: dat = read.table("https://edoras.sdsu.edu/~babailey/stat700/Purchase.txt",header=TRUE) results = glm(new ~ income + age, family=binomial, data=dat) #Now, make some fake groupings! fakegroupings <- rep(1:3,11) dat2 <- data.frame(dat, fg=fakegroupings) results2 = glmer(new ~ income + age + (1|fg), family=binomial, data=dat2) #For glm with family=poisson dat3 <- read.csv("https://edoras.sdsu.edu/~babailey/stat700/Elephants.csv", header=TRUE)