getAll {FamAgg} | R Documentation

## Define sets of control individuals for one or more given individuals

### Description

These functions allow to define sets of (eventually matched) control individuals for one or more given individuals using pedigree data. By default, controls from the same family than the specified individual(s) are returned. They are used e.g. in the `genealogicalIndexTest` method.

### Usage

    ## S4 method for signature 'data.frame'
    getAll(object, id=NULL, ...)

    ## S4 method for signature 'data.frame'
    getExternalMatched(object, id=NULL, match.using, ...)

    ## S4 method for signature 'data.frame'
    getGenerationMatched(object, id=NULL,
                                               include.anc=0, include.off=0, ...)

    ## S4 method for signature 'data.frame'
    getGenerationSexMatched(object, id=NULL,
                                                   include.anc=0, include.off=0, ...)

    ## S4 method for signature 'data.frame'
    getSexMatched(object, id=NULL, ...)

### Arguments

(in alphabetic order)

`id` | A character vector with ids of individuals for whom matched control individuals (from the same family) should be defined.
`include.anc` | For `getGenerationMatched` and `getGenerationSexMatched`: number of ancestor generations of individuals `id` in which control individuals should be defined, in addition to the actual generation of the individuals `id`. By default the functions define control individuals only in the actual generation of the individuals in `id`.
`include.off` | For `getGenerationMatched` and `getGenerationSexMatched`: number of offspring generations of individuals `id` in which control individuals should be defined, in addition to the actual generation of the individuals `id`. By default the functions define control individuals only in the actual generation of the individuals in `id`.
`match.using` | For `getExternalMatched`: a named vector for matching of controls. The names of the vector have to correspond to the ids of the individuals in the pedigree (but can have a different ordering).
`object` | Either a `data.frame`, `pedigree` or a `pedigreeList` object specifying the pedigree. If a `data.frame` is submitted, the columns `id`, `family`, `father`, `mother` and `sex` are required.
`...` | Additional arguments; not used at present.

### Value

Refer to the method and function description above for detailed information on the returned result object.

### Get matched controls

getAll

  Simply returns the ids of all individuals in the family (i.e. individuals with the same family id in the pedigree) of the specified ids in `id`. Returns a list with the ids (of type `character`) of the controls. The names of the list correspond to the family id.

getExternalMatched

  Returns the ids of matched individuals from the same family for the specified ids in `id`. The `match.using` vector is for the matching, i.e. the function first extracts the values for the individuals in `id` from `match.using` and returns the ids of all individuals whose value in `match.using` matches the value of the individuals specified by `id`. Individuals with a missing value in `match.using` are excluded. Returns a list with the ids (of type `character`) of the controls. The names of the list correspond to the family id.

getGenerationMatched

  Returns the ids of individuals matched by the generation of the individuals in `id`. The function returns the ids of all individuals from the same generation(s) than the individuals in `id`. The arguments `include.anc` and `include.off` can be used to increase the range of generation from which individuals are selected. Returns a list with the ids (of type `character`) of the controls. The names of the list correspond to the family id.

getGenerationSexMatched

  Same as `getGenerationMatched`, but matches in addition individuals by sex (see `getSexMatched`). Returns a list with the ids (of type `character`) of the controls. The names of the list correspond to the family id.

getSexMatched

  Returns ids of individuals from the same family matching the sex of the individuals in `id`. Individuals with sex being `NA` are excluded. The result is essentially identical to the `getAll` if `id` contains ids of male and female individuals. Returns a list with the ids (of type `character`) of the controls. The names of the list correspond to the family id.

### Author(s)

Johannes Rainer.

### See Also

`pedigree`, `FAData`, `FAProbResults`, `FAKinGroupResults`, `FAKinSumResults`, `FAGenIndexResults`, `genealogicalIndexTest`

### Examples

    ##########################
    ##
    ##  Defining a small pedigree
    ##
    ## load the Minnesota Breast Cancer record and subset to the
    ## first families.
    data(minnbreast)
    mbsub <- minnbreast[minnbreast$famid==4 | minnbreast$famid==5, ]
    mbped <- mbsub[, c("famid", "id", "fatherid", "motherid", "sex")]
    ## renaming column names
    colnames(mbped) <- c("family", "id", "father", "mother", "sex")

    ## Get ids of individuals from the same generation than "4"
    getGenerationMatched(mbped, id="4")

    ## Get the ids of gemale individuals from the same generation than
    ## "4" and "22"
    getGenerationSexMatched(mbped, id=c("4", "22"))

    ## Generate a FAData
    fad <- FAData(mbped)

    ## Plot the pedigree so we can evaluate the results of the function
    plotPed(fad, family="4")

    ## We're using getExternalMatched on the sex of the individuals
    ## in the pedigree, thus the results are identical to the
    ## getSexMatched function.
    ## Extracting the sex using $sex returns a named vector just
    ## as we need for getExternalMatched.
    head(fad$sex)
    getExternalMatched(fad, id="4", match.using=fad$sex)

    getSexMatched(fad, id="4")

[Package FamAgg version 1.12.0 Index]