getgraph                 package:SIN                 R Documentation

_O_b_t_a_i_n _g_r_a_p_h _f_r_o_m _s_i_m_u_l_t_a_n_e_o_u_s _p-_v_a_l_u_e_s

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

     This function converts a matrix of simultaneous p-values into a
     graph by comparing the p-values to a user-provided significance
     level.

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

     getgraph(pvals, alpha, type="UG", blocks=NULL)

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

   pvals: a matrix of simultaneous p-values.

   alpha: a significance level, i.e., alpha in (0,1).

    type: a string specifying the type of graph that should be obtained
          from the p-value matrix. If type equals '"UG"' then an
          undirected graph is returned, if type equals '"DAG"' then an
          acyclic directed graph is returned, and if type equals '"BG"'
          then a bidirected graph is returned.  If type equals the
          fourth possible choice '"CG"' then a chain graph is returned,
          in which case a list of integer vectors has to be provided as
          the input 'blocks'.

  blocks: a list of integer vectors specifying a family of subsets of
          the variables.

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

     The function returns an adjacency matrix A with A[i,j]=0 if there
     is no edge between vertices (variables) i and j. The convention
     for edges is that i-j if and only if A[i,j]=A[j,i]=1, i->j if and
     only if A[i,j]=1 and A[j,i]=0, and i<->j  if and only if
     A[i,j]=A[j,i]=2.

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

     data(fowlbones)
     pvals <- sinUG(fowlbones$corr,fowlbones$n)
     alpha <- 0.2
     ## get undirected graph
     getgraph(pvals, alpha, type="UG") 
     ## forget that we used sinUG and get acyclic directed graph
     getgraph(pvals, alpha, type="DAG")
     ## forget that we used sinUG and get bidirected graph
     getgraph(pvals, alpha, type="BG")
     ## forget that we used sinUG and get chain graph
     myblocks <- list(1:2,3:4,5:6)
     getgraph(pvals, alpha, type="CG", blocks=myblocks)

