Skip to content
Prev 636 / 29559 Next

remove first trend from dataset

Hi Naren,

If understand your problem correctly, all you have to do is to remove 
your trend by using linear regression.

Assuming you have geostatiscal data (point observations of a 
continuously varying quantity over a region), then you want to estimate 
the mean function, remove the trend (large scale variation) using linear 
regression and plot the variogram of the residuals (micro scale variation).

I believe geoR has implemented the trend removal quite nicely, but I am 
sure other packages have done it as well.

There is an example of trend removal in this paper by Paulo, Ole and Peter:

http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Proceedings/RibeiroEtAl.pdf

You can do it by hand by fitting a this model using lm():

z ~ b0 + b1 x + b2 y + e

and plotting the variogram of the residuals. If you wish to predict z, 
for mapping using kriging, then, you would have to add the trend back to 
the predicted residuals.

Other methods such as median polish are also used, here is a nice 
example of the trend removal using the median polish on R by Petrutza 
Caragea from IA State:

http://www.public.iastate.edu/~pcaragea/S4_506/coal_analysis.txt

Cheers,

Jose
Narendran Kodandapani wrote: