-1

I have a set of data, after questioning customers.(it's about a shoe company) Two of the columns include GENDER and INCOME. I am supposed to test if there are any significant differences in income between genders, and give the corresponding P-value.

I'm still a n00b when it comes to R, I'm still learning and I've been struggling for 3 days now to find the functions to do so. Does anyone have any lead, or could help me with it? would be awesome.

lmo
  • 37,904
  • 9
  • 56
  • 69
deliapitu
  • 3
  • 1
  • 3
    Welcome to StackOverflow. Take a minute to read through these tips on creating a [minimum example](http://stackoverflow.com/help/mcve) and this post on creating a [great example in R](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and then tell us what you tried and provide a sample set of data. As it stands, your question is quite broad. – lmo May 31 '16 at 15:24

1 Answers1

0

I am editing this because I realized my other answer was not correct.

What you want is a linear model.

say

GENDER <- factor(c(0,1,1,0,1)
INCOME <- c(20000,30000,40000,50000,550000)

then you want

model <-lm(INCOME~GENDER)

and

summary(model)
anova(model) 

will give you the information you are after.

Good luck, Bryan

Bryan Goggin
  • 2,449
  • 15
  • 17