Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y <- c(1, 0, 1, 1, 1, 1, 1, 1, 0, 0)
- x2 <- c(3, 2, 3, 1, 3, 1, 2, 2, 3, 3)
- x1 <- c(0, 0, 0, 1, 1, 1, 0, 0, 0, 2)
- x0 <- c(1, 0, 1, 0, 1, 0, 0, 0, 0, 0) # This causes separation
- test.data <- cbind(y,x0,x1,x2)
- test.data <- as.data.frame(test.data)
- library(safeBinaryRegression)
- glm(y ~ x0 + x1 + x2, data = test.data, family=binomial, separation="find")
- # Error in ... The following terms are causing separation among the sample points: (Intercept), x0, x1, x2
- glm(y ~ x0, data = test.data, family=binomial, separation="find")
- # Error in ... The following terms are causing separation among the sample points: (Intercept), x0
- glm(y ~ x1, data = test.data, family=binomial, separation="find")
- # No error message
- glm(y ~ x2, data = test.data, family=binomial, separation="find")
- # No error message
Add Comment
Please, Sign In to add comment