On Wed, 19 Jul 2006, Gregor Gorjanc wrote: > I have encountered a weird problem and I am wondering if this is a bug. > Here is the example: > > n <- 50 > x <- runif(n=n) > y1 <- 2 * x + rnorm(n=n) > y2 <- 5 * x + rnorm(n=n) > y2[sample(1:n, size=5)] <- NA > > y <- cbind(y1, y2) > > fit <- lm(y1 ~ 1, na.action="na.exclude") > summary(fit) > > ## Goes ok here > fit <- lm(y2 ~ 1, na.action="na.exclude") > summary(fit) > > ## But fails if we use matrix of response variables > fit <- lm(y ~ 1, na.action="na.exclude") > summary(fit) > > ## Response y1 : > ## > ## Call: > ## lm(formula = y1 ~ 1, na.action = "na.exclude") > ## > ## Residuals: > ## Error in quantile.default(resid) : missing values and NaN's not > allowed if 'na.rm' is FALSE >
Yes, I think it's a bug. summary.mlm() produces an object that is a list of objects of class "summary.lm", but these objects get their $resid component from the residuals() function and so NAs in their $resid component where a "summary.lm" produced by summary.lm() would not. -thomas ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel