FABinTestResults.RdThe 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.
# S4 method for FABinTestResults result(object, method="BH") # S4 method for FABinTestResults trait(object) <- value
| method | The multiple hypothesis testing method. All methods supported by
|
|---|---|
| object | The |
| value | For |
FABinTestResults objects are returned by the
binomialTest function.
Class FAData directly.
The results data.frame.
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".
Set the trait information. This method will reset all simulation
results saved in the sim slot.
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.
Subsetting (using the [ operator) is not supported.
Refer to the method and function description above for detailed information on the returned result object.
FAData,
kinship,
trait,
probabilityTest,
kinshipGroupTest,
kinshipSumTest,
genealogicalIndexTest,
familialIncidenceRateTest,
fsirTest,
plotPed
########################## ## ## 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)#> trait_name total_phenotyped total_affected family phenotyped affected #> 8 cancer 142 12 8 37 6 #> 4 cancer 142 12 4 36 3 #> 7 cancer 142 12 7 12 1 #> 5 cancer 142 12 5 24 1 #> 6 cancer 142 12 6 33 1 #> pvalue prob padj #> 8 0.08808022 0.08450704 0.4404011 #> 4 0.59639694 0.08450704 0.9457231 #> 7 0.65337483 0.08450704 0.9457231 #> 5 0.87985099 0.08450704 0.9457231 #> 6 0.94572307 0.08450704 0.9457231## 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)#> trait_name total_phenotyped total_affected family phenotyped affected #> 8 NA 142 12 8 37 6 #> 4 NA 142 12 4 36 3 #> 7 NA 142 12 7 12 1 #> 5 NA 142 12 5 24 1 #> 6 NA 142 12 6 33 1 #> pvalue prob padj #> 8 0.03503093 0.06701734 0.1751546 #> 4 0.43728809 0.06701734 0.8986490 #> 7 0.56500639 0.06701734 0.8986490 #> 5 0.81078056 0.06701734 0.8986490 #> 6 0.89864903 0.06701734 0.8986490#> Did not plot the following people: 160 164 167 168 169 170 171 172 173 174