Closed mchien20 closed 6 years ago
For Chapter 9 page 290, I can't get color = ~ indicator variable to work. library(mosaic) library(readr) Coasters <- read_csv("http://nhorton.people.amherst.edu/is5/data/Coasters_2015.csv") gf_point(Duration ~ Drop, color = ~ as.factor(Inversions), data = Coasters) %>% gf_lm() %>% gf_labs(color = "Inversions") coasterlm2 <- lm(Duration ~ Drop + as.factor(Inversions), data = Coasters) msummary(coasterlm2) gf_point(resid(coasterlm2) ~ fitted(coasterlm2)) %>% gf_labs(x = "Predicted", y = "Residuals")
https://github.com/Amherst-Statistics/IS5inR/commit/de258ed94866de545c0d297e2d839a2936de21e6
For Chapter 9 page 290, I can't get color = ~ indicator variable to work. library(mosaic) library(readr) Coasters <- read_csv("http://nhorton.people.amherst.edu/is5/data/Coasters_2015.csv") gf_point(Duration ~ Drop, color = ~ as.factor(Inversions), data = Coasters) %>% gf_lm() %>% gf_labs(color = "Inversions") coasterlm2 <- lm(Duration ~ Drop + as.factor(Inversions), data = Coasters) msummary(coasterlm2) gf_point(resid(coasterlm2) ~ fitted(coasterlm2)) %>% gf_labs(x = "Predicted", y = "Residuals")