# Testing hypothesis for equality of medians of two #independent populations #Set working directory setwd("~/Dropbox/ISI SCB/Data sets") # read in csv file hw <-read.csv("hwage.csv", TRUE) x <- hw$Hourly.Wage[hw$Sector=="Health"] y <- hw$Hourly.Wage[hw$Sector=="Education"] #check for outliers boxplot(x,y) #assess normality assumptions of x and y qqnorm(x, ylab = "x Sample Quantiles") qqnorm(y, ylab = "y Sample Quantiles") shapiro.test(x) shapiro.test(y) #Mann Whitney U test #(Wilcoxon test) for medians of 2 independent populations wilcox.test(x,y, paired=FALSE, conf.int=TRUE) median(x) median(y) #Parametric test var.test(x,y) t.test(x,y, alternative="two.sided", var.equal = TRUE)