Re: [R] Returning NA from lm

2011-02-16 Thread agent dunham
Hi, thanks for your post, I tried what you said, and it runs, however when I type summary ... I obtain the following: What's happening? How can I solve it? lmod1.lm - tryCatch(lm(log(dat$inaltu)~log(dat$indiam),na.action=na.fail),error=function(err){NA}) summary(lmod1.lm,

[R] Returning NA from lm

2009-01-23 Thread Neil Beddoe
Hi. I need to apply run a regression analysis for groups of data of fixed length:100 As, 100 Bs, 100 Cs etc. eg x Key Value A 1 A 21.2 A 4 A 6.5 ...repeat 96 times with differing values of A B 1 B 2.3 B NA B 6.5 ...repeat 96 times with

Re: [R] Returning NA from lm

2009-01-23 Thread Prof Brian Ripley
See ?na.exclude On Fri, 23 Jan 2009, Neil Beddoe wrote: Hi. I need to apply run a regression analysis for groups of data of fixed length:100 As, 100 Bs, 100 Cs etc. eg x Key Value A 1 A 21.2 A 4 A 6.5 ...repeat 96 times with differing values of A B 1 B

Re: [R] Returning NA from lm

2009-01-23 Thread Neil Beddoe
Beddoe Cc: r-help@r-project.org Subject: Re: [R] Returning NA from lm See ?na.exclude On Fri, 23 Jan 2009, Neil Beddoe wrote: Hi. I need to apply run a regression analysis for groups of data of fixed length:100 As, 100 Bs, 100 Cs etc. eg x Key Value A 1 A 21.2

Re: [R] Returning NA from lm

2009-01-23 Thread Neil Beddoe
' Cc: r-help@r-project.org Subject: Re: [R] Returning NA from lm I tried that I'm afraid. I still get values for groups with missing data. I think na.exclude just ignores the NAs but I want it to return NA. Where one of the values is NA. -Original Message- From: Prof Brian Ripley