Independence tests         package:SpatialNP         R Documentation

_M_u_l_t_i_v_a_r_i_a_t_e _t_e_s_t _o_f _i_n_d_e_p_e_n_d_e_n_c_e _b_a_s_e_d _o_n _s_p_a_t_i_a_l _s_i_g_n_s _o_r
_r_a_n_k_s

_D_e_s_c_r_i_p_t_i_o_n:

     Test of independence between two sets of variables. Inference is
     based on the spatial signs of the observations, symmetrized signs
     of the observations or spatial signed ranks of the observations.

_U_s_a_g_e:

      sr.indep.test(X, Y = NULL, g = NULL, score = c("sign",
     "symmsign", "rank"), regexp= FALSE, cond = FALSE, cond.n = 1000,
     na.action = na.fail) 

_A_r_g_u_m_e_n_t_s:

       X: a matrix or a data frame

       Y: an optional matrix or a data frame

       g: a factor giving the two sets of variables, or numeric vector
          or vector of column names giving the first set of variables.
          See details

   score: a character string indicating which transformation of the
          observations should be used

  regexp: logical. Is 'g' a regular expression?

    cond: logical. Should the conditionally distribution free test be
          used?

  cond.n: Number of permutations to use in the conditionally
          distribution free test

na.action: a function which indicates what should happen when the data
          contain 'NA's.  Default is to fail.

_D_e_t_a_i_l_s:

     'X' should contain the first set of variables and 'Y' the second
     with matching rows. Alternatively, 'X' should contain both sets
     and 'g' should be a factor of length equal to number of columns of
     'X', or, 'g' should be a numeric or character vector naming the
     variables in the first set. If 'g' is a character vector it is
     assumed to name all wanted columns exactly, unless 'regexp' is
     'TRUE'.

_V_a_l_u_e:

     A list with class 'htest' containing the following components: 

statistic : the value of the statistic

parameter: the degrees of freedom for the statistic or the number of
          replications if conditionally distribution free p-value was
          used

 p.value: the p-value for the test

null.value: the specified hypothesized value of the measure of
          dependence (always 0)

alternative: a character string with the value 'two.sided'.

  method: a character string indicating what type of test was performed

data.name: a character string giving the name of the data (and grouping
          vector)

_A_u_t_h_o_r(_s):

     Seija Sirkia, ssirkia@maths.jyu.fi

_S_e_e _A_l_s_o:

     Spatial signs and ranks

_E_x_a_m_p_l_e_s:

     A<-matrix(c(1,2,-3,4,3,-2,-1,0,4),ncol=3)
     X<-matrix(rt(150,1),ncol=3)%*%t(A)
     Y<-cbind(X+runif(150,-1,1),runif(50))
     sr.indep.test(X,Y)
     #alternative calls:
     Z<-cbind(X,Y)
     colnames(Z)<-c("a1","a2","a3","b1","b2","b3","b4")
     g<-factor(c(rep(1,3),rep(2,4)))
     sr.indep.test(Z,g=g)
     sr.indep.test(Z,g=c("b"),regexp=TRUE)
     sr.indep.test(Z,g=1:3)

