Skip to content

Summary() fails after use of na.action="na.exclude" in lm() (PR#9191)

1 message · Gregor Gorjanc

#
Hello!

I have already reported on this behaviour at [1] and now I have checked
the same example on r-devel and the problem is still there. Thomas
Lumley inidicated problem [2]. 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)

## Goes ok here
fit <- lm(y1 ~ 1, na.action="na.exclude")
summary(fit)

## And 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

[1]http://tolstoy.newcastle.edu.au/R/devel/06/07/6187.html
[2]http://tolstoy.newcastle.edu.au/R/devel/06/07/6203.html

--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = Under development (unstable)
 major = 2
 minor = 4.0
 year = 2006
 month = 08
 day = 30
 svn rev = 39022
 language = R
 version.string = R version 2.4.0 Under development (unstable)
(2006-08-30 r39022)

Locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:methods, package:stats, package:graphics,
package:grDevices, package:utils, package:datasets, Autoloads, package:base