Learn R Programming

hcci (version 1.2.0)

QT: Quasi-t test in linear regression models

Description

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, ...)

Value

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

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.

Author

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

References

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

Examples

Run this code
  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)
  QT(model_2, significance = 0.05, hc=4, h0=0)

Run the code above in your browser using DataLab