[R] Wilcoxon and the use of simulation

peter dalgaard pdalgd at gmail.com
Fri Oct 14 11:32:33 CEST 2011


On Oct 14, 2011, at 09:39 , shl2a wrote:

> Dear forum users,
> 
> It's 3:35am and I am swamped with statistics homework lol
> I'm terrible with R and this time I have no idea what the prof wants. Here
> is the question:
> 
> Consider the (two-­‐sample) Wilcoxon rank statistic T = Σrank(Xi). For
> n1=106 and n2=192, determine by simulation the α=.05 critical point for
> testing H0: θ=0, H1:θ<0.
> We can do this as follows: 
> 
> For m=10000 (no wimpy m=200 or 500 as in the book), 
> draw m=10000 subsets of size 106 from the integers 1:298 
> using repeatedly the command 
> 
> xdat = sample(1:298, size=106). 
> 
> For each such subset, the value of the Wilcoxon is sum(xdat). Be sure to
> answer the following question: why is it unnecessary to calculate ranks?
> 
> Any help would be greatly appreciately at this time.

Well, he wants you to use your brain, not ours... This is not a list for helping people with their homework. Look through your teaching materials and notes and see if your friendly prof hasn't already provided an example of doing replicated simulations, drawing a histogram of the results, etc. 


-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list