Facebook
From Thundering Plover, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 39
  1. set.seed(202003)
  2. x <- rnorm(10, mean = 2, sd = 3)
  3. x
  4. mean(x)
  5. y <- rnorm(10, mean = 2, sd = 3)
  6. y
  7. x
  8. cov(x,y)
  9. cor(x,y)
  10. cor(x,-y)
  11. rgamma(10, 1, 3)
  12. rt(10, 20)
  13. rt(10, 100)
  14.  
  15. macierz <- matrix(0, nrow = 10, ncol = 5)
  16. macierz[,1] <- x
  17. macierz[,2] <- y
  18.  
  19. set.seed(202003)
  20. macierz[,3] <- rgamma(10, 1, 3)
  21.  
  22. set.seed(202003)
  23. macierz[,4] <- rt(10, 20)
  24.  
  25. set.seed(202003)
  26. macierz[,5] <- rt(10, 100)
  27. macierz
  28.  
  29. cov(macierz)
  30.  
  31. cor(macierz)
  32.  
  33. t.test(macierz[,1], alternative = "two.side", mu = 2)
  34.  
  35. t.test(macierz[,1], alternative = "two.side", mu = 4.73)
  36.  
  37. t.test(macierz[,1], macierz[,2])
  38.  
  39. shapiro.test(macierz[,1])
  40. shapiro.test(macierz[,5])
  41. ?t.test
  42. macierz[,1]
  43.