wScore: Weighted Score Test

Description Usage Arguments Value Examples

Description

Tests the hypothesis that a subset of the regression coefficients are fixed at a reference value, affording different weights to different coefficients. The weights are renormalized internally such that the observed test statistic is one.

Usage

1
2
wScore(y, X, L, b10 = NULL, w = NULL, method = "asymptotic",
  B = 1000, parallel = F)

Arguments

y

Numeric response vector.

X

Numeric model matrix.

L

Logical vector, with as many entires as columns in the model matrix, indicating which columns have fixed coefficients under the null.

b10

Value of the regression coefficient for the selected columns under the null. Defaults to zero.

w

Weights for the selected regression coefficients under the null. Defaults to the one vector.

method

Either "asymptotic" or "perturbation".

B

Score perturbations.

parallel

Run in parallel? Must reigster parallel backend first.

Value

A numeric vector containing the score statistic, the degrees of freedom, and a p-value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# See Vignette for Data Generation.
# Hypothesis test
L = c(F,F,F,T,T);
# Asymptotic p-value
wScore(y=y,X=X,L=L,w=c(2,1),method="asymptotic");
# Perturbation p-value
wScore(y=y,X=X,L=L,w=c(2,1),method="perturbation");

## End(Not run)

zrmacc/LiST documentation built on May 9, 2019, 8:20 a.m.