Re: [R] How to remove NAs and lme function

From: Jen_mp3 <Jen_mp3_at_msn.com>
Date: Wed, 28 May 2008 07:50:01 -0700 (PDT)

Thanks, that worked!

Andrew Robinson-6 wrote:

> 
> Jen,
> 
> try
> 
> na.action = na.exclude
> 
> Andrew
> 
> 
> On Wed, May 28, 2008 9:26 pm, Jen_mp3 wrote:

>>
>> I am working on a project to find a model for the concentration of
>> dissolved
>> oxygen in the river clyde. Ive fitted a linear mixed model as
>> lme(DOW~Temperature+Salinity+Year+factor(Station)*factor(Depth),
>> random~1|id), where id is an identifier of the day over 20 years defined
>> as
>> Day*10000 + Month*100 + (1900 - Year).
>> Anyway, there are some NAs for the concentration of dissolved oxygen in
>> the
>> water so I know you add in na.action = na.omit and that omits the NAs so
>> there are 9008 observations in the model, but it doesnt do it for the
>> whole
>> data set where there are 10965 including observations with NAs. I would
>> like
>> to plot the residuals from the model against the Salinity, Temperature
>> and
>> Year, but when I try, it seems to want to take the observations of these
>> variables from the full data set and the residuals from the model which
>> of
>> course doesnt work. I have tried using
>> data1 <- data[data$DOW != "NA",] on the whole data set but it doesnt
>> work.
>> How can I remove the NAs from a data set?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-remove-NAs-and-lme-function-tp17510564p17510564.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
> 
> 
> Andrew Robinson
> Senior Lecturer in Statistics                       Tel: +61-3-8344-6410
> Department of Mathematics and Statistics            Fax: +61-3-8344 4599
> University of Melbourne, VIC 3010 Australia
> Email: a.robinson_at_ms.unimelb.edu.au    Website:
> http://www.ms.unimelb.edu.au
> 
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-remove-NAs-and-lme-function-tp17510564p17514479.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 28 May 2008 - 17:10:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 28 May 2008 - 17:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive