Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dt <- as.data.frame(rbind(c("m", 1.75, -2, 8),
- c("m", 1.85, -1, 10),
- c("m", 1.65, -3, 12),
- c("m", 1.95, -2, 11),
- c("f", 1.75, 2, 10),
- c("f", 1.85, 1, 11),
- c("f", 1.65, 3, 8),
- c("f", 1.95, 2, 20),
- c("u", 1.75, -2, 1),
- c("u", 1.85, -1, 17),
- c("u", 1.65, -3, 9),
- c("u", 1.95, -2, 16)
- ))
- colnames(dt) <- c("x4", "x1", "x3", "x2")
- dt$x4 <- as.factor(dt$x4)
- dt$x1 <- as.numeric(dt$x1)
- dt$x2 <- as.numeric(dt$x2)
- dt$x3 <- as.factor(dt$x3)
- summary(dt)
- model <- lm(x1 ~ x3 + x4 + x2, data = dt)
- model
- alias(model)
- Model :
- x1 ~ x3 + x4 + x2
- Complete :
- (Intercept) x3-1 x32 x3-2 x33 x3-3 x4m x2
- x4u 0 1 0 1 0 1 -1 0
Add Comment
Please, Sign In to add comment