SHARE
TWEET

Untitled

a guest May 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data <- c(40, 40, 5, 41, 41, 4, 41, 5, 42, 42, 43, 43, 45, 45, 45,
  2.           45, 46, 47, 5, 48, 5, 48, 50, 50, 50, 51, 52, 52, 53, 55)
  3.  
  4. data.frame(row = data)
  5.  
  6. mean(data)
  7.  
  8. median(data)
  9.  
  10. factorx <- factor(cut(data, breaks=seq(0,max(data),5)))
  11. factorx
  12. xout <- as.data.frame(table(factorx))
  13. xout
  14.  
  15. library("ggplot2")
  16.  
  17. ggplot(data.frame(row = data), aes(x = row)) + geom_freqpoly(binwidth = 5)
  18.  
  19.  
  20. #last bsp
  21. alpha <- 3
  22. beta <- 1/30
  23.  
  24. data <- rgamma(40000,alpha,beta)
  25. mean(data)
  26. sd(data)
  27.  
  28. hist(data)
  29.  
  30. sum(data >= 80)/ 40000
  31.  
  32. #b
  33. n <- 100
  34. tmp <- sample(data,2000*n,replace = TRUE)
  35. m <- matrix(tmp,nrow = 2000,byrow = TRUE)
  36. yo <- rowMeans(m)
  37. hist(yo)
  38.  
  39. qqnorm(yo)
  40. qqline(yo)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top