conTest_summary: function for computing all available hypothesis tests

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/conTest.R

Description

conTest_summary computes all available hypothesis tests and returns and object of class conTest for which a print function is available. The conTest_summary can be used directly and is called by the conTest function if type = "summary".

Usage

1
2
## S3 method for class 'restriktor'
conTest_summary(object, test = "F", ...)

Arguments

object

an object of class restriktor.

test

test statistic; for information about the null-distribution see details.

  • for object of class lm; if "F" (default), the classical F-statistic is computed. If "Wald", the classical Wald-statistic is computed. If "score", the classical score test statistic is computed.

  • for object of class rlm; if "F" (default), a robust likelihood ratio type test statistic (Silvapulle, 1992a) is computed. If "Wald", a robust Wald test statistic (Silvapulle, 1992b) is computed. If "score", a score test statistic (Silvapulle, 1996) is computed.

...

the same arguments as passed to the conTest function, except for type, of course.

Value

An object of class conTest, for which a print is available. More specifically, it is a list with the following items:

CON

a list with useful information about the constraints.

Amat

constraints matrix.

bvec

vector of right-hand side elements.

meq

number of equality constraints.

meq.alt

same as input neq.alt.

iact

number of active constraints.

type

same as input.

test

same as input.

Ts

test-statistic value.

df.residual

the residual degrees of freedom.

pvalue

tail probability for Ts.

b.eqrestr

equality restricted regression coefficients. Only available for type = "A" and type = "global", else b.eqrestr = NULL.

b.unrestr

unrestricted regression coefficients.

b.restr

restricted regression coefficients.

b.restr.alt

restricted regression coefficients under HA if some equality constraints are maintained.

Sigma

variance-covariance matrix of unrestricted model.

R2.org

unrestricted R-squared.

R2.reduced

restricted R-squared.

boot

same as input.

model.org

original model.

Author(s)

Leonard Vanbrabant and Yves Rosseel

References

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

Silvapulle, M. (1992a). Robust tests of inequality constraints and one-sided hypotheses in the linear model. Biometrika, 79, 621–630.

Silvapulle, M. (1992b). Robust Wald-Type Tests of One-Sided Hypotheses in the Linear Model. Journal of the American Statistical Association, 87, 156–161.

Silvapulle, M. and Silvapulle, P. (1995). A score test against one-sided alternatives. American statistical association, 90, 342–349.

Silvapulle, M. (1996) On an F-type statistic for testing one-sided hypotheses and computation of chi-bar-squared weights. Statistics & probability letters, 28, 137–141.

Silvapulle, M. (1996) Robust bounded influence tests against one-sided hypotheses in general parametric models. Statistics & probability letters, 31, 45–50.

Silvapulle, M.J. and Sen, P.K. (2005). Constrained Statistical Inference. Wiley, New York

Wolak, F. (1987). An exact test for multiple inequality and equality constraints in the linear regression model. Journal of the American statistical association, 82, 782–793.

See Also

quadprog, conTest

Examples

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## example 1:
# the data consist of ages (in months) at which an 
# infant starts to walk alone.

# prepare data
DATA1 <- subset(ZelazoKolb1972, Group != "Control")

# fit unrestricted linear model
fit1.lm <- lm(Age ~ -1 + Group, data = DATA1)

# the variable names can be used to impose constraints on
# the corresponding regression parameters.
coef(fit1.lm)

# constraint syntax: assuming that the walking 
# exercises would not have a negative effect of increasing the 
# mean age at which a child starts to walk. 
myConstraints1 <- ' GroupActive  < GroupPassive; 
                    GroupPassive < GroupNo '

conTest(fit1.lm, myConstraints1)


# another way is to first fit the restricted model
fit.restr1 <- restriktor(fit1.lm, constraints = myConstraints1)

conTest(fit.restr1)

## Not run:  
  # Or in matrix notation.
  Amat1 <- rbind(c(-1, 0,  1),
                 c( 0, 1, -1))
  myRhs1 <- rep(0L, nrow(Amat1)) 
  myNeq1 <- 0
  
  fit1.con <- restriktor(fit1.lm, constraints = Amat1,
                         rhs = myRhs1, neq = myNeq1)
  conTest(fit1.con)

## End(Not run)            

restriktor documentation built on Feb. 25, 2020, 5:08 p.m.