[R] SIGN.test

William Dunlap wdunlap at tibco.com
Thu Jan 3 01:59:13 CET 2013


There is a SIGN.test in package:BSDA and it does not work as documented - it returns
a matrix of confidence intervals in some situations and the documented htest object
in others.  E.g.,
  > x <- log2(1:32)
  > str(SIGN.test(x, md=1, alt="less", conf.level=1))
  List of 8
   $ statistic  : Named int 30
    ..- attr(*, "names")= chr "s"
   $ p.value    : num 1
   $ estimate   : Named num 4.04
    ..- attr(*, "names")= chr "median of x"
   $ null.value : Named num 1
    ..- attr(*, "names")= chr "median"
   $ alternative: chr "less"
   $ method     : chr "One-sample Sign-Test"
   $ data.name  : chr "x"
   $ conf.int   : atomic [1:2] -Inf 5
    ..- attr(*, "conf.level")= num 1
   - attr(*, "class")= chr "htest"
  > str(SIGN.test(x, md=1, alt="less", conf.level=0.95))
  
          One-sample Sign-Test

  data:  x
  s = 30, p-value = 1
  alternative hypothesis: true median is less than 1
  95 percent confidence interval:
       -Inf 4.403694
  sample estimates:
  median of x
     4.043731

   num [1:3, 1:3] 0.945 0.95 0.975 -Inf -Inf ...
   - attr(*, "dimnames")=List of 2
    ..$ : chr [1:3] "Lower Achieved CI" "Interpolated CI" "Upper Achieved CI"
    ..$ : chr [1:3] "Conf.Level" "L.E.pt" "U.E.pt"

You should bug the maintainer of the package about this.  I doubt it has anything to do with the version of R itself.
  > maintainer("BSDA")
  [1] "Alan T. Arnholt <arnholt at math.appstate.edu>"
  > packageVersion("BSDA")
  [1] '1.1'

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of Rolf Turner
> Sent: Wednesday, January 02, 2013 4:23 PM
> To: solafah bh
> Cc: R help mailing list
> Subject: Re: [R] SIGN.test
> 
> On 03/01/13 07:45, solafah bh wrote:
> > Hello
> > I used SIGN.test function in R 2.12.2 to apply one sample sign test and it is worked well
> ,but I want to put statistic in a variable and I could not get this value,
> > I used :
> > x=rnorm(100)
> > t=SIGN.test(x,md=0,alt="less")
> > t$rval[1]$statistic
> >
> > the last command work in the old version of R but it does not work in R 2.12.2. what
> can I do to get value of statistic??
> 
> There does not appear to be any such function as "SIGN.test" in the
> default configuration of R.
> 
> See fortune("mind_read").
> 
>      cheers,
> 
>          Rolf Turner
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list