Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab04015
commit 2f39698
Showing
14 changed files
with
267 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
Package: st | ||
Version: 1.0.3 | ||
Date: 2008-10-27 | ||
Title: Shrinkage t Statistic | ||
Author: Rainer Opgen-Rhein and Korbinian Strimmer. | ||
Version: 1.1.0 | ||
Date: 2008-12-13 | ||
Title: Shrinkage t Statistic and Correlation-Adjusted t Score | ||
Author: Rainer Opgen-Rhein, Verena Zuber, and Korbinian Strimmer. | ||
Maintainer: Korbinian Strimmer <strimmer@uni-leipzig.de> | ||
Depends: R (>= 2.7.0), corpcor (>= 1.4.7), fdrtool (>= 1.2.5) | ||
Depends: R (>= 2.7.0), sda (>= 1.0.3), fdrtool (>= 1.2.5) | ||
Suggests: limma, samr | ||
Description: This package implements the "shrinkage t" statistic | ||
described in Opgen-Rhein and Strimmer (2007). It also offers | ||
a convenient interface to a number of other regularized t-type | ||
statistics often used in high-dimensional case-control studies. | ||
introduced in Opgen-Rhein and Strimmer (2007) and a shrinkage estimate | ||
of the "correlation-adjusted t-score" (cat score) described in | ||
Zuber and Strimmer (2008). It also offers a convenient interface | ||
to a number of other regularized t-statistics commonly | ||
employed in high-dimensional case-control studies. | ||
License: GPL (>= 3) | ||
URL: http://strimmerlab.org/software/st/ | ||
Packaged: Mon Oct 27 00:07:25 2008; strimmer | ||
Packaged: Sat Dec 13 16:36:07 2008; strimmer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
### shrinkcat.R (2008-12-01) | ||
### | ||
### Shrinkage Estimation of Correlation-Adjusted t Statistic | ||
### | ||
### Copyright 2008 Verena Zuber and Korbinian Strimmer | ||
### | ||
### | ||
### This file is part of the `st' library for R and related languages. | ||
### It is made available under the terms of the GNU General Public | ||
### License, version 3, or at your option, any later version, | ||
### incorporated herein by reference. | ||
### | ||
### This program is distributed in the hope that it will be | ||
### useful, but WITHOUT ANY WARRANTY; without even the implied | ||
### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
### PURPOSE. See the GNU General Public License for more | ||
### details. | ||
### | ||
### You should have received a copy of the GNU General Public | ||
### License along with this program; if not, write to the Free | ||
### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, | ||
### MA 02111-1307, USA | ||
|
||
|
||
shrinkcat.stat = function (X, L, verbose=TRUE) | ||
{ | ||
FUN = shrinkcat.fun(L=L, verbose=verbose) | ||
score = FUN(X) | ||
|
||
return( score ) | ||
} | ||
|
||
|
||
shrinkcat.fun = function (L, verbose=TRUE) | ||
{ | ||
if (missing(L)) stop("Class labels are missing!") | ||
|
||
function(X) | ||
{ | ||
p = ncol(X) | ||
n = nrow(X) | ||
|
||
tmp = centroids(X, L, var.pooled=TRUE, var.groups=FALSE, | ||
powcor.pooled=TRUE, alpha=-1/2, shrink=TRUE, verbose=verbose) | ||
n1 = tmp$samples[1] | ||
n2 = tmp$samples[2] | ||
|
||
# differences between the two groups | ||
diff = tmp$means[,1]-tmp$means[,2] | ||
|
||
# standard error of diff | ||
n1 = tmp$samples[1] | ||
n2 = tmp$samples[2] | ||
v = tmp$var.pooled | ||
sd = sqrt( (1/n1 + 1/n2)*v ) | ||
|
||
|
||
# t statistic | ||
t = diff/sd | ||
|
||
# correlation-adjusted statistic | ||
if (is.null(dim(tmp$powcor.pooled))) # if there is no correlation | ||
cat = t | ||
else | ||
cat = crossprod(tmp$powcor.pooled, t) # decorrelate t | ||
|
||
cat = as.vector(cat) | ||
attr(cat, "lambda.var") = attr(tmp$var.pooled, "lambda.var") | ||
attr(cat, "lambda") = attr(tmp$powcor.pooled, "lambda") | ||
|
||
return(cat) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.