0

I have a time series dataset of the amount of forest loss and the mean monsoon temperature and precipitation in 590 districts in a country. The format being a value for forest loss in kilometres, a value for temperature in Celsius and a value for precipitation in mm for each datapoint (district) for each year between 2000-2018.

There is spatial autocorrelation in the data which has been identified using a variogram and Moran's I.

The problem is I tried to run a lme model, with a random effect of the State that district is within:

mod.cor<-lme(FLkm ~ Monsoon.Precip +
 Monsoon.Temp,correlation=corGaus(form=~x+y,nugget=TRUE),
 data=NE1, random = ~1|State)

And it gives me the error:

Error in getCovariate.corSpatial(object, data = data) : cannot have zero distances in "corSpatial"

I have looked up whether I can add correlation structures to models with time series data and it seems it may be possible with other methods such as Ordinary Least Squares, Geographically Weighted Regression or spatial autoregressive lag methods but I cannot find out more than this.

Has anyone been able to model data like this while accounting for spatial autocorrelation and how did you do it?

Greg
  • 3,570
  • 5
  • 18
  • 31
Alice
  • 1
  • Welcome to SO @Alice, it would be nice if you could provide a reproducible example as explained [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – cbo Feb 28 '20 at 14:38
  • Hi @cbo, thanks for the edits! I can't provide a subset of my data unfortunately, but the format is straighforward as explained with two explanatory variables of temperature and precipitation and a response variable of forest loss. I know why I am getting the problem with my data, the problem being that the lat and lon values appear multiple times (18 times, one for each year). The question I'm asking is regarding methods to account for spatial autocorrelation in a model with time series data (repetitive coordinates). – Alice Feb 28 '20 at 14:56
  • It feels more like a methodology problem then. You will have more and better answer at [stats.stackexchange](https://stats.stackexchange.com/). One way to achieve what you want could be to add lagged variables to your spatial model to account for time dependency. – cbo Feb 28 '20 at 15:04
  • Hi yes I read about adding lagged variables but currently cannot find a worked example so finding it hard to understand and implement this method. Have you got an example? And thanks for recommending stats.stackexchange I'll post it there and see if anyone can help! – Alice Feb 28 '20 at 15:10

0 Answers0