Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. library(nlme)
  2. library(ggplot2)
  3. library(GGally)
  4. library(splines)
  5. library(nlme)
  6. library(fields)
  7. library(lattice)
  8. require(ISLR)
  9. library(grid)
  10. library(dplyr)
  11. library(MASS)
  12. library(mgcv)
  13. library(latticeExtra)
  14. library(fields)
  15.  
  16. setwd("C:\Users\breni\Google Drive\Acadêmica\Mestrado\Splines")
  17. dados <- read.table("leukemia.txt", header=TRUE)
  18. dados$treatment <- factor(dados$treatment)
  19. dados$case <- factor(dados$case)
  20. head(dados)
  21. attach(dados)
  22.  
  23.  
  24. interaction <- dados %>%
  25. dplyr::select(height, age, case) %>%
  26. group_by(case, age) %>%
  27. summarise(Average = mean(height))
  28.  
  29. x11()
  30. ggplot(interaction, aes(x=age, y=Average, colour=treatment, group=case)) +
  31. ggtitle("Evolução da altura em cm no tempo para cada individuo") +
  32. geom_line()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement