Hi,

I am a very new user trying to wade through data analysis for a class that requires R yet has taught us very little about how to use it. With that said, I'm perplexed and am sure this is a simple fix. I am trying to use binomial regression to examine *Pref* by *Disability* and *Senior* in order to find the *p* -value of the *Disability* × *Senior* interaction. I know that I need a binary y to run the GLM but how do I run a GLM in that case? The assignment specifically says we have to run GLM. Screenshot of partial data attached. Thank you so much in advance for any advice.

deviceprefsSr = read.csv("deviceprefsSr.csv")

View(deviceprefsSr)

deviceprefsSr$Subject = factor(deviceprefsSr$Subject) # convert to nominal factor

deviceprefsSr$Senior = factor(deviceprefsSr$Senior) # Rv4

deviceprefsSr$Disability = factor(deviceprefsSr$Disability) # Rv4

View(deviceprefsSr)

library(car) # for Anova

library(carData)

contrasts(deviceprefsSr$Senior) <- "contr.sum"

contrasts(deviceprefsSr$Disability) <- "contr.sum"

m = glm(Pref ~ Disability * Senior, data=deviceprefsSr, family=binomial)

Anova(m, type=3)

Error: Error in eval(family$initialize) : y values must be 0 <= y <= 1