finalTFModel {PhenStat} | R Documentation

## Method "finalTFModel"

### Description

This is an internal function run within TF framework. It completes the final stage of the TF framework, which builds the final model and estimates effects. As an internal function, it doesn't include extensive error testing of inputs. Please use cautiously if calling directly.

Works with `PhenTestResult` object created by `startTFModel` function. The creation of TF final model is based on the significance of different fixed effects, depVariable and equation values stored in `PhenTestResult` object.

### Usage

        finalTFModel(phenTestResult,
    				outputMessages = TRUE)

### Arguments

`phenTestResult` | instance of the `PhenTestResult` class that comes from the function `testDataset`; mandatory argument
`outputMessages` | flag: "FALSE" value to suppress output messages; "TRUE" value to show output messages; default value TRUE

### Value

Returns results stored in instance of the `PhenTestResult` class

### Author(s)

Natalja Kurbatova, Natasha Karp, Jeremy Mason

### References

Karp N, Melvin D, Sanger Mouse Genetics Project, Mott R (2012): Robust and Sensitive Analysis of Mouse Knockout Phenotypes. PLoS ONE 7(12): e52410. doi:10.1371/journal.pone.0052410

West B, Welch K, Galecki A (2007): Linear Mixed Models: A practical guide using statistical software New York: Chapman & Hall/CRC 353 p.

### See Also

`PhenTestResult` and `testDataset`

### Examples

        file <- system.file("extdata", "test7_TFE.csv", package="PhenStat")
        test <- PhenList(dataset=read.csv(file,na.strings = '-'),
                         testGenotype="het",
                         refGenotype = "WT",
                         dataset.colname.sex="sex",
                         dataset.colname.genotype="Genotype",
                         dataset.values.female="f",
                         dataset.values.male= "m",
                         dataset.colname.weight="body.weight",
                         dataset.colname.batch="Date_of_procedure_start")

        test_TF <- PhenStat:::TFDataset(test,depVariable="Cholesterol")

        # when "testDataset" function's argument "callAll" is set to FALSE
        # only "startTFModel" function is called - the first step of TFE framework
        result  <- PhenStat:::testDataset(test_TF,
                               depVariable="Cholesterol",
                               callAll=FALSE,
                               method="TF")
        # print out formula that has been created
        PhenStat:::analysisResults(result)$model.formula.genotype
        # print out batch effect's significance
        PhenStat:::analysisResults(result)$model.effect.batch
        result <- PhenStat:::finalTFModel(result)

[Package PhenStat version 2.18.0 Index]