Learn R Programming

Renvlp (version 2.7)

testcoef.logit.env: Hypothesis test of the coefficients of the envelope model

Description

This function tests the null hypothesis L * beta = A versus the alternative hypothesis L * beta ~= A, where beta is estimated under the envelope model in logistic regression.

Usage

testcoef.logit.env(m, L, A)

Arguments

m

A list containing estimators and other statistics inherited from logit.env.

L

The matrix multiplied to beta on the left. It is a d1 by p matrix, while d1 is less than or equal to p.

A

The matrix on the right hand side of the equation. It is a d1 by 1 matrix.

Value

The output is a list that contains following components.

chisqStatistic

The test statistic.

dof

The degrees of freedom of the reference chi-squared distribution.

pValue

p-value of the test.

covMatrix

The covariance matrix of vec(L beta).

Details

This function tests for hypothesis H0: L beta = A, versus Ha: L beta != A. The beta is estimated by the envelope model in predictor space. If L = Ip and A = 0, then the test is equivalent to the standard F test on if beta = 0. The test statistic used is vec(L beta - A) hatSigma^-1 vec(L beta - A)^T, where beta is the envelope estimator and hatSigma is the estimated asymptotic covariance of vec(L beta - A). The reference distribution is chi-squared distribution with degrees of freedom d1.

Examples

Run this code
# NOT RUN {
data(horseshoecrab)
X1 <- as.numeric(horseshoecrab[ , 1] == 2)
X2 <- as.numeric(horseshoecrab[ , 1] == 3)
X3 <- as.numeric(horseshoecrab[ , 1] == 4)
X4 <- as.numeric(horseshoecrab[ , 2] == 2)
X5 <- as.numeric(horseshoecrab[ , 2] == 3)
X6 <- horseshoecrab[ , 3]
X7 <- horseshoecrab[ , 5]
X <- cbind(X1, X2, X3, X4, X5, X6, X7)
Y <- as.numeric(ifelse(horseshoecrab[ , 4] > 0, 1, 0))

m <- logit.env(X, Y, 1)

L <- diag(7)
A <- matrix(0, 7, 1)

test.res <- testcoef.logit.env(m, L, A)
test.res
# }

Run the code above in your browser using DataLab