ic.test: Function for testing inequality-related hypotheses for...

ic.testR Documentation

Function for testing inequality-related hypotheses for multivariate normal random variables

Description

ic.test tests linear inequality hypotheses for multivariate normal means by likelihood ratio tests. print and summary functions display results in different degrees of detail.

Usage

ic.test(obj, TP = 1, s2 = 1, df.error = Inf, 
             ui0.11 = diag(rep(1, length(obj$b.restr))), 
             ci0.11 = NULL, meq.alt = 0,
             df = NULL, wt = NULL, tol=sqrt(.Machine$double.eps), ...)
## S3 method for class 'ict'
print(x, digits = max(3, getOption("digits") - 3), scientific = FALSE, ...)
## S3 method for class 'ict'
summary(object, brief = TRUE, digits = max(3, getOption("digits") - 3), 
             scientific = FALSE, tol=sqrt(.Machine$double.eps), ...)

Arguments

obj

Object of class orest that contains unrestricted and restricted estimate, covariance structure, and restriction;

for objects of class orlm (that inherit from class orest) information on s2 and df.error is taken from obj (i.e. specifications of s2 and df.error in the call to ic.test are ignored)

TP

type of test problem, cf. details

s2

multiplier that modifies the matrix obj$Sigma into the (estimated) covariance matrix of the unrestricted estimate; obj$Sigma may be a covariance matrix (s2=1, default), a correlation matrix or an otherwise rescaled covariance matrix (e.g. cov.unscaled from a linear model)

df.error

error degrees of freedom connected with estimation of s2 (e.g. residual df from linear model); if df.error < Inf, the test is based on a mixture of beta-distributions with parameters df/2 and df.error/2, otherwise the test is based on a mixture of chi-square distributions with degrees of freedom in df.

ui0.11

matrix (or vector in case of one restriction only) for defining (additional) equality restrictions for TP 11 (in addition to restrictions in obj);

note that there must be as many columns as there are elements of vector b.restr (no extra index vector taken);

if there is overlap between restrictions in ui0.11 and restrictions already present in obj, restrictions already present in obj are projected out for ui0.11: for example, the default choice for ui0.11 means that all elements of the expectation are 0; some of these restrictions may already be present in obj and are projected out of ui0.11 by ic.test

ci0.11

right-hand-side vector for equality restrictions defined by ui0.11; so far, these should be 0!

meq.alt

number of equality restrictions (from beginning) that are maintained under the alternative hypothesis (for TP21)

df

optional vector of degrees of freedom for mixed chibar- or beta- distributions; if omitted, degrees of freedom and weights are calculated; if given, must be accompanied by corresponding wt

wt

optional vector of weights for mixed chibar- or beta- distributions; if omitted, weights are calculated using function ic.weights; if given, must be accompanied by corresponding df (can be obtained from call to ic.weights or from previous runs of ic.test

x

output object from ict.test (of class ict)

tol

numerical tolerance value; estimates closer to 0 than tol are set to exactly 0

...

Further options, e.g. algorithm for ic.weights

digits

number of digits to display

scientific

if FALSE, suppresses scientific format; default: FALSE

object

output object from ict.test (of class ict)

brief

if TRUE, requests brief output without restrictions (default), otherwise restrictions are shown with indication, which are active

Details

The following test problems are implemented:

TP=1: H0: restrictions valid with equality vs. H1: at least one inequality

TP=2: H0: all restrictions true vs. H1: at least one restriction false

TP=3: H0: restrictions false vs. H1: restrictions true (with inequality)

TP=11: H0: restriction valid with equality and further linear equalities vs. H1: at least one equality from H0 violated, restriction valid

TP=21: H0: restrictions valid (including some equality restrictions) vs. H1: at least one restriction from H0 violated, some equality restrictions are maintained

Note that TPs 1 and 11 can reject H0 even if H1 is violated by the data. Rejection of H0 does not provide evidence for H1 (but only against H0) in these TPs because H1 is not the opposite of H0. The tests concentrate their power in H1, but are only guaranteed to observe their level for the stated H0.

Also note that TP 3 does not make sense if obj involves equality restrictions (obj$meq>0).

Under TPs 1, 2, 11, and 21, the distributions of test statistics are mixtures of chi-square distributions (df.error=Inf) or beta-distributions (df.error finite) with different degrees of freedom (chi-square) or parameter combinations (beta). Shapiro (1988) gives detailed information on the mixing weights for the different scenarios. Basically, there are two different situations:

If meq=0, the weights are probabilities that a random variable with covariance matrix ui%*%cov%*%t(ui) is realized in the positive orthant or its lower-dimensional faces, respectively (if ui has too few columns, blow up by columns of 0s in appropriate positions) (Shapiro, formulae (5.5) or (5.10), respectively).

If meq > 0 (but not all restrictions are equality restrictions), the weights are probabilities that a random variable with covariance matrix the inverse of the lower right corner of solve(ui%*%cov%*%t(ui)) is realized in the positive orthant or its lower-dimensional faces, respectively (Shapiro, formula (5.9)).

These weights must then be combined with the appropriate degrees of freedom - these can be worked out by realizing that either the null hypothesis or the alternative hypothesis has fixed dimension and the respective mixing degrees of freedom are obtained by taking the difference to the dimension of the respective other hypothesis, which is correct because - given a certain dimension of the inequality-restricted estimate, the inequality-restricted estimate is a projection onto a linear space of that dimension.

The test for TP 3 (cf. e.g. Sasabuchi 1980) is based on the intersection-union principle and simply obtains its p-value as the maximum p-value from testing the individual restrictions.

Value

object of class ict, which is a list containing elements

TP

test problem identifier (cf. argument TP)

b.unrestr

unrestricted estimate

b.restr

restricted estimate

ui

restriction matrix, LHS

ci

restriction vector, RHS

restr.index

elements of mean referred to by ui and ci

meq

number of equality restrictions (first meq rows of ui), meq must not exceed nrow(ui)-1

iact

row numbers of active restrictions (all equality restrictions plus inequality restrictions that are met with equality by the solution b.restr)

ui.extra

additional restrictions for TP=11, calculated from input parameter ui0.11 by projecting out restrictions present in ui and - if necessary - omitting linearly dependent rows

b.eqrestr

equality-restrected estimate for TP=1

b.extra.restr

estimate for null hypothesis of TP=11

T

test statistic

p.value

p-value

s2

input parameter

cov

matrix with s2*cov equal to covariance matrix of unrestricted estimate

df.error

input parameter

df.bar

vector of degrees of freedom for test statistic distribution, cf. also input parameter df

wt.bar

vector of weights for test statistic distribution, cf. also input parameter wt

Note

Package versions up to 1.1-4 had a bug that caused p-values for TP=11 to be too large.

Author(s)

Ulrike Groemping, BHT Berlin

References

Sasabuchi, S. (1980) A test of a multivariate normal mean with composite hypotheses determined by linear inequalities. Biometrika 67, 429–429

Shapiro, A. (1988) Towards a unified theory of inequality-constrained testing in multivariate analysis. International Statistical Review 56, 49–62

See Also

See also ic.est, ic.weights

Examples

corr.plus <- matrix(c(1,0.5,0.5,1),2,2)
corr.null <- matrix(c(1,0,0,1),2,2)
corr.minus <- matrix(c(1,-0.5,-0.5,1),2,2)
## unrestricted vectors
x1 <- c(1, 1)
x2 <- c(-1, 1)
ict1 <- ic.test(ic.est(x1, corr.plus, ui=diag(c(1,1)), ci=c(0,0)))
ict1
summary(ict1)
ic.test(ic.est(x1, corr.plus, ui=diag(c(1,1)), ci=c(0,0)), s2=1, df.error=10)
ic.test(ic.est(x1, corr.minus, ui=diag(c(1,1)), ci=c(0,0)))
ic.test(ic.est(x1, corr.minus, ui=diag(c(1,1)), ci=c(0,0)), s2=1, df.error=10)
ic.test(ic.est(x2, corr.plus, ui=diag(c(1,1)), ci=c(0,0)))
ic.test(ic.est(x2, corr.plus, ui=diag(c(1,1)), ci=c(0,0)), s2=1, df.error=10)
ic.test(ic.est(x2, corr.minus, ui=diag(c(1,1)), ci=c(0,0)))
ic.test(ic.est(x2, corr.minus, ui=diag(c(1,1)), ci=c(0,0)), s2=1, df.error=10)

ict2 <- ic.test(ic.est(x2, corr.plus, ui=diag(c(1,1)), ci=c(0,0)),TP=2)
summary(ict2)
ict3 <- ic.test(ic.est(x1, corr.plus, ui=diag(c(1,1)), ci=c(0,0)),TP=3)
summary(ict3)

ict11 <- ic.test(ic.est(x1, corr.plus, ui=c(1,1), ci=0),TP=11, ui0.11 =c(1,0))
summary(ict11)

## larger example
corr.plus <- diag(1,8)
for (i in 1:7)
   for (j in (i+1):8)
     corr.plus[i,j] <- corr.plus[j,i] <- 0.5
u <- rbind(rep(1,6), c(-1,-1,-1,1,1,1), c(-1,0,1,0,0,0), c(0,0,0,-1,0,1))
ice <- ic.est(c(rep(1,4),rep(4,4)), corr.plus, ui=u, ci=rep(0,4), index=2:7, meq = 1)
ict1 <- ic.test(ice,TP=1)
summary(ict1)
ict2 <- ic.test(ice,TP=2)
summary(ict2)
ict11 <- ic.test(ice,TP=11)
summary(ict11,digits=3)
ice <- ic.est(c(rep(1,4),rep(4,4)), corr.plus, ui=u, ci=rep(0,4), index=2:7)
ict3 <- ic.test(ice, TP=3)
summary(ict3)

ic.infer documentation built on Oct. 5, 2023, 5:09 p.m.