Can I use gls if I don't need to use mixed models and var is not structured?


New Member
I have a continuous variable that is related to a covariable linearly. I need to compare this relationship between months (24 months), but the dataset is very heterogeneous: the sample size is different (very) between months and the covariate range is also different between months, obviously there is a big heteroscedasticity.

I was using told that I may use gls instead of lm because gls (in nlme package for R) are specially robust in the absence of homoscedasticity. The thing is that variance of my data is not structured and the observations are independent ie I don't need mixed models. I am not sure if I can use gls anyway or if it is a good idea just because my data is heteroscedastic but if this was correct it would be great! I have been looking in books (specially Pinheiro & Bates, 2002) and other forums but it seems that nobody has tried to do so.

Is it correct to use gls anyway in these cases?:confused:


Omega Contributor
What does gls stand for? Guessing generalized linear ...

Is your question related to time series? Are there repeated measures, but a lack of standardized spacing between measures?


New Member
No, I sampled different crabs each month so I need to compare for example the weight of an organ of the animal vs its size between months so I can find in which month the weigth "changes" and try to relate that to the biology of the animal. The problem is:- I have not the same range of sizes for each month, -different sample sizes for each month, -there also is a natural variability and- lots of month to compare (which is supossed to be great) but all of these makes the homoscedasticity impossible even with transformation data. I need a test that is robust even with heteroscedasticity and someone told me that gls would be te solution, but studying the model I can't see if it would be correct to use gls with my data


Omega Contributor
Not completely following context, catching crabs and not eating them but weighing their organ ratio to weight from month to month. This still seems kind of like time series, not my forte. What does the month to month trend look like (e.g., monotonic). Can you start at the lightest month if there is a positive trend. What is the final purpose, to say had it is largest this month?

There is also: robust regression and general additive models (splines), form of heteroscedasticity and later non-linear trends.
Do you want to estimate the model:

weight = a + b*size +error

Or do you want to estimate:

weight = a + b1*size + b2*month + error

Have you considered that the weight generally grows with the cube of the size?

The problem is:- I have not the same range of sizes for each month, -different sample sizes for each month,
I don't think that is a problem.

I agree that the model could be estimated with GLS - generalized least squares.