bptest                package:lmtest                R Documentation

_B_r_e_u_s_c_h-_P_a_g_a_n _T_e_s_t

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

     Generic function performing the Breusch-Pagan test for
     heteroskedasticity.

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

     bptest(object, varformula, studentize = TRUE, data = list())

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

  object: either a formula or an `lm' object containing the model to be
          tested.

varformula: a formula describing only the potential explanatory
          variables for the variance (no dependent variable needed).

studentize: logical. If set to `TRUE' Koenker's studentized version of
          the test statistic will be used.

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

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

     The Breusch-Pagan test fits a linear regression model to the
     residuals of a linear regression model (by default the same
     explanatory variables are taken as in the main regression model if
     the formula interface is used) and rejects if too much of the
     variance is explained by the additional explanatory variables.

     Under H_0 the test statistic of the Breusch-Pagan test follows a
     chi-squared distribution with `parameter' (the number of
     regressors without the constant in the model) degrees of freedom.

     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:

     T.S. Breusch & A.R. Pagan (1979), A Simple Test for
     Heteroscedasticity and Random Coefficient Variation. Econometrica
     47, 1287-1294

     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 <- rnorm(100, sd=rep(c(1,2), 50))
     err2 <- rnorm(100)
     ## generate a linear relationship
     y1 <- 1 + x + err1
     y2 <- 1 + x + err2
     ## perform Breusch-Pagan test
     bp <- bptest(y1 ~ x)
     bp
     ## calculate critical value vor 0.05 level
     qchisq(0.95, bp$parameter)
     bptest(y2 ~ x)

