[julia-users] Re: looking for an equivalent function to "independence_test" in the R coin package

2016-02-12 Thread Douglas Bates
On Thursday, February 11, 2016 at 6:27:26 PM UTC-6, Albert Cardona wrote:
>
> The formula operator is there via the GLM package [1], but I can't find 
> the equivalent of the independent_test function [2].
>
> [1] https://github.com/JuliaStats/GLM.jl 
> [2] http://www.inside-r.org/packages/cran/coin/docs/IndependenceTest
>
> I am not that familiar with the coin package for R but knowing the authors 
I imagine that it is non-trivial.  That particular function sits on top of 
what I imagine is considerable infrastructure and translating it into 
idiomatic Julia would take some time.  Effective Julia code is usually 
based on thoughtful definitions of a hierarchy of types and methods.  The 
S3 style of programming in R usually needs considerable refactoring to 
become idiomatic Julia.  Having a formula type is the least of the issues 
here.
 

> Thanks in advance for any pointers.
>
> Albert
>


[julia-users] Re: looking for an equivalent function to "independence_test" in the R coin package

2016-02-12 Thread Taylor Maxwell
Depending on what parts of their package you are interested in, to 
implement a small subset of their functionality I recently wrote some code 
in both Julia and R (to make sure I had an idea what they were doing to 
replicate their results)  based on the equations in page 258 of:
Hothorn T, Hornik K, Van De Wiel MA, Zeileis A, 2006. A lego system for 
conditional inference. The American Statistician 60:257-263.

The base "independencetest" function I wrote only implements scenarios 
where you have ytrans (one or more transforms of a dependent variable) and 
one set of factors as a matrix of indicator variable (xtrans) although I 
think incorporating more on the "x" side would not be hard.  It does not 
take into account multiple "blocks" and so far I have not needed to look 
into how hard that would be.

On top of this I wrote functions to do the some of the transformations that 
convert y to ytrans as input into the independenttest function (which is 
surprisingly simple).  The transformations I wrote make it possible to 
implement the Kruskal-Wallis test for location, the Fligner-Killeen test 
for scale, and a multisample Lepage test that incorporates those two tests 
jointly (the reason I did this), all with the quadratic test (Cquad).  It 
would be trivial to write the transformations for many of the other 
nonparametric tests. I wrote it to do both a parametric test as well one 
using Monte Carlo. It appears to work well and reasonably fast with the 
little testing I have done.

If you are interested I could send you the code.


On Thursday, February 11, 2016 at 5:27:26 PM UTC-7, Albert Cardona wrote:
>
> The formula operator is there via the GLM package [1], but I can't find 
> the equivalent of the independent_test function [2].
>
> [1] https://github.com/JuliaStats/GLM.jl 
> [2] http://www.inside-r.org/packages/cran/coin/docs/IndependenceTest
>
>
> Thanks in advance for any pointers.
>
> Albert
>