FABinTestResults-class {FamAgg} | R Documentation

## Binomial test for familial aggregation

### Description

The `FABinTestResults` object contains the results from a simple binomial to test whether the number of affected in a trait are higher than expected by chance. For more details on the method please see `binomialTest`.

### Usage

    ## S4 method for signature 'FABinTestResults'
    result(object, method="BH")

    ## S4 replacement method for signature 'FABinTestResults'
    trait(object) <- value

### Arguments

(in alphabetic order)

`method` | The multiple hypothesis testing method. All methods supported by `p.adjust` are allowed.
`object` | The `FABinTestResults` object.
`value` | For `trait<-`: can be a named numeric, character or factor vector. The names (at least some of them) have to match the ids in the pedigree of the object.

### Details

A call to the setter methods `trait<-` resets any test results present in the `result` slot, thus, the object can be re-used to perform a simulation analysis using the new trait data.

### Value

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

### Objects from the Class

`FABinTestResults` objects are returned by the `binomialTest` function.

### Extends

Class `FAData` directly.

### Slots

result

  The results `data.frame`.

### Methods and Functions

result

  Returns the result from the test as a `data.frame` with columns:

  `"trait_name"`: the name of the trait.

  `"total_phenotyped"`: total number of phenotyped individuals in the trait.

  `"total_affected"`: total number of affected individuals in the trait.

  `"family"`: the family id. If a global test is used (i.e. if the pedigree consists of a single family, or `global = TRUE` was provided, the column shows `"full pedigree"`).

  `phenotyped`: the number of phenotyped individuals in the family.

  `affected`: the number of affected individuals in the family.

  `pvalue`: the p-value from the binomial test (conducted using the `binom.test` function).

  `prob`: the probability of being affected. Either a local probability calculated based on all affected and phenotyped individuals in the whole pedigree, or a global (population) probability that has to be provided with argument `prob`.

  `padj`: the p-value adjusted for multiple hypothesis testing using the method defined with argument `"method"`.

trait<-

  Set the trait information. This method will reset all simulation results saved in the `sim` slot.

### Note

Subsetting (using the `[` operator) is not supported.

### Author(s)

Johannes Rainer, Christian Weichenberger

### See Also

`FAData`, `kinship`, `trait`, `probabilityTest`, `kinshipGroupTest`, `kinshipSumTest`, `genealogicalIndexTest`, `familialIncidenceRateTest`, `fsirTest`, `plotPed`

### Examples

    ##########################
    ##
    ##  Perform the analysis
    ##
    ## Load the test data.
    data(minnbreast)

    ## Subset to some families and generate a pedigree data.frame.
    mbsub <- minnbreast[minnbreast$famid == 4 | minnbreast$famid == 5 |
                        minnbreast$famid == 6 | minnbreast$famid == 7 |
                        minnbreast$famid == 8, ]
    PedDf <- mbsub[, c("famid", "id", "fatherid", "motherid", "sex")]
    colnames(PedDf) <- c("family", "id", "father", "mother", "sex")

    ## Generate the FAData.
    fad <- FAData(pedigree=PedDf)

    ## Specify the trait.
    tcancer <- mbsub$cancer
    names(tcancer) <- mbsub$id

    ## Perform the test:
    bir <- binomialTest(fad, trait=tcancer, traitName="cancer")
    result(bir)

    ## Calculating the probability of being affected from the whole data set.
    prob <- sum(minnbreast$cancer, na.rm = TRUE) / sum(!is.na(minnbreast$cancer))
    bir <- binomialTest(fad, trait = tcancer, prob = prob)
    result(bir)

    ## Plot the pedigree of the family with the smallest p-value.
    plotPed(bir, family = "8")

[Package FamAgg version 1.12.0 Index]