Paul
Paul

Reputation: 1355

can't plot rlm-object. non-NA residual length does not match cases used in fitting

I'm trying to plot a rlm - object but I'm getting following error

Error in lm.influence(x, do.coef = FALSE) : 
    non-NA residual length does not match cases used in fitting

I've searched for this error on the internet, but haven't found anything and I don't understand what it means and why does it appear.

The date which is used in the rlm regression consists out of 1 dependent variable and 4 explanatory variables. none of the observation is NA or NULL.

the result object model$df.residual equals NA. this is the only NA in the whole result object.

Could someone explain me how I could avoid getting the df.residual equal NA?

Upvotes: 2

Views: 872

Answers (1)

statquant
statquant

Reputation: 14370

This is actually in the docs:

Note that the df.residual component is deliberately set to NA to avoid inappropriate estimation of the residual scale from the residual mean square by "lm" methods

Also a quote from the author of MASS

df.residual is not a relevant concept [for rlm], and the coefficients are not t-distributed

Upvotes: 2

Related Questions