Dear List,

I'm having problem with an exercise from The R book (M.J. Crawley) on page
567.
Here is the entire code upto the point where I get an error.

data(UCBAdmissions)
x <- aperm(UCBAdmissions, c(2, 1, 3))
names(dimnames(x)) <- c("Sex", "Admit?", "Department")
ftable(x)
fourfoldplot(x, margin = 2)
dept<-gl(6,4)
sex<-gl(2,1,24)
admit<-gl(2,2,24)
model1<-glm(as.vector(x) ~dept*sex*admit,poisson)

This last line returns:

Error in family$family : $ operator is invalid for atomic vectors

I've searched older posts but found nothing that would help resolve my
problem. Has anyone encountered anything similar and/or knows a fix?

Cheers,
Roman

	[[alternative HTML version deleted]]


