0
$\begingroup$

I did a regression analysis with categorical data with a glm model approach, which worked fine. I have longitude and latitude coordinates for each observation and I want to add their geographic spillover effect to the model.

My sample data is structured:

Index DV IVI IVII IVIII IVIV Long  Lat
1     0  2   1    3     -12  -17.8 12
2     0  1   1    6     112  11    -122
3     1  3   6    1     91   57    53

with regression eq. DV ~ IVI + IVII + IVIII + IVIV

That mentioned, I assume that the nearer regions are, the more it may influence my dependant variable. I found several approaches for spatial regression models, but not for categorical data. When I try to use existing libraries and functions, such as spdep's lagsarlm, glmmfields, spatialreg, gstat, geoRglm, 'spatialprobit' and many more (I used this list as a reference: https://cran.r-project.org/web/views/Spatial.html). For numeric values, I am able to do spatial regression, but for categorical values, I struggle.

The data structure is the following:

library(dplyr)
data <- data %>%
  mutate(
    DV = as.factor(DV),
    IVI = as.factor(IVI),
    IVII = as.factor(IVII),
    IVIII = as.factor(IVIII),
    IVIV = as.numeric(IVIV),
    longitude = as.numeric(longitude),
    latitude = as.numeric(latitude)
  )

My dependant variable (0|1), as well as my independent variables, are categorical and it would be no use to transform them, of course. I want to have an other glm model in the end, but with spatial spillover effects included. The libraries I tested so far can't handle categorical data.

Any leads/ideas would be greatly appreciated.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.