[R] coin::oneway_test and independence_test ...was Re: (no subject)

David Winsemius dw|n@em|u@ @end|ng |rom comc@@t@net
Mon Nov 4 20:22:29 CET 2019


You _should_ read the Posting Guide. Informative subjects are 
emphatically requested, and rhelp is a plain text mailing list

On 11/4/19 9:30 AM, imran damkar wrote:
> Hi,
> I would like to know what is the difference between function oneway_test
> and independence_test of coin package.


It's not so much that they are "different", but rather that one is 
(much) more general than the other. If you look at the code, which one 
should always do in such questions, you immediately see that 
`oneway_test` calls `independence_test` after some setup of parameters.  
You should also read ?oneway_test and ?independence_test where this is 
also clearly explained. The `oneway_test` is actually a method to do 
some of the tests that you would encounter in a traditional introductory 
statistics course in the section on "nonparametric tests". So 
`oneway_test` is just a restricted type of the more general 
"independence test" suite of methods.

methods(oneway_test)
[1] oneway_test.formula* oneway_test.IndependenceProblem*

# since the default method is not exposed, use `getAnywhere`


getAnywhere(oneway_test.IndependenceProblem)

# omitting parameter setup code

object <- do.call("independence_test", c(list(object = object),
         args))

if (is_ordered_x(object using statistic))
         object using method <- "Linear-by-Linear Association Test"
     else if (twosamp) {
         object using method <- "Two-Sample Fisher-Pitman Permutation Test"
         object using nullvalue <- 0
     }
    else object using method <- "K-Sample Fisher-Pitman Permutation Test"

object

#------------------

-- 

David.

> You will highly appreciated
> Regards
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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