[R] Error from gls call (package nlme)

Christoph Lehmann christoph.lehmann at gmx.ch
Thu Sep 25 13:31:38 CEST 2003


Hi
I have a huge array with series of data. For each cell in the array I
fit a linear model, either using lm() or gls()

with lm() there is no problem, but with gls() I get an error:

	Error in glsEstimate(glsSt, control = glsEstControl) :
        	computed gls fit is singular, rank 2

as soon as there are data like this:
	> y1 <- c(0,0,0,0)
	> x1 <- c(0,1,1.3,0)
	> gls(y1~x1)
	Error in glsEstimate(glsSt, control = glsEstControl) :
	        computed gls fit is singular, rank 2

of course, this is not a problem for lm()

	> lm(y1~x1)
 
	Call:
	lm(formula = y1 ~ x1)
	 
	Coefficients:
	(Intercept)           x1
	          0            0

I know, that such data does not make "sense" but it is possible, that
something like this occurs in my data-set. Since I call gls() for every
cell of my array in a loop, I don't want such errors to occur, since
this breaks my loop.

what is the problem here? What are potential solutions?

Many thanks

Christoph
-- 
Christoph Lehmann <christoph.lehmann at gmx.ch>




More information about the R-help mailing list