Hallgeir.Grinde@elkem.no
2005-Oct-05 12:45 UTC
[Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
Dette er en melding med flere deler i MIME-format. --=_alternative 004613C000257091_Content-Type: text/plain; charset="US-ASCII" And some more informastion I forgot. R does not crash if I write out the formula: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) -> R crashes fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 +x4:x5+x4:x6+x4:x7+x4:x8 +x5:x6+x5:x7+x5:x8 +x6:x7+x6:x8 +x7:x8) -> R does not crash This is the same formula, at least it should be. Uwe Ligges <ligges at statistik.uni-dortmund.de> 05.10.2005 12:13 Til: Prof Brian Ripley <ripley at stats.ox.ac.uk> cc: hallgeir.grinde at elkem.no, R-bugs at biostat.ku.dk Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180) Prof Brian Ripley wrote:> On Wed, 5 Oct 2005 hallgeir.grinde at elkem.no wrote: > > >>Full_Name: Hallgeir Grinde >>Version: 2.1.1 >>OS: Windows XP >>Submission from: (NULL) (144.127.1.1) >> >> >>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers ofvariables>>are at least 8. > > > OK, let's try to reproduce that: > > >>x1 <- runif(1000) >>x2 <- runif(1000) >>x3 <- runif(1000) >>x4 <- runif(1000) >>x5 <- runif(1000) >>x6 <- runif(1000) >>x7 <- runif(1000) >>x8 <- runif(1000) >>y <- rnorm(1000) >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > > > No crash, a quite reasonable fit. > > Can we please have a reproducible example, as we do ask? >Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 r35682M) on WinNT 4.0, SP6. Let's make it reproducible: set.seed(123) x1 <- runif(1000) x2 <- runif(1000) x3 <- runif(1000) x4 <- runif(1000) x5 <- runif(1000) x6 <- runif(1000) x7 <- runif(1000) x8 <- runif(1000) y <- rnorm(1000) fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) Uwe Ligges NOTICE Please immediately e-mail back to sender if you are not the intended recipient. Thereafter delete the e-mail along with any attachments without making copies. Elkem reserves all rights of privilege, confidentiality and copyright. --=_alternative 004613C000257091_Content-Type: text/html; charset="US-ASCII" <br><font size=2 face="sans-serif">And some more informastion I forgot.</font> <br><font size=2 face="sans-serif">R does not crash if I write out the formula:</font> <br> <br><font size=2><tt>set.seed(123)<br> x1 <- runif(1000)<br> x2 <- runif(1000)<br> x3 <- runif(1000)<br> x4 <- runif(1000)<br> x5 <- runif(1000)<br> x6 <- runif(1000)<br> x7 <- runif(1000)<br> x8 <- runif(1000)<br> y <- rnorm(1000)<br> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2)</tt></font> <br><font size=2><tt>-> R crashes</tt></font> <br> <br><font size=2><tt>fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8</tt></font> <br><font size=2><tt> +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8</tt></font> <br><font size=2><tt> +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8</tt></font> <br><font size=2><tt> +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8</tt></font> <br><font size=2><tt> +x4:x5+x4:x6+x4:x7+x4:x8</tt></font> <br><font size=2><tt> +x5:x6+x5:x7+x5:x8</tt></font> <br><font size=2><tt> +x6:x7+x6:x8</tt></font> <br><font size=2><tt> +x7:x8)</tt></font> <br><font size=2><tt>-> R does not crash</tt></font> <br><font size=2><tt>This is the same formula, at least it should be.</tt></font> <br> <br> <br> <br> <table width=100%> <tr valign=top> <td> <td><font size=1 face="sans-serif"><b>Uwe Ligges <ligges at statistik.uni-dortmund.de></b></font> <p><font size=1 face="sans-serif">05.10.2005 12:13</font> <td><font size=1 face="Arial"> </font> <br><font size=1 face="sans-serif"> Til: Prof Brian Ripley <ripley at stats.ox.ac.uk></font> <br><font size=1 face="sans-serif"> cc: hallgeir.grinde at elkem.no, R-bugs at biostat.ku.dk</font> <br><font size=1 face="sans-serif"> Emne: Re: [Rd] R crashes for large formulas in lm() (PR#8180)</font></table> <br> <br> <br><font size=2><tt>Prof Brian Ripley wrote:<br> <br> > On Wed, 5 Oct 2005 hallgeir.grinde at elkem.no wrote:<br> > <br> > <br> >>Full_Name: Hallgeir Grinde<br> >>Version: 2.1.1<br> >>OS: Windows XP<br> >>Submission from: (NULL) (144.127.1.1)<br> >><br> >><br> >>While using lm(y~(x*z*c*...*v)^2) R crashes/closes if the numbers of variables<br> >>are at least 8.<br> > <br> > <br> > OK, let's try to reproduce that:<br> > <br> > <br> >>x1 <- runif(1000)<br> >>x2 <- runif(1000)<br> >>x3 <- runif(1000)<br> >>x4 <- runif(1000)<br> >>x5 <- runif(1000)<br> >>x6 <- runif(1000)<br> >>x7 <- runif(1000)<br> >>x8 <- runif(1000)<br> >>y <- rnorm(1000)<br> >>fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2)<br> > <br> > <br> > No crash, a quite reasonable fit.<br> > <br> > Can we please have a reproducible example, as we do ask?<br> > <br> <br> Hmm, crashes for me as well with R-2.1.1 and R-2.2.0 beta (2005-09-27 <br> r35682M) on WinNT 4.0, SP6.<br> <br> <br> Let's make it reproducible:<br> <br> set.seed(123)<br> x1 <- runif(1000)<br> x2 <- runif(1000)<br> x3 <- runif(1000)<br> x4 <- runif(1000)<br> x5 <- runif(1000)<br> x6 <- runif(1000)<br> x7 <- runif(1000)<br> x8 <- runif(1000)<br> y <- rnorm(1000)<br> fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2)<br> <br> <br> Uwe Ligges<br> </tt></font> <br><FONT SIZE=3><BR> <BR> NOTICE<BR> Please immediately e-mail back to sender <BR> if you are not the intended recipient. <BR> <BR> Thereafter delete the e-mail along with <BR> any attachments without making copies. <BR> <BR> Elkem reserves all rights of privilege, <BR> confidentiality and copyright.<BR> </FONT> --=_alternative 004613C000257091_=--
Peter Dalgaard
2005-Oct-05 13:02 UTC
[Rd] Ad: Re: R crashes for large formulas in lm() (PR#8180)
Hallgeir.Grinde at elkem.no writes:> Dette er en melding med flere deler i MIME-format. > --=_alternative 004613C000257091_> Content-Type: text/plain; charset="US-ASCII" > > And some more informastion I forgot. > R does not crash if I write out the formula: > > set.seed(123) > x1 <- runif(1000) > x2 <- runif(1000) > x3 <- runif(1000) > x4 <- runif(1000) > x5 <- runif(1000) > x6 <- runif(1000) > x7 <- runif(1000) > x8 <- runif(1000) > y <- rnorm(1000) > fit <- lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) > -> R crashes > > fit <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8 > +x1:x2+x1:x3+x1:x4+x1:x5+x1:x6+x1:x7+x1:x8 > +x2:x3++x2:x4+x2:x5+x2:x6+x2:x7+x2:x8 > +x3:x4+x3:x5+x3:x6+x3:x7+x3:x8 > +x4:x5+x4:x6+x4:x7+x4:x8 > +x5:x6+x5:x7+x5:x8 > +x6:x7+x6:x8 > +x7:x8) > -> R does not crash > This is the same formula, at least it should be.It isn't and it shouldn't. (Try it for smaller values of 8) y~(x1+x2+x3+x4+x5+x6+x7+x8)^2 should be same as the second formula, modulo the syntax error. -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Apparently Analagous Threads
- Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8180)
- Ad: Re: R crashes for large formulas in lm() (PR#8180)
- Ad: Re: Ad: Re: R crashes for large formulas in lm() (PR#8181)
- Ad: Re: R crashes for large formulas in lm() (PR#8180)
- R crashes for large formulas in lm() (PR#8180)