qgen: 'q()' functions for Edgeworth expansion terms - general...

Description Usage Arguments Details Value See Also Examples

Description

Calculate values of q(x) used in terms of Edgeworth expansions (EE) for a general version of t-statistic and other test statistics.

Usage

1
2
3
4
5
6
7
q1k(x, k12, k31, r)

q2k(x, k12, k22, k31, k41, r)

q3k(x, k12, k13, k22, k31, k32, k41, k51, r)

q4k(x, k12, k13, k22, k23, k31, k32, k41, k42, k51, k61, r)

Arguments

x

numeric vector of quantiles of sampling distribution.

k12, k13, k22, k23, k31, k32, k41, k42, k51, k61

cumulant components - values calculated from sample statistics or distribution parameters.

r

sqare root of variance adjustment. The variance adjustment is generally equal to k21.

Details

These functions implement a general version of EE, which can be used for any one- or two-sample t-statistic, as well as for other test statistics. q1k() is used for term 1 (1-term expansion is also referred to as a 2nd order expansion), q2k() for term 2, and so on. Variance adjustment is incorporated in these functions.

Value

A vector of the same length as x.

See Also

Ftgen for corresponding EE values and qfuns for the short version used in EE for ordinary one-sample t-statistic. For automated generalized verions of these functions see makeQx and makeFx.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# two-sample test
n1 <- 8
n2 <- 10
shp <- 3
smp <- c(rgamma(n1, shape = shp), rnorm(n2))
a <- rep(1:0, c(n1, n2))
stats <- smpStats(smp, a)
for (i in 1:length(stats)) {
  assign(names(stats)[i], stats[i])
}
k12 <- K12two(A, B_x, B_y, b_x, b_y, mu_x2, mu_x3, mu_x4, mu_x5, mu_x6, 
              mu_y2, mu_y3, mu_y4, mu_y5, mu_y6)
k31 <- K31two(A, B_x, B_y, b_x, b_y, mu_x2, mu_x3, mu_x4, mu_x5, mu_x6, 
              mu_y2, mu_y3, mu_y4, mu_y5, mu_y6)
r <- sqrt(K21two(A, B_x, B_y, b_x, b_y, mu_x2, mu_x3, mu_x4, mu_x5, mu_x6, 
                 mu_y2, mu_y3, mu_y4, mu_y5, mu_y6))
x <- seq(-5, -2, by = 0.5) 
q1k(x, k12, k31, r)

innager/edgee documentation built on May 22, 2019, 12:42 p.m.