simple question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

simple question

David Hugh-Jones-3
Hello all

I have a fit resulting from a call to glm. Now, I would like to extract the
model frame MF, and add some variables
from the original data frame DF. To do this, I need to know which rows in DF
correspond to rows in MF (since some were dropped by na.omit). How can I do
this? It's probably simple but the information is hard to find.


David Hugh-Jones
Post-doctoral Researcher
Max Planck Institute of Economics, Jena
http://davidhughjones.googlepages.com

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: simple question

Peter Dalgaard
David Hugh-Jones wrote:
> Hello all
>
> I have a fit resulting from a call to glm.

Now, now, no reason to overreact...

("Women can have fits upstairs" -- sign in Indian tailor shop)

> Now, I would like to extract the
> model frame MF, and add some variables
> from the original data frame DF. To do this, I need to know which rows in DF
> correspond to rows in MF (since some were dropped by na.omit). How can I do
> this? It's probably simple but the information is hard to find.

na.omit leaves a footprint in, e.g.,
attr(na.omit(airquality),"na.action"). This can be used for (negative)
indexing.

--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] 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.