Breusch and Pagan heteroskedasticity test
[resulbp]=bpagan(resulols,arg1,...,argn)
* resulols = results tlist from a first stage estimation
* argi = arguments of the second stage regression, which can be:
- a time series
- a real (nxp) vector
- a string equal to the name of a time series or a (nxp) real vector between quotes
- the string 'noprint' if the user doesn't want to print the results of the regression
* resulbp = a results tlist with:
- resulbp('meth') = 'bpagan'
- resulbp('resul1st') = results tlist of the first stage regression
- resulbp('u2') = sum of square residuals from the first stage regression
- resulbp('namex2') = names of the exogenous variables in the second stage regression
- resulbp('x2') = vector of the exogenous variables in the second stage regression
- resulbp('f') = Breush-Pagan LM-statistic (Fisher form)
- resulbp('p') = p-value of the test
- resulbp('dfnum') = degrees of freedom of the numerator
- resulbp('dfden') = degrees of freedom of the denominator
- resulbp('f_pvalue) = p-value of the test
load(GROCERDIR+'/data/bdhenderic.dat'); bounds('1964q3','1989q2'); rols=ols('delts(lm1-lp)','delts(lp)','delts(lagts(1,lm1-lp-ly))','rnet', 'lagts(1,lm1-lp-ly)', 'const'); // performs ols for Hendry and Ericsson (1991) equation 6 bpagan(rols,'delts(lp)','delts(lagts(1,lm1-lp-ly))','rnet','lagts(1,lm1-lp-ly)','cte','(delts(lp))^2', '(delts(lagts(1,lm1-lp-ly)))^2','(rnet)^2','(lagts(1,lm1-lp-ly))^2') // Example taken from bpagan_d. The first stage result comes from the estimation of Hendry and Ericsson equation # 6. // The second stage exogenous variables are the squares of all exogenous variables of the first stage regression. | ![]() | ![]() |