Re: [R] lm and NA

2008-07-01 Thread Kenn Konstabel
use the function resid instead of lm.object$residuals to extract the residuals: > resid(lm(a~b, na.action=na.exclude)) 1 2 3 4 5 6 -2.533445e-17 4.222409e-17 -8.444818e-18 -8.444818e-18 NANA > lm(a~b, na.action=na.exclude)$re

Re: [R] lm and NA

2008-06-30 Thread Rolf Turner
d(lm(c(1:4,NA,9)~c(3:7,NA), na.action=na.exclude)), 5) 1 2 3 4 5 6 0 0 0 0 NA NA HTH Peter Alspach -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Georg Ehret Sent: Tuesday, 1 July 2008 9:07 a.m. To: r-help Subject: [R] lm and NA Dear R community,

Re: [R] lm and NA

2008-06-30 Thread Peter Alspach
TECTED] On Behalf Of Georg Ehret > Sent: Tuesday, 1 July 2008 9:07 a.m. > To: r-help > Subject: [R] lm and NA > > Dear R community,Can I please get some advice on the > following: I wish > to obtain a list of residuals, padded by NAs for NAs in my > source data. I trie

[R] lm and NA

2008-06-30 Thread Georg Ehret
Dear R community,Can I please get some advice on the following: I wish to obtain a list of residuals, padded by NAs for NAs in my source data. I tried several options of "na.action", but did not succeed... Example: I would like to get "0,0,0,0,NA,NA": > a [1] 1 2 3 4 NA 9 > b [1] 3 4 5