# [Rd] PR#896

Torsten Hothorn Torsten.Hothorn@rzmail.uni-erlangen.de
Wed, 18 Apr 2001 11:44:11 +0200 (MEST)

```On 16 Apr 2001, Peter Dalgaard BSA wrote:

> Torsten Hothorn <Torsten.Hothorn@rzmail.uni-erlangen.de> writes:
>
> > > c(3.770684,4.654342,3.496403,1.772743,1.624953,2.645835,3.0994
> > > 77,1.706758,3.507709,1.982924)
> > > y<-c(-0.8161288,0.1632923,0.6421997,1.9270846,-
> > > 0.4668112,0.3587806,0.3312529,-0.5393900,
> > > 0.1057892,1.7963575)
> >
> > `wdiff' is used for the computation of asymptotic confidence intervals for
> > samples with m,n > 50. I simulated the type I error rate and it works for
> > such large sample sizes. So maybe the problems are due to n.x = n.y = 10 ?
> >
> > Torsten
>
> I think the real problem is here:
>
> > > ol<-optimize(wdiff,c(mumin,mumax),zq=qnorm(0.05))\$minimum
> > > om<-optimize(wdiff,c(mumin,mumax),zq=qnorm(0.5))\$minimum
> > > ou<-optimize(wdiff,c(mumin,mumax),zq=qnorm(0.95))\$minimum
> > >
> > > abline(v=ol)
> > > abline(v=om,lty=4)
> > > abline(v=ou,lty=7)
>
> Optimize() is a gradient algorithm and wdiff is not smooth, so the
> algorithm terminates at a stationary non-optimal point. Using optim()
> not perfectly. (I played with this before going on Easter holiday, and
> I'm not going to reconstruct exactly what I did then just now....)

Yes. We replaced `optimize' by `uniroot' in `wilcox.test' and use `optim'
in `ansari.test' now.

Torsten

>
> --
>    O__  ---- Peter Dalgaard             Blegdamsvej 3
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```