Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # On Normal Distritutiong
- # Making plots for the results of the placement tests with ggplot2
- # call ggplot2
- library(ggplot2)
- # call psych
- library(psych)
- # read the data original
- ej0 <- read.table("http://pastebin.com/raw/UUk2NNwx", header=TRUE)
- # read the data arbitrarily weighted
- ejw0 <- read.table("http://pastebin.com/raw/HuYTgHkw", header=TRUE)
- # summary for english original
- summary(ej0$emarks)
- # histogram for enlish original
- qplot(ej0$emarks, geom="histogram", main = "Histogram for English Original",
- xlab = "score", fill=I("grey"), binwidth = 5)
- # summary for english weighted
- summary(ejw0$escorew)
- # histogram for english weighted
- qplot(ejw0$escorew, geom="histogram", main = "Histogram for English Weighted",
- xlab = "score", fill=I("grey"), col=I("black"), binwidth = 5)
- # summarky for japanese original
- summary(ej0$jmarks)
- # histogram for japanese original
- qplot(ej0$jmarks, geom="histogram", main = "Histogram for Japanese Original",
- xlab = "score", fill=I("lightblue"), binwidth = 5)
- # summary for japanese weighted
- summary(ejw0$jscorew)
- # histogram for japanese weighted
- qplot(ejw0$jscorew, geom="histogram", main = "Histogram for Japanese Weighted",
- xlab = "score", fill=I("lightblue"), col=I("black"), binwidth = 5)
- # convert dep to character original
- ej0$dep <- as.character(ej0$dep)
- # plot two graphs original
- ggplot(ej0)+
- geom_point(aes(x=jmarks, y=emarks, color=dep))+
- geom_smooth(aes(x=jmarks, y=emarks, color=dep))
- # convert dep to character weighted
- ejw0$dep <- as.character(ejw0$dep)
- # plot two graphs weighted
- ggplot(ejw0)+
- geom_point(aes(x=jscorew, y=escorew, color=dep))+
- geom_smooth(aes(x=jscorew, y=escorew, color=dep))
- # give different marks to deps original
- ggplot(ej0, aes(x=jmarks, y=emarks, color=dep, shape=dep))+
- geom_point()
- # give different marks to deps weighted
- ggplot(ejw0, aes(x=jscorew, y=escorew, color=dep, shape=dep))+
- geom_point()
- # combine data for psych original
- ej1 <- ej0[c("emarks", "jmarks")]
- # histogram, correlational coefficiant and regression line original
- pairs.panels(ej1)
- # combine data for psych weighted
- ejw1 <- ejw0[c("escorew","jscorew")]
- # histogram, correlational coefficiant and regression line weighted
- pairs.panels(ejw1)
- # shapiro-wilk test of normality for english original
- shapiro.test(ej1$emarks)
- # shapiro-wilk test of normality for japanese original
- shapiro.test(ej1$jmarks)
- # shapiro-wiilk test of normality for english weighted
- shapiro.test(ejw1$escorew)
- # shpiro-wilk test of normality for japanese weighted
- shapiro.test(ejw1$jscorew)
- # correlation by speaman's original
- cor.test (ej1$emarks, ej1$jmarks, method="s")
- # correlation by speaman's weighted
- cor.test (ejw1$escorew, ejw1$jscorew, method="s")
Add Comment
Please, Sign In to add comment