Advertisement
melnikovmaxim

R_L4

Jan 2nd, 2020
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 2.36 KB | None | 0 0
  1. /*
  2. link https://yadi.sk/d/1fC0MzIsPVBZdQ
  3. */
  4. y1<-c(83,70,86,51,61,67,80,84,70,64,83,55,88,75,61,70,95,52,75,92,86,89,83,58,51, 65, 87, 54, 90, 62, 67, 66, 83, 65,70, 87, 69, 51, 51, 60, 52, 74, 80, 79,85, 85, 92, 22, 92, 57, 84, 92)
  5. y1
  6. y2<-c(70, 31, 70, 46, 78, 69, 36, 33, 65, 70, 74, 51, 90, 26, 62, 70, 86, 86, 80, 33, 55, 31, 69, 31, 62,63, 86, 55, 69, 62, 31, 90, 31, 31, 69, 64, 57, 75, 53, 89, 0, 31, 81, 53, 86, 52, 98, 58, 31, 69,69, 51, 75, 39, 0, 56, 51, 69, 46, 41, 65)
  7. y2      
  8.  
  9. #1
  10. razb1_1 = cut(y1,breaks = c(-1,50,68,85,100),labels=c("2","3","4","5"),include.lowest=TRUE)
  11. razb1_1
  12. razb1_2 = cut(y1,breaks = c(-1,30,50,60,68,85,95,100),labels=c("F","FX","E","D","C","B","A"),include.lowest=TRUE)
  13. razb1_2
  14.  
  15. #2
  16. razb2_1 = cut(y2,breaks = c(-1,50,68,85,100),labels=c("2","3","4","5"),include.lowest=TRUE)
  17. razb2_1
  18. razb2_2 = cut(y2,breaks = c(-1,30,50,60,68,85,95,100),labels=c("F","FX","E","D","C","B","A"),include.lowest=TRUE)
  19. razb2_2
  20.  
  21. #3
  22. table1_1 = table(razb1_1)
  23. table1_1
  24. table2_1 = table(razb2_1)
  25. table2_1
  26. #4
  27. table1_2 = table(razb1_2)
  28. table1_2
  29. table2_2 = table(razb2_2)
  30. table2_2
  31.  
  32. #5
  33. tfr1_1 = table(razb1_1)/length(razb1_1)
  34. tfr1_1
  35. tfr1_2 = table(razb1_2)/length(razb1_2)
  36. tfr1_2
  37. tfr2_1 = table(razb2_1)/length(razb2_1)
  38. tfr2_1
  39. tfr2_2 = table(razb2_2)/length(razb2_2)
  40. tfr2_2
  41.  
  42. #6
  43. par(mfrow=c(2,2))
  44. barplot(height=table1_1,xlab="Оценка",ylab="Количество оценок",col="black")
  45. barplot(height=table1_2,xlab="Оценка",ylab="Количество оценок",col="black")
  46. barplot(height=table2_1,xlab="Оценка",ylab="Количество оценок",col="black")
  47. barplot(height=table2_2,xlab="Оценка",ylab="Количество оценок",col="black")
  48.  
  49. matrix1=cbind(table1_1,table2_1)
  50. matrix1
  51. matrix2=cbind(table1_2,table2_2)
  52. matrix2
  53.  
  54. par(mfrow=c(1,2))
  55. barplot(height=matrix1,beside=FALSE,main="Пятибальная система")
  56. barplot(height=matrix2,beside=FALSE,main="Европейская система")
  57.  
  58. par(mfrow=c(2,2))
  59. pie(table1_1,labels=c("2","3","4","5"),radius=1,col=c(1:10),main="Таблица1_1")
  60. pie(table1_2,labels=c("F","FX","E","D","C","B","A"),radius=1,col=c(1:10),main="Таблица1_2")
  61. pie(table2_1,labels=c("2","3","4","5"),radius=1,col=c(1:10),main="Таблица2_1")
  62. pie(table2_2,labels=c("F","FX","E","D","C","B","A"),radius=1,col=c(1:10),main="Таблица2_2")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement