[R] Lapack error in Design:::ols

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Apr 3 14:25:50 CEST 2008


This is not an LAPACK error, but an R function chol2inv 
complaining that it is being misused.

The problem is that you have a vastly overparametrized model (using 
recover())

Browse[1]> dim(X)
[1]  20 143

and ols() does not detect that, whereas lm() would.  I'd suggest ols() 
is to blame here.


On Thu, 3 Apr 2008, Gad Abraham wrote:

> Hi,
>
> I'm trying to use Frank Harrell's Design:::ols function to do regression
> of y (numeric) on the interaction of two factors (x1 and x2), but Lapack
> throws an error:
>
> > library(Design)
> ...
> > load(url("http://www.csse.unimelb.edu.au/~gabraham/x"))
> > ols(y ~ x1 * x2, data=x)
> Error in chol2inv(fit$qr$qr) : 'size' cannot exceed nrow(x) = 20
> > traceback()
> 6: .Call("La_chol2inv", x, size, PACKAGE = "base")
> 5: chol2inv(fit$qr$qr)
> 4: ols(y ~ x1 * x2, data = x)
> 3: eval.with.vis(expr, envir, enclos)
> 2: eval.with.vis(ei, envir)
> 1: source("t.R", echo = TRUE)
>
> Any ideas?
>
> Thanks,
> Gad
>
> > sessionInfo()
> R version 2.6.2 (2008-02-08)
> x86_64-pc-linux-gnu
>
> locale:
> LC_CTYPE=en_AU.UTF-8;LC_NUMERIC=C;LC_TIME=en_AU.UTF-8;LC_COLLATE=en_AU.UTF-8;
> LC_MONETARY=en_AU.UTF-8;LC_MESSAGES=en_AU.UTF-8;LC_PAPER=en_AU.UTF-8;LC_NAME=C;
> LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_AU.UTF-8;LC_IDENTIFICATION=C
>
> attached base packages:
> [1] splines   stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> other attached packages:
> [1] Design_2.1-1  survival_2.34 Hmisc_3.4-3
>
> loaded via a namespace (and not attached):
> [1] cluster_1.11.9  grid_2.6.2      lattice_0.17-4  rcompgen_0.1-17
>
> --
> Gad Abraham
> Dept. CSSE and NICTA
> The University of Melbourne
> Parkville 3010, Victoria, Australia
> email: gabraham at csse.unimelb.edu.au
> web: http://www.csse.unimelb.edu.au/~gabraham
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list