[R] R hang-up using lm
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Wed Apr 28 11:41:03 CEST 2004
Göran Broström <gb at stat.umu.se> writes:
> > > >> set.seed(3)
> > > >> yy <- rnorm(20)
> > > >> gg <- rep(1:10, 2)
> > > >> y <- tapply(yy, gg, median)
> > > >> x <- 1:10
> > > >> z <- lm(y ~ x) # OK
> > > >> z <- lm(x ~ y) # crashes R
....
> I had to try it too: No crashes on Win2000 pro (1.8.1) or Linux (1.9.0),
> but (in both cases):
>
>
> > lm(y ~ x)
>
> Call:
> lm(formula = y ~ x)
>
> Coefficients:
> (Intercept) x
> -0.8783 0.1293
>
>
> > lm(x ~ y)
>
> Call:
> lm(formula = x ~ y)
>
> Coefficients:
> (Intercept)
> 5.5
>
> i.e., only an intercept estimate in the second case! Surely something is
> wrong!?
I just tried it on the 64-bit system and got Göran's result. However,
repeating the lm(x~y) bit seems to have gotten itself stuck after the
3rd time (looks like a memory runaway problem, currently at 3.6GB and
counting...). So perhaps those who couldn't reproduce should try it with
replicate(100, lm(x~y)) or so.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list