Guest User

Untitled

a guest
Mar 22nd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. y <- c(1, 0, 1, 1, 1, 1, 1, 1, 0, 0)
  2. x2 <- c(3, 2, 3, 1, 3, 1, 2, 2, 3, 3)
  3. x1 <- c(0, 0, 0, 1, 1, 1, 0, 0, 0, 2)
  4. x0 <- c(1, 0, 1, 0, 1, 0, 0, 0, 0, 0) # This causes separation
  5.  
  6. test.data <- cbind(y,x0,x1,x2)
  7. test.data <- as.data.frame(test.data)
  8.  
  9. library(safeBinaryRegression)
  10. glm(y ~ x0 + x1 + x2, data = test.data, family=binomial, separation="find")
  11. # Error in ... The following terms are causing separation among the sample points: (Intercept), x0, x1, x2
  12. glm(y ~ x0, data = test.data, family=binomial, separation="find")
  13. # Error in ... The following terms are causing separation among the sample points: (Intercept), x0
  14. glm(y ~ x1, data = test.data, family=binomial, separation="find")
  15. # No error message
  16. glm(y ~ x2, data = test.data, family=binomial, separation="find")
  17. # No error message
Add Comment
Please, Sign In to add comment