R-alpha: another ctest question

Peter Dalgaard BSA
Thu, 21 Aug 1997 23:11:18 -0000

Kurt Hornik <hornik@ci.tuwien.ac.at> writes:

>
> I have the following problem.  Consider a `classical' test which works
> for k .ge. 2 samples.  Possible interfaces are e.g.
>
> 	xxx.test(x, g)	    x ... all data, g ... corresponding groups
> 	xxx.test(x1, ..., xk)
> 	xxx.test(list(x1, ..., xk))
>
> etc etc.
>
> Clearly, the first and the second one are nice, but cannot be combined
> without making `g' (i.e., `group') a named argument.

I'm sort of beginning to like the list(...) construction. It might
also allow one to assign meaningful tags to the variables (as in
kruskal.test(list(bp.males=dataframe$bp[dataframe$sex==1],bp.females=....)

>   var.test(x, y = NULL, ..., group = NULL, alternative =
"two.sided",
> 	   conf.level = 0.95, var = 1, ratio = 1, method = "Bartlett")
>
> ???
>
> If so, should the interface to kruskal.test be changed accordingly?
>
> Please advise me here.
>

You won't gain much above (pardon the sketchy code)

var.test(x,g = NULL,..etc..)
if (is.list(x))
	g<-...
	x<-c(x)

if( g == NULL) ng<-1 else ng<-length(unique(g[nonmiss]))
if (ng == 1)
	..
else if (ng == 2)
	..
else
	..

I'd say that the real issue is whether t.test should be supplied with
a group= parameter?

--
   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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-