R: GlobalAncova with sequential and type III sum of squares...
GlobalAncova.decomp
R Documentation
GlobalAncova with sequential and type III sum of squares decomposition and adjustment for global covariates
Description
Computation of a F-test for the association between expression values
and clinical entities.
The test is carried out by comparison of corresponding linear models
via the extra sum of squares principle.
In models with various influencing factors extra sums of squares can be treated with sequential and type III
decomposition. Adjustment for global covariates, e.g. gene expression values in normal tissue as compared
to tumour tissue, can be applied.
Given theoretical p-values may not be appropriate due to correlations and non-normality. The functions
are hence seen more as a descriptive tool.
Matrix of gene expression data, where columns correspond to samples
and rows to genes. The data should be properly normalized beforehand
(and log- or otherwise transformed). Missing values are not allowed.
Gene and sample names can be included as the row and column
names of xx.
formula
Model formula for the linear model.
model.dat
Data frame that contains all the variable information for each sample.
method
Whether sequential or type III decomposition or both should be calculated.
test.genes
Vector of gene names or a list where each element is a vector of gene names.
genewise
Shall the sequential decomposition be displayed for each single gene in a (small) gene set?
zz
Global covariate, i.e. matrix of same dimensions as xx.
zz.per.gene
If set to TRUE the adjustment for the global covariate is applied on a gene-wise basis.
Value
Depending on parameters test.genes, method and genewise ANOVA tables, or lists of ANOVA tables for each
decomposition and/or gene set, or lists with components of ANOVA tables for each gene are returned.
Note
This work was supported by the NGFN project 01 GR 0459, BMBF, Germany.
data(vantVeer)
data(phenodata)
data(pathways)
# sequential or type III decomposition
GlobalAncova.decomp(xx = vantVeer, formula = ~ grade + metastases + ERstatus, model.dat = phenodata, method = "sequential", test.genes = pathways[1:3])
GlobalAncova.decomp(xx = vantVeer, formula = ~ grade + metastases + ERstatus, model.dat = phenodata, method = "type3", test.genes = pathways[1:3])
# adjustment for global covariate
data(colon.tumour)
data(colon.normal)
data(colon.pheno)
GlobalAncova.decomp(xx = colon.tumour, formula = ~ UICC.stage + sex + location, model.dat = colon.pheno, method = "all", zz = colon.normal)
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(GlobalAncova)
Loading required package: corpcor
Loading required package: globaltest
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/GlobalAncova/GlobalAncova.decomp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GlobalAncova.decomp
> ### Title: GlobalAncova with sequential and type III sum of squares
> ### decomposition and adjustment for global covariates
> ### Aliases: GlobalAncova.decomp
> ### Keywords: models
>
> ### ** Examples
>
> data(vantVeer)
> data(phenodata)
> data(pathways)
>
> # sequential or type III decomposition
> GlobalAncova.decomp(xx = vantVeer, formula = ~ grade + metastases + ERstatus, model.dat = phenodata, method = "sequential", test.genes = pathways[1:3])
$androgen_receptor_signaling
SSQ df MS F p
Intercept 42.463648 72 0.58977289 17.037286 7.721335e-190
grade 18.201029 144 0.12639604 3.651313 1.390422e-42
metastases 2.645268 72 0.03673984 1.061336 3.397694e-01
ERstatus 29.125115 72 0.40451549 11.685593 1.671092e-122
error 226.807952 6552 0.03461660 NA NA
$apoptosis
SSQ df MS F p
Intercept 73.630998 187 0.39374865 11.912387 3.087910e-321
grade 28.756345 374 0.07688862 2.326172 5.282043e-40
metastases 7.186794 187 0.03843206 1.162715 6.428585e-02
ERstatus 45.666917 187 0.24420811 7.388220 1.799784e-172
error 562.475084 17017 0.03305372 NA NA
$cell_cycle_control
SSQ df MS F p
Intercept 11.764576 31 0.37950246 9.212123 1.322430e-40
grade 15.890992 62 0.25630633 6.221634 1.478817e-44
metastases 2.028524 31 0.06543627 1.588414 2.073819e-02
ERstatus 10.863558 31 0.35043735 8.506590 9.911064e-37
error 116.213873 2821 0.04119598 NA NA
Warning messages:
1: In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
2: In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
3: In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
> GlobalAncova.decomp(xx = vantVeer, formula = ~ grade + metastases + ERstatus, model.dat = phenodata, method = "type3", test.genes = pathways[1:3])
$androgen_receptor_signaling
SSQ df MS F p
Intercept 31.070643 72 0.43153671 12.4661789 2.060236e-132
grade 9.448638 144 0.06561554 1.8954937 9.546578e-10
metastases 1.568993 72 0.02179157 0.6295123 9.939806e-01
ERstatus 29.125115 72 0.40451549 11.6855933 1.671092e-122
error 226.807952 6552 0.03461660 NA NA
$apoptosis
SSQ df MS F p
Intercept 33.073033 187 0.17686114 5.350719 3.067227e-107
grade 16.433991 374 0.04394115 1.329386 2.488033e-05
metastases 6.267846 187 0.03351789 1.014043 4.331773e-01
ERstatus 45.666917 187 0.24420811 7.388220 1.799784e-172
error 562.475084 17017 0.03305372 NA NA
$cell_cycle_control
SSQ df MS F p
Intercept 4.173999 31 0.13464512 3.268404 3.399027e-09
grade 8.024304 62 0.12942426 3.141672 5.765491e-15
metastases 1.397575 31 0.04508307 1.094356 3.295908e-01
ERstatus 10.863558 31 0.35043735 8.506590 9.911064e-37
error 116.213873 2821 0.04119598 NA NA
Warning messages:
1: In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
2: In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
3: In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
>
> # adjustment for global covariate
> data(colon.tumour)
> data(colon.normal)
> data(colon.pheno)
> GlobalAncova.decomp(xx = colon.tumour, formula = ~ UICC.stage + sex + location, model.dat = colon.pheno, method = "all", zz = colon.normal)
$adjustment
ssq df
adjustment 2017200 1
$sequential
SSQ df MS F p
Intercept 4779.2569 1747 2.7356937 10.6058621 0.00000000
UICC.stage 374.1633 1747 0.2141747 0.8303224 0.99999978
sex 431.1914 1747 0.2468182 0.9568760 0.88723374
location 484.2787 1747 0.2772059 1.0746844 0.02092398
error 3604.7348 13975 0.2579417 NA NA
$typeIII
SSQ df MS F p
Intercept 2026.3657 1747 1.1599117 4.4967985 0.00000000
UICC.stage 461.6535 1747 0.2642550 1.0244760 0.24661362
sex 431.2039 1747 0.2468253 0.9569038 0.88708056
location 484.2787 1747 0.2772059 1.0746844 0.02092398
error 3604.7348 13975 0.2579417 NA NA
Warning message:
In anova.lm(lm(dummy.formula, model.dat)) :
ANOVA F-tests on an essentially perfect fit are unreliable
>
>
>
>
>
> dev.off()
null device
1
>