gqtest                package:lmtest                R Documentation

_G_o_l_d_f_e_l_d-_Q_u_a_n_d_t _T_e_s_t

_D_e_s_c_r_i_p_t_i_o_n:

     Goldfeld-Quandt test for heteroskedasticity.

_U_s_a_g_e:

     gqtest(formula, point = 0.5, order.by = NULL, data = list())

_A_r_g_u_m_e_n_t_s:

 formula: a symbolic describtion for the model to be tested

   point: numerics. If `point' is smaller than 1 it is interpreted as
          percentages of data, i.e. `n*point' is taken to be the
          (potential) breakpoint in the variances, if `n' is the number
          of observations in the model. If `point' is greater than 1 it
          is interpreted to be the index of the breakpoint.

order.by: formula. A formula with a single explanatory variable like `~
          x'. Then the observations in the model are ordered by the
          size of `x'. If set to `NULL' (the default) the observations
          are assumed to be ordered (e.g. a time series).

    data: an optional data frame containing the variables in the model.
          By default the variables are taken from the environment which
          `gqtest' is called from.

_D_e_t_a_i_l_s:

     The Goldfeld-Quandt test compares the variances of two submodels
     divided by a specified breakpoint and rejects if the variances
     differ.

     Under H_0 the test statistic of the Goldfeld-Quandt test follows
     an F distribution with the degrees of freedom as given in
     `parameter'.

     Examples can not only be found on this page, but also on the help
     pages of the data sets `bondyield', `currencysubstitution',
     `growthofmoney', `moneydemand', `unemployment', `wages'.

_V_a_l_u_e:

     A list with class `"htest"' containing the following components: 

statistic: the value of the test statistic.

 p.value: the p-value of the test.

parameter: degrees of freedom.

  method: a character string indicating what type of test was
          performed.

data.name: a character string giving the name(s) of the data.

_R_e_f_e_r_e_n_c_e_s:

     S.M. Goldfeld & R.E. Quandt (1965), Some Tests for
     Homoskedasticity. Journal of the American Statistical Association
     60, 539-547

     W. Kraemer & H. Sonnberger (1986), The Linear Regression Model
     under Test. Heidelberg: Physica

_S_e_e _A_l_s_o:

     `lm'

_E_x_a_m_p_l_e_s:

     ## generate a regressor
     x <- rep(c(-1,1), 50)
     ## generate heteroskedastic and homoskedastic disturbances
     err1 <- c(rnorm(50, sd=1), rnorm(50, sd=2))
     err2 <- rnorm(100)
     ## generate a linear relationship
     y1 <- 1 + x + err1
     y2 <- 1 + x + err2
     ## perform Goldfeld-Quandt test
     gqtest(y1 ~ x)
     gqtest(y2 ~ x)

