Description Usage Arguments Value Examples
Tests the hypothesis that a subset of the regression coefficients are fixed
at a reference value. Specifically, let β denote the regression
coefficient. Partition β=(β_{1},β_{2}). Suppose that
interest lies in testing that β_{1} is fixed at β_{10}.
Score.BinReg
performs a score test of
H_{0}:β_{1}=β_{10}. The test is specified using a logical vector
L
, with as many entries as columns in the model matrix X
. The
values of L
set to T
are constrained under the null, while
values of L
set to F
are estimated under the null.
1 2 | Score.BinReg(y, X, L, b10 = NULL, model = "logistic", df = NULL,
sig = 0.05, eps = 1e-08, maxit = 10, report = T)
|
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. |
model |
Selected from among logistic, probit, and robit. |
df |
Degrees of freedom, if using the robit model. |
sig |
Significance level, for CIs. |
eps |
Tolerance for Newton-Raphson iterations. |
maxit |
Maximum number of NR iterations. |
report |
Report fitting progress? |
A numeric vector containing the score statistic, the degrees of freedom, and a p-value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
set.seed(101);
# Design matrix
X = cbind(1,matrix(rnorm(n=4*1e3),nrow=1e3));
# Regression coefficient
b = c(1,-1,2,-1,0);
# Logistic outcome
y = rBinReg(X,b,model="logistic");
# Test b1=b2=b3=b4=0, which is false.
Score.BinReg(y=y,X=X,L=c(F,T,T,T,T),model="logistic",report=F);
# Test b4=0, which is true.
Score.BinReg(y=y,X=X,L=c(F,F,F,F,T),model="logistic",report=F);
# Test b2=0 and b4=2, which if false.
Score.BinReg(y=y,X=X,L=c(F,F,T,F,T),b10=c(0,2),model="logistic",report=F);
# Test b1=b3=-1, which is true.
Score.BinReg(y=y,X=X,L=c(F,T,F,T,F),b10=c(-1,-1),model="logistic",report=F);
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.