[R] na.action and simultaneous regressions

From: Talbot Katz <topkatz_at_msn.com>
Date: Wed 03 Jan 2007 - 19:56:21 GMT


I am running regressions of several dependent variables using the same set of independent variables. The independent variable values are complete, but each dependent variable has some missing values for some observations; by default, lm(y1~x) will carry out the regressions using only the observations without missing values of y1. If I do lm(cbind(y1,y2)~x), the default will be to use only the observations for which neither y1 nor y2 is missing. I'd like to have the regression for each separate dependent variable use all the non-missing cases for that variable. I would think that there should be a way to do that using the na.action option, but I haven't seen this in the documentation or figured out how to do it on my own. Can it be done this way, or do I have to code the regressions in a loop? (By the way, since it restricts to non-missing values in all the variables simultaneously, is this because it's doing some sort of SUR or other simultaneous equation estimation behind the scenes?)


R-help@stat.math.ethz.ch 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. Received on Thu Jan 04 13:58:40 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 04 Jan 2007 - 03:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.