0

I have a csv file containing LST values for several study sites, canopy cover for each study site, and impervious cover for each study site, and the geographic x/y coordinates for each study site. I have created a linear model as: LST ~ canopy cover + impervious cover.

I want to check for spatial autocorrelation by plotting a variogram of the model residuals. I've been trying to use the variogram() function in gstat but can't quite figure out the proper way to write the code (in particular for the locations argument).

2
  • what problems have you faced when trying to use variogram()? can you copy and paste here a dput(head(your_data_frame) and the code you are trying to run?
    – Elio Diaz
    Commented Aug 14, 2020 at 15:59
  • 1
    In a classic 'me' fashion, I ended up solving this issue on my own just minutes after posting this question. The way to solve it was to add a column to my csv file of the model residuals and then create a variogram of the residuals using variogram (resid~1, data=data). But thank you for the help!
    – Emily
    Commented Aug 14, 2020 at 17:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.