Description Usage Arguments Author(s) Examples
Calculates test statistics and P values from obs.fit, which is returned from edge.fit.
1 |
obs.fit |
Object returned from edge.fit |
df1 |
Degrees of freedom of full model |
df0 |
Degrees of freedom of reduced model |
norm.pval |
Flage determining whether or not P value should be normalized. |
John D. Storey <jstorey@princeton.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (obs.fit, df1, df0, norm.pval = FALSE)
{
err.func = "edge.glr"
res1 = obs.fit$res1
res0 = obs.fit$res0
n = ncol(res1)
rss1 = apply(res1, 1, function(x) {
sum(x^2)
})
rss0 = apply(res0, 1, function(x) {
sum(x^2)
})
stat = ((rss0 - rss1)/(df1 - df0))/(rss1/(n - df1))
if (norm.pval) {
pval = 1 - pf(stat, df1 = (df1 - df0), df2 = (n - df1))
return(list(stat = stat, pval = pval))
}
else {
return(list(stat = stat, pval = NULL))
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.