Last data update: 2014.03.03

R: Method "JSONOutput"
JSONOutputR Documentation

Method "JSONOutput"

Description

Wrapper for the model fitting results. Returns model fitting and testing results in a JSON format. Assumes that modelling results are stored in the PhenTestResult object (output from function testDataset).

Usage

    JSONOutput(phenTestResult, phenotypeThreshold = 0.01)

Arguments

phenTestResult

instance of the PhenTestResult class that comes from the function testDataset; mandatory argument

phenotypeThreshold

a numerical value defining the threshold to use in classificationTag; default value 0.01

Value

Returns a vector with model fitting results in JSON format: model output summary and other values

Author(s)

Natalja Kurbatova

See Also

PhenTestResult

Examples

    # Mixed Model framework
    file <- system.file("extdata", "test1.csv", package="PhenStat")
    test <- PhenList(dataset=read.csv(file),
            testGenotype="Sparc/Sparc")
    result <- testDataset(test,
            depVariable="Lean.Mass")
    JSONOutput(result)
    
    # Fishe Exact Test framework
    file <- system.file("extdata", "test_categorical.csv", package="PhenStat")
    test2 <- PhenList(dataset=read.csv(file),
            testGenotype="Aff3/Aff3")
    result2 <- testDataset(test2,
            depVariable="Thoracic.Processes",
            method="FE")  
    JSONOutput(result2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PhenStat)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PhenStat/JSONOutput.Rd_%03d_medium.png", width=480, height=480)
> ### Name: JSONOutput
> ### Title: Method "JSONOutput"
> ### Aliases: JSONOutput
> 
> ### ** Examples
> 
>     # Mixed Model framework
>     file <- system.file("extdata", "test1.csv", package="PhenStat")
>     test <- PhenList(dataset=read.csv(file),
+             testGenotype="Sparc/Sparc")
Warning:
Dataset's column 'Assay.Date' has been renamed to 'Batch' and will be used for the batch effect modelling.

Information:
Dataset's 'Genotype' column has following values: '+/+', 'Sparc/Sparc'

Information:
Dataset's 'Sex' column has following value(s): 'Female', 'Male'

>     result <- testDataset(test,
+             depVariable="Lean.Mass")
Information:
Dependent variable: 'Lean.Mass'.

Information:
Perform all MM framework stages: startModel and finalModel.

Information:
Method: Mixed Model framework.

Information:
Equation: 'withWeight'.

Information:
Calculated values for model effects are: keepBatch=TRUE, keepEqualVariance=FALSE, keepWeight=TRUE, keepSex=TRUE, keepInteraction=FALSE.

>     JSONOutput(result)
[1] "{"statistical analysis": {"method":"Mixed Model framework","fittingMethod":"linear mixed-effects model","reference genotype":"+/+","test genotype":"Sparc/Sparc","variable":"Lean.Mass","transformation":{"lambda value":null, "scale shift":null, "transformed":"FALSE", "code":"0"},"formula":"Lean.Mass ~ Genotype + Sex + Weight","p-value from the test of genotype contribution":0.371508943144266,"genotype percentage change":{"Female":"-1.44%", "Male":"-1.44%"},"classification tag":"If phenotype is significant - both sexes equally"},"details": {"batch included":"TRUE","weight included":"TRUE","sex and genotype interaction included":"FALSE","residual variances homogeneity":"FALSE","effects": {"intercept":{"estimated coefficient":7.61113879541105,"standard error":0.588626541050488},"genotype":{"estimated coefficient":-0.29143571549456,"standard error":0.330479850268177,"p-value (represents the probability that effect is NOT relevant)":0.378369997588029},"sex":{"estimated coefficient":1.64073430331594,"standard error":0.180809296427475,"p-value (represents the probability that effect is NOT relevant)":4.79191190571254e-18},"weight":{"estimated coefficient":0.343050209791982,"standard error":0.0180812139273457,"p-value (represents the probability that effect is NOT relevant)":4.1478905048872e-58},"females in test genotype subset":{"estimated coefficient":null,"standard error":null,"p-value (represents the probability that effect is NOT relevant)":null},"males in test genotype subset":{"estimated coefficient":null,"standard error":null,"p-value (represents the probability that effect is NOT relevant)":null}},"model fitting quality": {"residuals normality test": {"reference genotype group":0.00299769923455649,"test genotype group":0.050506644848194},"blups test":0.221109370366003,"rotated residuals normality test":0.000580269690614958}},"dataset details":{"Female(+/+)":229,"Male(+/+)":223,"Female(Sparc/Sparc)":7,"Male(Sparc/Sparc)":9,"variability of Lean.Mass values":0.788}}"
>     
>     # Fishe Exact Test framework
>     file <- system.file("extdata", "test_categorical.csv", package="PhenStat")
>     test2 <- PhenList(dataset=read.csv(file),
+             testGenotype="Aff3/Aff3")
Warning:
Dataset's column 'Assay.Date' has been renamed to 'Batch' and will be used for the batch effect modelling.

Warning:
Dataset has been cleaned by filtering out records with genotype value other than test genotype 'Aff3/Aff3' or reference genotype '+/+'.

Warning:
Dataset's 'Weight' column is missed.
You can define 'dataset.colname.weight' argument to specify column for the weight effect modeling.

Information:
Dataset's 'Genotype' column has following values: '+/+', 'Aff3/Aff3'

Information:
Dataset's 'Sex' column has following value(s): 'Female', 'Male'

Warning:
Weight column is not present in the database.

>     result2 <- testDataset(test2,
+             depVariable="Thoracic.Processes",
+             method="FE")  
Information:
Dependent variable: 'Thoracic.Processes'.

Information:
Method: Fisher Exact Test framework with filtered dataset.

>     JSONOutput(result2)
[1] "{"statistical analysis": {"method":"Fisher Exact Test framework","reference genotype":"+/+","test genotype":"Aff3/Aff3","variable":"Thoracic.Processes","combined dataset":{"p_value":0,"effect size":"76%"},"females only dataset":{"p_value":0,"effect size":"81%"},"males only dataset":{"p_value":3e-04,"effect size":"70%"},"classification tag":"With phenotype threshold value 0.01 - significant in males, females and in combined dataset"}}"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>