Skip to content

Test for Homoscedesticity in R Without BP Test

6 messages · Deepak Singh, John C Frain, varin sacha +1 more

#
Respected Sir,
I am doing a project on multiple linear model fitting and in that project I
have to test Homoscedesticity of errors I have google for the same and
found bptest for the same but in R version 3.2.4 bp test is not available.
So please suggest me a test on homoscedesticity ASAP as we have to submit
our report on 7-04-2016.

P.S. : I have plotted residuals against fitted values and it is less or
more random.

Thank You !
#
You might "google Breusch Pagan test r" and find that the test is
implemented in lmtest package.
On 4 Apr 2016 17:28, "Deepak Singh" <sdeepakrhelp at gmail.com> wrote:

            

  
  
#
Hi Deepak,

In econometrics there is another test very often used : the white test.
The white test is based on the comparison of the estimated variances of residuals when the model is estimated by OLS under the assumption of homoscedasticity and when the model is estimated by OLS under the assumption of heteroscedastic.


The White test with R

install.packages("bstats")
library(bstats)
white.test(LinearModel)



Hope this helps.

Sacha





________________________________
De : Deepak Singh <sdeepakrhelp at gmail.com>
? : r-help at r-project.org 
Envoy? le : Lundi 4 avril 2016 10h40
Objet : [R] Test for Homoscedesticity in R Without BP Test


Respected Sir,
I am doing a project on multiple linear model fitting and in that project I
have to test Homoscedesticity of errors I have google for the same and
found bptest for the same but in R version 3.2.4 bp test is not available.
So please suggest me a test on homoscedesticity ASAP as we have to submit
our report on 7-04-2016.

P.S. : I have plotted residuals against fitted values and it is less or
more random.

Thank You !


______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
#
On Mon, 4 Apr 2016, Deepak Singh wrote:

            
The function is called bptest() and is implemented in package "lmtest" 
which is available for current versions of R, see
https://CRAN.R-project.org/package=lmtest

To install it, run:
install.packages("lmtest")

And then to load the package and try the function:
library("lmtest")
example("bptest")
#
On Mon, 4 Apr 2016, varin sacha via R-help wrote:

            
The White test is a special case of the Breusch-Pagan test using a 
particular specification of the auxiliary regressors: namely all 
regressors, their squares and their cross-products. As this specification 
makes only sense if all regressors are continuous, many implementations 
have problems if there are already dummy variables, interactions, etc. in 
the regressor matrix. This is also the reason why bptest() from "lmtest" 
uses a different specification by default. However, you can utilize the 
function to carry out the White test as illustrated in:

example("CigarettesB", package = "AER")

(Of course, the AER package needs to be installed first.)
That package is no longer on CRAN as it took the code from bptest() 
without crediting its original authors and released it in a package that 
conflicted with the original license. Also, the implementation did not 
check for potential problems with dummy variables or interactions 
mentioned above.

So the bptest() implementation from "lmtest" is really recommend. Or 
alternatively ncvTest() from package "car".
#
I have tried and got the result.
Thank you every one.


On Tue, Apr 5, 2016 at 12:58 AM, Achim Zeileis <Achim.Zeileis at uibk.ac.at>
wrote: