2

The following data are mandible lengths (mm) of 10 male and 10 female golden jackals Canis aureus in the collection at the British Natural History Museum. The two samples are independent.

Males:   120 107 110 116 114 111 113 117 114 112  
Females: 110 111 107 108 110 105 107 106 111 111
  1. Using a randomization test, assess whether or not there is evidence of sexual dimorphism (a difference in mean jaw length between the sexes). [Include your R code in your solution, together with an explanation of what each line of code does.]
  2. Carry out the Mann-Whitney test on these data. Is your result consistent with the result from your randomization test?
mdewey
  • 17,806
Amal
  • 21
  • 1
    This seems to be a homework problem, if so please mark this with the homework tag. Could you please say in what particular area you are having problems in? – R S Apr 01 '13 at 00:05
  • The first part of the question involving the r-code – Amal Apr 01 '13 at 00:07
  • 1
    Could you be a bit more specific? Are you having a problem with the test? Implementing the test in R? Inputting the data into R? Explaining what your code does line by line? – R S Apr 01 '13 at 00:09
  • I just don't know what codes to use in R. – Amal Apr 01 '13 at 00:17
  • Have you tried a tutorial on the tests in R like the one given here? – R S Apr 01 '13 at 00:21
  • Yes, what should the R code for the randomization of the data be like? – Amal Apr 01 '13 at 00:37
  • Closely related (including R code):http://stats.stackexchange.com/questions/43958/permutation-test-in-r. The comment threads contain some particularly helpful advice, IMHO. – whuber Apr 01 '13 at 14:00

1 Answers1

2

For a randomization test, there are a number of approaches.

Here's one: use the sample function to take samples of the size of the male group from the combined set of all scores (since under the null they come from the same distribution). You can take the means of those; if you want to do it in terms of difference in means, note that given the sample, the mean of the first group plus the mean of the second add to a constant, so the difference in means is a trivial calculation once you have the mean of the first (you can save finding one from the other until the end).

Of course, you want to do that many times, so you put that inside a call to replicate.

?sample

?replicate
Glen_b
  • 282,281