Skip to contents

This function performs the quasi-t test for the parameters that index linear regression models, considering models with unknown heteroscedasticity, where HC methods are used to estimate the covariance matrix.

Usage

QT(model, significance = 0.05, hc=4, h0=0, ...)

Arguments

model

Any object of class lm;

significance

Significance level of the test. By default, the level of significance is 0.05;

hc

Method HC that will be used to estimate the covariance structure. The argument method may be 0, 2, 3, 4 or 5;

h0

Constant used in the null hypothesis (default is h0 = 0);

...

Additional arguments to be passed to the function HC.

References

Cribari-Neto, F. (2004). Asymptotic inference under heteroskedasticity of unknown form. Computational Statistics and Data Analysis, 45, 215-233.

Author

Pedro Rafael Diniz Marinho <pedro.rafael.marinho@gmail.com>

Value

Returns an object of class list with the estimated covariance matrix.

Examples

  library(hcci)
  data(schools)
  y = schools$Expenditure # dependent variable
  x = schools$Income/10000 # regressor scaled by 10^4
  model_1 = lm(y ~ x)
  model_2 = lm(y ~ x+I(x^2))
  QT(model_1, significance = 0.05, hc=4, h0=0)
#> $model
#> 
#> Call:
#> lm(formula = y ~ x)
#> 
#> Coefficients:
#> (Intercept)            x  
#>      -151.3        689.4  
#> 
#> 
#> $statistics
#> Intercept         x 
#> 0.8875671 2.9515083 
#> 
#> $p_value
#>  Intercept          x 
#> 0.18738684 0.00158113 
#> 
  QT(model_2, significance = 0.05, hc=4, h0=0)
#> $model
#> 
#> Call:
#> lm(formula = y ~ x + I(x^2))
#> 
#> Coefficients:
#> (Intercept)            x       I(x^2)  
#>       832.9      -1834.2       1587.0  
#> 
#> 
#> $statistics
#> Intercept         x    I(x^2) 
#> 0.2768988 0.2241427 0.2891351 
#> 
#> $p_value
#> Intercept         x    I(x^2) 
#> 0.3909289 0.4113231 0.3862390 
#>