s-news
[Top] [All Lists]

Re: na.omit by row

To: Snews <s-news@wubios.wustl.edu>
Subject: Re: na.omit by row
From: Bernd Puschner <puschner@psyres-stuttgart.de>
Date: Wed, 21 Feb 2001 08:37:25 +0100
Organization: Forschungsstelle für Psychotherapie Stuttgart
References: <3A91579C.B2F25802@psyres-stuttgart.de>
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


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