I want to use lm()
in R to fit a series (actually 93) separate linear regressions. According to the R lm()
help manual:
"If response is a matrix a linear model is fitted separately by least-squares to each column of the matrix."
This works fine as long as there are no missing data points in the Y response matrix. When there are missing points, instead of fitting each regression with the available data, every row that has a missing data point in any column is discarded. Is there any way to specify that lm()
should fit all of the columns in Y independently and not discard rows where an individual column has a missing data point?