dredge function error - R package MuMln

前端 未结 2 635
死守一世寂寞
死守一世寂寞 2021-01-01 15:15

I have to do statistical analyses on a data set. I would like to create all the possible models and to test them with the dredge function but it doesn\'t work. Indeed, when

2条回答
  •  孤街浪徒
    2021-01-01 15:43

    See ?dredge:

    # Example from Burnham and Anderson (2002), page 100:
    data(Cement)
    options(na.action = "na.fail")   #  prevent fitting models to different datasets
    
    fm1 <- lm(y ~ ., data = Cement)
    dd <- dredge(fm1)
    

    If you skip the second line, your described error pops up, as the models are fitted to different datasets (due to removal of NAs).

提交回复
热议问题