Dear friends, In gls() of nlme package, there is some explanation on correlation: gls(model, data, correlation, weights, subset, method, na.action, control, verbose) correlation: an optional 'corStruct' object describing the within-group correlation structure. See the documentation of 'corClasses' for a description of the available 'corStruct' classes. If a grouping variable is to be used, it must be specified in the 'form' argument to the 'corStruct' constructor. Defaults to 'NULL', corresponding to uncorrelated errors. Now i have two categorical variables: grass and altitude, *gls.fit <-gls(log(snail)~grass+altitude+gheight+humidity+soiltemr+airtemr,data=model,correlation=corAR1( form=~grass+altitude))* Is the above argument that i use right? thanks very much! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of Epidemiology School of Public Health Fudan University Tel:86-21-54237149 [[alternative HTML version deleted]]