s-news
[Top] [All Lists]

Re: na.omit by row

To: snews <s-news@lists.biostat.wustl.edu>
Subject: Re: na.omit by row
From: Bernd Puschner <puschner@psyres-stuttgart.de>
Date: Thu, 22 Feb 2001 19:49:51 +0100
Organization: Forschungsstelle für Psychotherapie Stuttgart
References: <3A91579C.B2F25802@psyres-stuttgart.de> <3A937034.E76CA1DE@psyres-stuttgart.de>
dear all,

thanks to Petr Pikal, Andy Liaw, Gérald Jean, Sam Buttrey, Patrick Connolly and especially Nick Ellis for their quick and helpful answers. the problem stems from the fact that the factor variable is string, i.e. ""s are not NAs.

bernd

Bernd Puschner schrieb:

dear s-plus-users,

thanks to david m. smith, renaud lancelot, d. mckenzie, gérald jean, and nick
ellis for their quick answers. they all suggested the same solution:

leidenbeg.omiss <-  leidenbeg[!is.na(leidenbeg$the.factor.variable), ]

still, the dimensions of the two datasets are the same:

> dim(leidenbeg)
[1] 686 894
> dim(leidenbeg.omiss)
[1] 686 894

my factor variable is THER (summary see below), so i wonder why the new
dataset doesn't contain 37 rows fewer than the old one. probably obious to
everybody except for me.

thanks, this is a great community.

bernd

***  Summary Statistics for data in:  leidenbeg ***

  THER
   : 37
 bt:207
 pa:108
 pd:334

Bernd Puschner schrieb:

> dear s-plus users,
>
> i have a hudge data set
>
> > dim(leidenbeg)
> [1] 686 889
>
> on part of which i want to perform survival analyses. i want to create a
> data set which omits all cases with missings on the factor variable of
> the survivals. if i compute
>
> leidenbeg.omiss <- na.omit (leidenbeg)
>
> s-splus kicks out cases with missings on any of the variables. there's
> probably a very easy solution to that.
>
> thanks a lot
>
> bernd
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news

---------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news

Attachment: puschner.vcf
Description: Visitenkarte für Bernd Puschner

<Prev in Thread] Current Thread [Next in Thread>