In: Statistics and Probability
You have the following output on the R console: > head(Salaries) Gender Salary 1 Male 43000 2 Female 45000 3 Male 95000 4 Female 88000 5 Male 76000 6 Female 55000 Your manager wants you to write some R code that will test whether there is a difference in the mean salary between Males and Females.
a) How would you use R to store vectors that contain only salaries by gender?
b) If x represents the vector of Male salaries and y represents the vector of Female salaries, what line of code in R tests for a difference in the means?
c) You are not told whether to conduct a one-sided or a two-sided test. Discuss why you might choose one over the other.
d) Suppose you conduct a two-sided test and the p-value is 0.06. What would you tell the manager?