Laith Ali
Laith Ali

Reputation: 11

How do I figure out which median is larger using wilcoxon rank sum test?

I am really new and the TA's asked me to come here for any help for RStudio. This week we're learning about the Wilcoxon rank sum exact test. I understand (I think) that the P value the test returns is that if P < 0.05 then, the data comes from different distributions. But, the homework question asks:

Time to next cub was (longer/shorter) ___________ for females who lost a cub to infanticide.

I am stuck and I cannot figure this out, I would love some help!

Here is the full homework question for some context.

"When an intruding male lions take over a pride of females, they often kill most or all of the infants in the group. Following takeover, the stability of the pride is unpredictable, and scientists hypothesized that females may delay ovulation until the uncertainty has passed. To examine this, a study of lions in the Serengeti measured the time to reproduction of female lions after losing cubs to infanticide, compared to the time to reproduction after losing cubs to accidental death.

Let us assume that the data are not normally distributed. Conduct an appropriate statistical test on the data in the file lions.csv to determine if there is a significant difference in reproduction time."

Data table for the question:

enter image description here

Upvotes: 1

Views: 376

Answers (1)

user11599
user11599

Reputation: 326

To make it easier to interpret, you can use the version of wilcox.test() that takes x values and y values, and produce a confidence interval for the pseudo median of x-y. If that is negative, the implication is that the values in the x group are significantly smaller than those in the y group.

acc <- c(110,117,133,135,140,168,171,238,255)
infant <- c(211,232,246,251,275)
> wilcox.test(x=acc, y=infant, paired=FALSE, conf.int=TRUE)

    Wilcoxon rank sum exact test

data:  acc and infant
W = 6, p-value = 0.02897
alternative hypothesis: true location shift is not equal to 0
95 percent confidence interval:
 -134  -13
sample estimates:
difference in location 
                   -94 

Upvotes: 1

Related Questions