Skip to content
Prev 277308 / 398506 Next

help in fitted values in lm function

This caught me learning R, and no doubt thousands of others. 

When would one ever want the results of fitted() or residuals() to NOT match the data frame rows which went into the model? Certainly making shrinking the results the default is not what 99% of user will want  if they need to access residuals: They will want a list of residuals padded with NAs to plot or use in further analyses in the originating data frame.

IMHO, the default na.action for lm() should be ?na.exclude" (which, believe it or not, INcludes NAs in the results?)

Best, tim
On 14 Nov 2011, at 3:49 PM, William Dunlap wrote: