Fdiff: Edgeworth expansion two-sample difference in means

FdiffR Documentation

Edgeworth expansion two-sample difference in means

Description

Calculate values of 1 - 4-term Edgeworth expansions (EE) (2nd - 5th order) for the two-sample standardized difference in means.

Usage

Fm1two(x, nx, ny, lamx, lamy, varx, vary)

Fm2two(x, nx, ny, lamx, lamy, varx, vary)

Fm3two(x, nx, ny, lamx, lamy, varx, vary)

Fm4two(x, nx, ny, lamx, lamy, varx, vary)

Arguments

x

numeric vector of quantiles of sampling distribution.

nx

number of observations in the first group.

ny

number of observations in the second group.

lamx

scaled cumulants of the distribution of the first group.

lamy

scaled cumulants of the distribution of the second group.

varx

variance of the first group.

vary

variance of the second group.

Details

Higher-order approximations of the cumulative distribution function of the two-sample standardized difference in means. Note that for a sample X_1, \dots, X_{n_x}, Y_1, \dots, Y_{n_y}, X would correspond to treatment and Y to control.

Value

A vector of the same length as x containing the values of Edgeworth expansion of a corresponding order (Fm1two for a 1-term or 2nd order EE, Fm2two for a 2-term EE, and so on).

See Also

Fmean for EE for one-sample standardized mean and pfuns for p() functions used in EE terms.

Examples

# X: n1 gamma distributed iid random variables, centered
# Y: n2 normally distributed iid random variables (standard normal) 
n1 <- 8
n2 <- 10
shp <- 3
ord <- 3:6                # orders of scaled cumulants
lamx <- factorial(ord - 1)/shp^((ord - 2)/2)
lamy <- rep(0, 4)
x <- seq(2, 5, by = 0.5)  # thicker tail 
1 - Fm1two(x, n1, n2, lamx, lamy, shp, 1)
  

innager/edgee documentation built on April 24, 2024, 8:14 p.m.