**Problem :**

While I am trying to run the boxcox transformation with the following code

urban1 <- subset(ski,urban <= 4,na.rm=TRUE)

ski$gender <- as.numeric((as.character(ski$gender)),na.rm=TRUE)

urban1 <- as.numeric((as.character(urban1)))

a <- (ski$gender*urban1)

b <- ski$EPSI.

bc <- boxcox(b ~ a)

(trans <- bc$a[which.max(bc$b)])

model3 <- lm(b ~ a)

model3new <- lm(b^trans ~ a)

ski$EPSI. <- ski$EPSI. + 1

But I am facing following error message:

Error in lm.fit(a,b,offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases Calls: ... eval -> eval -> boxcar -> boxcar.formula -> lm -> lm.fit Execution halted

Please let me know if anyone knows the solution for this error message.