Description Usage Arguments Value References Examples
Computes the leave-out F-test from Anatolyev and Sølvsten (2020) which performs a test of the null hypothesis Rβ = q in the linear regression model y = Xβ + ε. The test provides an adjustment to the usual critical value used with the F-test, and this adjustment makes the test robust to many restrictions and heteroskedasticity in the error terms. The test retains asymptotic validity even when the number of regressors and restrictions are proportional to sample size.
1 |
linmod |
an object of class "lm" that stems from fitting the regression model y = Xβ + ε. |
R |
a matrix specifying the linearly independent restrictions on the parameters.
The number of rows in |
q |
a vector of the hypothesized values for the linear combinations of the parameters Rβ. |
nCores |
an optional argument for users who want to use parallel processing to speed up computations. |
size |
the desired nominal size of the test. The standard is 5%. |
LOFtest
returns the realized value of the usual F-statistic,
the p
-value corresponding to this realization when using the critical value function proposed in Anatolyev and Sølvsten (2020),
and the critical value for the specificed size
.
Anatolyev and Sølvsten (2020). Testing Many Restrictions Under Heteroskedasticity. https://arxiv.org/abs/2003.07320
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## An example of a regression with 640 observations, 512 regressors,
## and a null hypothesis that imposes 384 restrictions on the model.
set.seed(1)
X <- cbind(1, (0.5+runif(640))*matrix(exp(rnorm(640*511)), 640,511))
y <- X %*% c( -.5, rep(0.002,511) ) + rnorm(640)*.3*rowMeans(X)^2
R <- cbind( matrix(0, 384, 128), diag(384))
q <- rep(0.002, 384)
linmod <- lm(y~X-1)
LOFtest(linmod, R, q)
## The null is not rejected at the 5\% level since the value of the
## F statistic is below the critical value returned by LOFtest.
## Relying on the usual critical value qf(.95,384,640-512)=1.279
## would incorrectly lead to a rejection of the null.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.