hirogami

2017PTWeightedEJ_script

May 5th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. # On Normal Distritutiong
  2. # Making plots for the results of the placement tests with ggplot2
  3. # call ggplot2
  4. library(ggplot2)
  5. # call psych
  6. library(psych)
  7. # read the data original
  8. ej0 <- read.table("http://pastebin.com/raw/UUk2NNwx", header=TRUE)
  9. # read the data arbitrarily weighted
  10. ejw0 <- read.table("http://pastebin.com/raw/HuYTgHkw", header=TRUE)
  11. # summary for english original
  12. summary(ej0$emarks)
  13. # histogram for enlish original
  14. qplot(ej0$emarks, geom="histogram", main = "Histogram for English Original",
  15. xlab = "score", fill=I("grey"), binwidth = 5)
  16. # summary for english weighted
  17. summary(ejw0$escorew)
  18. # histogram for english weighted
  19. qplot(ejw0$escorew, geom="histogram", main = "Histogram for English Weighted",
  20. xlab = "score", fill=I("grey"), col=I("black"), binwidth = 5)
  21. # summarky for japanese original
  22. summary(ej0$jmarks)
  23. # histogram for japanese original
  24. qplot(ej0$jmarks, geom="histogram", main = "Histogram for Japanese Original",
  25. xlab = "score", fill=I("lightblue"), binwidth = 5)
  26. # summary for japanese weighted
  27. summary(ejw0$jscorew)
  28. # histogram for japanese weighted
  29. qplot(ejw0$jscorew, geom="histogram", main = "Histogram for Japanese Weighted",
  30. xlab = "score", fill=I("lightblue"), col=I("black"), binwidth = 5)
  31. # convert dep to character original
  32. ej0$dep <- as.character(ej0$dep)
  33. # plot two graphs original
  34. ggplot(ej0)+
  35. geom_point(aes(x=jmarks, y=emarks, color=dep))+
  36. geom_smooth(aes(x=jmarks, y=emarks, color=dep))
  37. # convert dep to character weighted
  38. ejw0$dep <- as.character(ejw0$dep)
  39. # plot two graphs weighted
  40. ggplot(ejw0)+
  41. geom_point(aes(x=jscorew, y=escorew, color=dep))+
  42. geom_smooth(aes(x=jscorew, y=escorew, color=dep))
  43. # give different marks to deps original
  44. ggplot(ej0, aes(x=jmarks, y=emarks, color=dep, shape=dep))+
  45. geom_point()
  46. # give different marks to deps weighted
  47. ggplot(ejw0, aes(x=jscorew, y=escorew, color=dep, shape=dep))+
  48. geom_point()
  49. # combine data for psych original
  50. ej1 <- ej0[c("emarks", "jmarks")]
  51. # histogram, correlational coefficiant and regression line original
  52. pairs.panels(ej1)
  53. # combine data for psych weighted
  54. ejw1 <- ejw0[c("escorew","jscorew")]
  55. # histogram, correlational coefficiant and regression line weighted
  56. pairs.panels(ejw1)
  57. # shapiro-wilk test of normality for english original
  58. shapiro.test(ej1$emarks)
  59. # shapiro-wilk test of normality for japanese original
  60. shapiro.test(ej1$jmarks)
  61. # shapiro-wiilk test of normality for english weighted
  62. shapiro.test(ejw1$escorew)
  63. # shpiro-wilk test of normality for japanese weighted
  64. shapiro.test(ejw1$jscorew)
  65. # correlation by speaman's original
  66. cor.test (ej1$emarks, ej1$jmarks, method="s")
  67. # correlation by speaman's weighted
  68. cor.test (ejw1$escorew, ejw1$jscorew, method="s")
Add Comment
Please, Sign In to add comment