title: Why do I keep getting this error when I run the dredge function in R: "Error in MuMIn::dredge(global.model = ols) : result is empty"?
body: <p>I keep getting this error when I run the dredge function in R: &quot;Error in MuMIn::dredge(global.model = ols) : result is empty&quot;, and I'm not sure What is wrong. Here is my coding:<a href="https://i.stack.imgur.com/6CvAS.png" rel="nofollow noreferrer">R coding</a></p>
  <p>FYI I didn't include all of the formula (it got cut off in the image).</p>
  <pre><code>library(MuMIn)
  library(spatialreg)
  library(spdep)
  data = RHDVdatasetMarch
  names(data)
  ?MuMIn::dredge
  #first &quot;global&quot; model
  ols = stats::lm(formula = DV3composite~classify3+classify8+house2+house5+travel+Male+prefernot+age+school+compositeconcern40+compositeimpact128+totalknowledgescore+compositerisk41+compositeprevent44+compositegov113+composite42factor1+composite42factor2, data = RHDVdatasetMarch)
  summary(ols)
  ##dredge to confirm variable and best model
  options(na.action = &quot;na.fail&quot;)
  MuMIn::dredge(global.model = ols)
  </code></pre>