kfuns1 | R Documentation |
k()
functions for Edgeworth expansions - one-sampleCalculate k
's (cumulant components) for a general version of Edgeworth
expansions (EE) for one-sample t-statistic.
K12one(A, B, mu2, mu3, mu4, mu5, mu6)
K13one(A, B, mu2, mu3, mu4, mu5, mu6)
K21one(A, B, mu2, mu3, mu4, mu5, mu6)
K22one(A, B, mu2, mu3, mu4, mu5, mu6)
K23one(A, B, mu2, mu3, mu4, mu5, mu6)
K31one(A, B, mu2, mu3, mu4, mu5, mu6)
K32one(A, B, mu2, mu3, mu4, mu5, mu6)
K41one(A, B, mu2, mu3, mu4, mu5, mu6)
K42one(A, B, mu2, mu3, mu4, mu5, mu6)
K51one(A, B, mu2, mu3, mu4, mu5, mu6)
K61one(A, B, mu2, mu3, mu4, mu5, mu6)
A |
value of |
B |
value of |
mu2 , mu3 , mu4 , mu5 , mu6 |
central moments (2 - 6) or their estimates. |
Variance adjustment r^2
is equal to the output of K21one()
,
unless different variance estimates are used for A
, numerator of
k
, and r
.
A calculated value for the respective component.
Other k()
functions:
kfuns2
# moderated t-statistic
if (requireNamespace("limma")) {
# simulate high-dimensional data
n <- 10
m <- 1e4 # number of tests
ns <- 0.05*m # number of significant features
dat <- matrix(rgamma(m*n, shape = 3) - 3, nrow = m)
shifts <- runif(ns, 1, 5)
dat[1:ns, ] <- dat[1:ns, ] - shifts
# estimate prior information
fit <- limma::lmFit(dat, rep(1, n))
fbay <- limma::eBayes(fit)
# look at one feature (row of data)
i <- 625
stats <- smpStats(dat[i, ], moder = TRUE, d0 = fbay$df.prior,
s20 = fbay$s2.prior, varpost = fbay$s2.post[i])
vars <- names(stats) # if want to remove carryover names
names(stats) <- NULL
for (j in 1:length(stats)) {
assign(vars[j], stats[j])
}
K32one(A, B, mu2, mu3, mu4, mu5, mu6)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.