Get the t-statistics from a lmFit object.

getT(lmFitObj, coiIndex = 2L)

Arguments

lmFitObj

A lmFit object.

coiIndex

An integer specifying the coefficent of interest in the model for which to get the t-statistics for.

Value

A two column matrix with the t-statistics and the p-values of the coefficient of interest.

Author

Andrew E Jaffe

Examples


## From lmFit() example page
sd <- 0.3 * sqrt(4 / rchisq(100, df = 4))
y <- matrix(rnorm(100 * 6, sd = sd), 100, 6)
rownames(y) <- paste("Gene", seq_len(100))
y[seq_len(2), seq_len(3) + 3] <- y[seq_len(2), seq_len(3) + 3] + 2
design <- cbind(Grp1 = 1, Grp2vs1 = c(0, 0, 0, 1, 1, 1))

# Ordinary fit
library("limma")
fit <- lmFit(y, design)
## Get Ts
getT(fit)
#>            Tstatistic       pvalue
#> Gene 1    3.262265131 3.101447e-02
#> Gene 2   33.059889115 4.992307e-06
#> Gene 3    0.283413515 7.909234e-01
#> Gene 4    1.777077105 1.501951e-01
#> Gene 5    1.373944846 2.414227e-01
#> Gene 6   -0.060574643 9.546037e-01
#> Gene 7    1.927680961 1.261515e-01
#> Gene 8   -0.667407327 5.410430e-01
#> Gene 9    0.682769363 5.322455e-01
#> Gene 10  -0.748562483 4.957358e-01
#> Gene 11  -0.045440496 9.659343e-01
#> Gene 12   3.565587786 2.346825e-02
#> Gene 13   0.163119344 8.783340e-01
#> Gene 14  -1.274426896 2.715157e-01
#> Gene 15   3.173937160 3.373036e-02
#> Gene 16   0.982504386 3.814781e-01
#> Gene 17  -0.436093942 6.852726e-01
#> Gene 18   1.397029032 2.349243e-01
#> Gene 19   1.307573493 2.611082e-01
#> Gene 20  -0.195433030 8.545800e-01
#> Gene 21   0.333634624 7.554121e-01
#> Gene 22  -0.844472296 4.459537e-01
#> Gene 23   1.568632461 1.918114e-01
#> Gene 24   2.183278159 9.439806e-02
#> Gene 25   0.202241597 8.495976e-01
#> Gene 26  -0.905527340 4.163979e-01
#> Gene 27   0.552914456 6.097666e-01
#> Gene 28   0.929367412 4.053056e-01
#> Gene 29   0.207140707 8.460177e-01
#> Gene 30   1.906104654 1.293253e-01
#> Gene 31   1.064059471 3.472715e-01
#> Gene 32  -0.436784278 6.848117e-01
#> Gene 33   1.535265116 1.995144e-01
#> Gene 34   0.214663918 8.405292e-01
#> Gene 35   0.268658850 8.014794e-01
#> Gene 36  -0.898528108 4.197022e-01
#> Gene 37   1.949094340 1.230851e-01
#> Gene 38  -0.198787325 8.521243e-01
#> Gene 39   0.203892866 8.483905e-01
#> Gene 40  -0.310990404 7.713405e-01
#> Gene 41  -0.351423443 7.430009e-01
#> Gene 42   4.061107230 1.533472e-02
#> Gene 43  -0.425486209 6.923757e-01
#> Gene 44  -0.672716523 5.379910e-01
#> Gene 45  -1.625347902 1.794143e-01
#> Gene 46  -0.885078415 4.261125e-01
#> Gene 47  -3.944255615 1.689928e-02
#> Gene 48  -1.193754009 2.985307e-01
#> Gene 49  -0.640328198 5.567986e-01
#> Gene 50  -1.160080580 3.105401e-01
#> Gene 51   0.841267678 4.475508e-01
#> Gene 52   0.953192270 3.944698e-01
#> Gene 53  -0.219755851 8.368206e-01
#> Gene 54   0.824670244 4.558959e-01
#> Gene 55  -0.936241491 4.021536e-01
#> Gene 56   0.909672645 4.144512e-01
#> Gene 57   2.251529464 8.749685e-02
#> Gene 58   3.399548327 2.728868e-02
#> Gene 59   1.590579903 1.869122e-01
#> Gene 60  -0.729307428 5.062234e-01
#> Gene 61  -0.402960500 7.075857e-01
#> Gene 62  -0.291972241 7.848248e-01
#> Gene 63   0.027384991 9.794645e-01
#> Gene 64   0.861045674 4.377669e-01
#> Gene 65   0.015218467 9.885867e-01
#> Gene 66   1.522867419 2.024566e-01
#> Gene 67  -0.744900071 4.977180e-01
#> Gene 68   0.250381639 8.146267e-01
#> Gene 69   0.305647650 7.751190e-01
#> Gene 70   1.215044821 2.911634e-01
#> Gene 71   0.977069033 3.838590e-01
#> Gene 72   0.083288095 9.376240e-01
#> Gene 73   0.303039181 7.769666e-01
#> Gene 74  -0.004249881 9.968126e-01
#> Gene 75  -0.364131469 7.341917e-01
#> Gene 76   0.896476038 4.206751e-01
#> Gene 77  -0.868736775 4.340093e-01
#> Gene 78   1.274606156 2.714583e-01
#> Gene 79   0.252066970 8.134112e-01
#> Gene 80  -0.106113455 9.206011e-01
#> Gene 81   0.642467757 5.555423e-01
#> Gene 82  -2.236468784 8.896977e-02
#> Gene 83   0.287295642 7.881549e-01
#> Gene 84   0.153383931 8.855224e-01
#> Gene 85   1.329446037 2.544535e-01
#> Gene 86   1.749419085 1.551214e-01
#> Gene 87  -0.481545904 6.552881e-01
#> Gene 88  -1.319196574 2.575511e-01
#> Gene 89  -2.457499817 6.987905e-02
#> Gene 90   1.379846121 2.397447e-01
#> Gene 91  -5.003565353 7.471569e-03
#> Gene 92   1.944168103 1.237833e-01
#> Gene 93  -0.260985514 8.069897e-01
#> Gene 94   0.451489459 6.750334e-01
#> Gene 95   0.286172433 7.889555e-01
#> Gene 96  -0.053609054 9.598173e-01
#> Gene 97  -0.964284943 3.895094e-01
#> Gene 98   0.512182644 6.355062e-01
#> Gene 99  -1.005715835 3.714540e-01
#> Gene 100  0.001139672 9.991452e-01