Le test d'hétéroscédasticité dans Rstudio (détecter et corriger) | Comment dans R? | caps82

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024
  • Le test d'hétéroscédasticité dans Rstudio (détecter et corriger). Dans cette capsule, tu comprends l'heteroscedasticite ou l'homoscedasticite, comment le detecter dans ton modele de regression lineaire et le corriger.
    Merci de preferer #CommentdansR
    Le test d'hétéroscédasticité dans Rstudio (détecter et corriger) | caps 82
    *****Codes*******
    data("mtcars")
    head(mtcars)
    mod=lm(mpg~hp+wt+hp:wt, data = mtcars)
    summary(mod)
    library(car)
    ncvTest(mod)
    spreadLevelPlot(mod)
    library(lmtest)
    bptest(mod)
    mod2=lm(sqrt(mpg)~hp+wt+hp:wt, data = mtcars)
    summary(mod2)
    ncvTest(mod2)
    bptest(mod2)
    spreadLevelPlot(mod2)

ความคิดเห็น • 40