Guest User

Untitled

a guest
Dec 15th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. dt <- as.data.frame(rbind(c("m", 1.75, -2, 8),
  2. c("m", 1.85, -1, 10),
  3. c("m", 1.65, -3, 12),
  4. c("m", 1.95, -2, 11),
  5. c("f", 1.75, 2, 10),
  6. c("f", 1.85, 1, 11),
  7. c("f", 1.65, 3, 8),
  8. c("f", 1.95, 2, 20),
  9. c("u", 1.75, -2, 1),
  10. c("u", 1.85, -1, 17),
  11. c("u", 1.65, -3, 9),
  12. c("u", 1.95, -2, 16)
  13. ))
  14. colnames(dt) <- c("x4", "x1", "x3", "x2")
  15. dt$x4 <- as.factor(dt$x4)
  16. dt$x1 <- as.numeric(dt$x1)
  17. dt$x2 <- as.numeric(dt$x2)
  18. dt$x3 <- as.factor(dt$x3)
  19. summary(dt)
  20.  
  21. model <- lm(x1 ~ x3 + x4 + x2, data = dt)
  22. model
  23.  
  24. alias(model)
  25.  
  26. Model :
  27. x1 ~ x3 + x4 + x2
  28.  
  29. Complete :
  30. (Intercept) x3-1 x32 x3-2 x33 x3-3 x4m x2
  31. x4u 0 1 0 1 0 1 -1 0
Add Comment
Please, Sign In to add comment