[S] responses for "na.include"

WayWay M. Hlaing (wayway@gate.net)
Tue, 31 Mar 1998 07:53:10 -0500

Many thanks to Jose Pinheiro & Lutz Prechelt who responded to my question
"na.include". Original msg. & their responses below:

Original msg & response from Jose Pinheiro: jcp@research.bell-labs.com

>> I am a relatively new user of Splus. Upon reading online manuals of =
>> Nonlinear Mixed Effects Model
>> (NLME) & na.include, I am still not sure what exactly splus does when =
>> you include na.action=na.include
>> in the model statement. The model statement is attached below.
>If your data (specified in the "data" argument to nlme) contains
>missing values (NAs), the default behavior will be to give an error
>message (that's what the function na.fail, which is the default for
>"na.action", does). Usually, but not always, one would like to omit
>the missing values from the data. In this case you should specify
>na.action=na.omit. This will cause any rows that contain NAs to be
>deleted from the data frame. Finally, there are cases where you would
>like the NAs to stay in the data as they are, because your model
>function knows how to handle them. In this case you use na.include,
>which simply leaves the data as it is, without removing rows with NAs,
>or giving you error messages.
>> Questions: (1) Does Splus do the imputation automatically for all the =
>> NAs for all variables? If so, with what value - mean or median?
>> (2) what does it mean by adding a level? (online manual of
>> na.include). Many of the variables in my dataset are continuous
>> variables.
>The help file is a bit misleading. It tells you what the function does
>when applied to a factor (it creates an additional level "NA" to
>represent the NAs). If you look at the function directly, you will see
>that if its argument is not a factor it returns it unchanged (well, if
>the argument is data frame, na.include is applied to each of its
>> (3) am I using the option na.include incorrectly?
>That depends on whether your model function can handle NAs (I am
>assuming they are present in your data).
>Hope this helps,
>--Jose' Pinheiro
Response from Lutz Prechelt: <prechelt@ira.uka.de>

>na.include works _only_ for factors.
>You will probably want to use na.gam.replace instead.
> Lutz

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