Error Check for a Family Classification

DESCRIPTION:

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

USAGE:

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

REQUIRED ARGUMENTS:

famid
a vector of family identifiers
id
a vector of unique subject identifiers
father.id
a vector containing the id of the biological father
mother.id
a vector containing the id of the biological mother

OPTIONAL ARGUMENTS:

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

VALUE:

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 = everything 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.

DETAILS:

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.

SEE ALSO:

, .

EXAMPLES:

#
# 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

# 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)

# 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')