[R] nlme: "Deficient rank in gls_loglik" when creating corAR1()

David Hugh-Jones davidhughjones at gmail.com
Tue May 3 17:53:40 CEST 2005

I have a bunch of data which is structured by year and US state, so I
have created a nlme groupedData object for it:


Now I am trying to run a gls regression on it. I want the error
correlation structure to be AR1 with a different rho for each state,
so I do

> mdyn.1.1 = gls(model = DEPVAR ~ BLAH + BLAH, data=gd2, corr=corAR1(form= ~ YEAR | ABREV),na.action=na.omit)

YEAR and ABREV are always present; DEPVAR is absent for one state.

I get the following error message:

Error in logLik.glsStruct(glsSt, glsPars) :
        Deficient rank in gls_loglik

Can anyone enlighten me? The error message goes away if I just do
corAR1(form = ~1), but this is not meaningful for my data.


More information about the R-help mailing list