familycheck             package:kinship             R Documentation

_E_r_r_o_r _c_h_e_c_k _f_o_r _a _f_a_m_i_l_y _c_l_a_s_s_i_f_i_c_a_t_i_o_n

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

     Given a family id vector, also compute the familial grouping from
     first principles using the parenting data, and compare the
     results.

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

     familycheck(famid, id, father.id, mother.id, newfam)

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

   famid: a vector of family identifiers 

      id: a vector of unique subject identifiers 

father.id : vector containing the id of the biological father 

mother.id : vector containing the id of the biological mother 

  newfam: the result of a call to 'makefamid'. If this has allready
          been computed by the user, adding it as an argument shortens
          the running time somewhat. 

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

     The 'makefamid' function is used to create a de novo family id
     from the parentage data, and this is compared to the family id
     given in the data.

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

     a data frame with one row for each unique family id in the 'famid'
     argument. Components of the output are

   famid: the family id, as entered into the data set 

       n: number of subjects in the family 

unrelated: number of them that appear to be unrelated to anyone else 
          in the entire pedigree set.   This is usually marry-ins with
          no  children (in the pedigree), and if so are not a problem. 

   split: number of unique "new" family ids. If this is 0, it means
          that no one in this "family" is related to anyone else (not
          good);  1 = everythings is fine; 2+= the family appears to be
          a set of disjoint trees.  Are you missing some of the people? 

    join: number of other families that had a unique famid, but are
          actually joined to this one.  0 is the hope. If there are any
          joins, then an attribute "join" is attached.  It will be a
          matrix with famid as row labels, new-family-id as the
          columns, and the number of subjects as entries.   

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

     'makefamid, makekinship'

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

     ## Not run: 
     #
     # This is from a pedigree that had some identifier errors
     #
     > checkit<- familycheck(ids2$famid, ids2$gid, ids2$fatherid, ids2$motherid)
     > table(checkit$split)    # should be all 1's
        0   1 2 
      112 424 4
     # Shows 112 of the "families" were actually isolated individuals,
     #  and that 4 of the families actually split into 2.  
     #  In one case, a mistyped father id caused one child, along with his spouse
     #  and children, to be "set adrift" from the connected pedigree.

     > table(checkit$join)
        0 1 2 
      531 6 3
     #
     # There are 6 families with 1 other joined to them (3 pairs), and 3 with
     #  2 others added to them (one triplet).
     # For instance, a single mistyped father id of someone in family 319,
     #  which was by bad luck the id of someone else in family 339,
     #  was sufficient to join two groups.
     > attr(checkit, 'join')
         [,1] [,2] [,3] [,4] [,5] [,6] [,7] 
      31   78    0    0    0    0    0    0
      32    3   15    0    0    0    0    0
      33    6    0   12    0    0    0    0
      63    0    0    0   63    0    0    0
      65    0    0    0   17   16    0    0
     122    0    0    0    0    0   16    0
     127    0    0    0    0    0   30    0
     319    0    0    0    0    0    0   20
     339    0    0    0    0    0    0   37
     ## End(Not run)

