[R] Power curve for a wilcoxon test

Ben Bolker bolker at ufl.edu
Mon Apr 14 17:29:14 CEST 2008


Duncan Murdoch <murdoch <at> stats.uwo.ca> writes:

> 
> On 4/14/2008 8:59 AM, Louisa Hay wrote:
> > Hi,
> > I am trying to write R code to produce a 
power curve to show how the power of a 
> > Wilcoxon-test varies depending on the mean, with data 
generated from a
uniform distribution. Any ideas
> how I should go about this?Louisa
> 
> I think I gave you enough of a hint to do this one in my previous 
> response to you.  Did you read it?
> 
> (Are we doing your homework for you?)
> 
> Duncan Murdoch

   To be fair, it's a little harder to do this for nonparametric tests
and non-normal distributions (the analytic result, or the non-central
distributions, or functions like power.t.test, break down if you're
talking about Wilcoxon with uniformly distributed data ... although
I'm sure there are still analytic solutions if one wants to work a bit
harder).  I agree that the poster isn't showing that much proof that
she's tried hard to tackle this herself, but "simulate it and
see how many times it is rejected" might be hard to put into practice
if one were just beginning with R.

  Ben



More information about the R-help mailing list