I have spatial data set for 35 studies. In each study, there are variables y, x1, x2, latitude, and longitude. I want to know whether adding x2 to model y~x1 will improve the simple regression model y~x1.
m_study1 = gls(y ~ x1 + x2, data=study1, correlation=corExp(form=~Lat+Long)) for each study. I also use
m_study1_x1 = gls(y ~ x1, data=study1, correlation=corExp(form=~Lat+Long)). I used AIC to compare two models and got an error "models are not all fitted to the same number of observations". I think that is because of different df in two models. What should I do? How can I tell whether adding x2 will improve predicting y? Thx.