Skip to content

lmrob's fitted to data with NAs #238

@benthestatistician

Description

@benthestatistician

@kkbrum suggests

lines 32 and 33 in lmrob_methods.R here should invoke stats::naresid like in the xmat call; otherwise line 36 fails.

  xmat <- stats::model.matrix(x)
  xmat <- stats::naresid(x$na.action, xmat)
  psi <- chi <- ctrl$psi
  stopifnot(is.numeric(c.chi <- ctrl$tuning.chi),
            is.numeric(c.psi <- ctrl$tuning.psi))
  r0 <- x$init$resid
  r <- x$residuals

This seems right to me. We should verify by filling out the tests/testthat/test.lmrob_methods.R tests to include some fitting the lmrob using na.action = na.exclude. The conjecture is that this won't work with the code as is, but should work after the sugested substitutions.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions