An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120705/70c6fa17/attachment.pl>
Exclude missing values on only 1 variable
4 messages · Eiko Fried, Bert Gunter, David Winsemius
On Jul 5, 2012, at 1:25 PM, Eiko Fried wrote:
Hello, I have many hundred variables in my longitudinal dataset and lots of missings. In order to plot data I need to remove missings. If I do
data <- na.omit(data)
that will reduce my dataset to 2% of its original size ;) So I only need to listwise delete missings on 3 variables (the ones I am plotting). data$variable1 <-na.omit(data$variable1)
?complete.cases # returns a logical vector
data[ complete.cases( data[ , c("var1", "var2", "var3"]) , ]
David Winsemius, MD
West Hartford, CT
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120705/20eb5bb9/attachment.pl>
On Jul 5, 2012, at 1:34 PM, David Winsemius wrote:
On Jul 5, 2012, at 1:25 PM, Eiko Fried wrote:
Hello, I have many hundred variables in my longitudinal dataset and lots of missings. In order to plot data I need to remove missings. If I do
data <- na.omit(data)
that will reduce my dataset to 2% of its original size ;) So I only need to listwise delete missings on 3 variables (the ones I am plotting). data$variable1 <-na.omit(data$variable1)
?complete.cases # returns a logical vector
data[ complete.cases( data[ , c("var1", "var2", "var3"]) , ]
data[ complete.cases( data[ , c("var1", "var2", "var3") ] ) , ]
Er, need to add a right - paren -----here -----------^
David Winsemius, MD West Hartford, CT