[R] the test result is quite different,why?

John Fox jfox at mcmaster.ca
Sat Jun 4 16:58:48 CEST 2005


Dear ronggui,

You're fitted different variance models: in bptest(), you're modeling the
variance using any linear combination of the predictors, while in ncv.test()
you're modeling the variance as a function of the fitted values, which is
more restrictive. BTW, both bptest() and ncv.test() can do both of these
tests.

John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
-------------------------------- 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of ronggui
> Sent: Friday, June 03, 2005 9:59 PM
> To: r-help at stat.math.ethz.ch 
> Subject: [R] the test result is quite different,why?
> 
> data:http://fmwww.bc.edu/ec-p/data/wooldridge/CRIME4.dta
> 
> > a$call
> lm(formula = clcrmrte ~ factor(year) + clprbarr + clprbcon + 
>     clprbpri + clavgsen + clpolpc, data = cri)
> > bptest(a,st=F)
> 
>         Breusch-Pagan test
> 
> data:  a
> BP = 34.4936, df = 10, p-value = 0.0001523
> 
> > bptest(a,st=T)
> 
>         studentized Breusch-Pagan test
> 
> data:  a
> BP = 10.9297, df = 10, p-value = 0.363
> 
> > ncv.test(a)
> $formula
> ~fitted.values
> 
> $formula.name
> [1] "Variance"
> 
> $ChiSquare
> [1] 1.163501
> 
> $Df
> [1] 1
> 
> $p
> [1] 0.2807406
> 
> $test
> [1] "Non-constant Variance Score Test"
> 
> attr(,"class")
> [1] "chisq.test"
> >
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list